Fix scale<=0 error in old numpy versions for constant histories

This commit is contained in:
Ben Letham 2017-09-25 17:40:36 -07:00
parent 230b2ca6e0
commit 58173861b1
2 changed files with 2 additions and 2 deletions

View file

@ -7,4 +7,4 @@
from fbprophet.forecaster import Prophet from fbprophet.forecaster import Prophet
__version__ = '0.2' __version__ = '0.2.dev'

View file

@ -815,7 +815,7 @@ class Prophet(object):
if history['y'].min() == history['y'].max(): if history['y'].min() == history['y'].max():
# Nothing to fit. # Nothing to fit.
self.params = stan_init() self.params = stan_init()
self.params['sigma_obs'] = 0. self.params['sigma_obs'] = 1e-9
for par in self.params: for par in self.params:
self.params[par] = np.array([self.params[par]]) self.params[par] = np.array([self.params[par]])
elif self.mcmc_samples > 0: elif self.mcmc_samples > 0: