Skip to content

Commit

Permalink
Fixed issues:
Browse files Browse the repository at this point in the history
- Inverse Box-Cox calculation issue #1
  • Loading branch information
cotterpl committed Jan 18, 2019
1 parent 51a8686 commit a499501
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def run_tests(self):

setuptools.setup(
name='tbats',
version='1.0.4',
version='1.0.5',
packages=setuptools.find_packages(exclude=('test', 'test_R')),
url='https://github.com/intive-DataScience/tbats',
license='MIT License',
Expand Down
8 changes: 7 additions & 1 deletion tbats/abstract/Model.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,13 @@ def _fit_to_observations(self, y, starting_x):
# store fit results
self.x_last = x
self.resid_boxcox = yw - yw_hat
self.y_hat = self._inv_boxcox(yw_hat)
try:
self.y_hat = self._inv_boxcox(yw_hat)
except RuntimeWarning:
self.add_warning('Box-Cox related numeric calculation issues detected. Model is not usable.')
self.is_fitted = False
return self

self.resid = self.y - self.y_hat

self.is_fitted = True
Expand Down

0 comments on commit a499501

Please sign in to comment.