Skip to content

Commit dab61dc

Browse files
committed
add input validation for bandwidth and epsilon parameters
1 parent 1ba0333 commit dab61dc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

causalpy/pymc_experiments.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,12 @@ def _input_validation(self):
10821082
"""The treated variable should be dummy coded. Consisting of 0's and 1's only.""" # noqa: E501
10831083
)
10841084

1085+
if self.bandwidth <= 0:
1086+
raise ValueError("The bandwidth must be greater than zero.")
1087+
1088+
if self.epsilon <= 0:
1089+
raise ValueError("Epsilon must be greater than zero.")
1090+
10851091
def _is_treated(self, x):
10861092
"""Returns ``True`` if `x` is greater than or equal to the treatment threshold.""" # noqa: E501
10871093
return np.greater_equal(x, self.kink_point)

0 commit comments

Comments
 (0)