Skip to content

Commit

Permalink
feat: add seasonal_periods check that endog is at least twice the size
Browse files Browse the repository at this point in the history
  • Loading branch information
Lopa10ko committed Jun 14, 2024
1 parent c53af7a commit a79d3d3
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,10 @@ def _check_and_correct_params(self, endog: np.ndarray) -> bool:
self.params.update(**{'trend': 'add'})
params_changed = True

if self.params.get('seasonal'):
self.seasonal_periods = min(int(0.5 * (len(endog) - 1)), self.seasonal_periods)
self.seasonal_periods = max(self.seasonal_periods, 1)
self.params.update(**{'seasonal_periods': self.seasonal_periods})
params_changed = True

return params_changed

0 comments on commit a79d3d3

Please sign in to comment.