Open bletham opened 5 years ago
My money is on that long sequence of zeros. These tend to make STAN’s estimates numerically unstable and subject to small changes in values.
If someone is passing in a lot of zeros it’s likely because they’re missing data.
I just ran into the same error and found a fix/workaround. My target y-values are generally between 1 and 20 in any given time period and I sent them to the log-scale to achieve data compression. When in the log scale, the handful of values that were < 1 are now negative. After pounding my head a bit, I added 1 to my initial y's before applying the log so that all transformed values, on which the model is trained, are always positive. Poof! Model was fit and I undid the transform at the end with np.exp(yhat)-1
.
I know this is not a fix for the numerical stability issue at hand in pystan but I thought it would be useful if you really need a workaround.
Also just got this issue. Sorry, don't have time to write out a description, but I've been getting this as well.
Here too. I changed "floor" from 3 to 1 and it worked.
Same here with growth="logistic", removed "yearly_seasonality=False, weekly_seasonality=False, daily_seasonality=False" no errors, but yhat is NaN, it happens because my carrying capacity is so high... any problem with it?
Thanks for the suggestion @JJ, changing the floor from 0 to -1 fixed this for me!
do df['y'] = np.log(df['y'] + 1)
and the calculate the log inverse at the end and subtract 1 from this....
Hi all - I swapped the floor from 0 to 0.01 and managed to by-pass the error.
I was using
"yearly_seasonality": False,
"weekly_seasonality": False,
"daily_seasonality": False,
for yearly forecast and faced this error converted the values to
"yearly_seasonality": False,
"weekly_seasonality": True,
"daily_seasonality": True,
And fixed my problem
From @humphreyapplebee:
I was able to find another example of a series that exhibits this behaviour:
With LBGFS (i.e.
model.fit(df, algorithm='LBFGS')
), the training stalls as described above. Interestingly, training no longer stalls when I modify the number of changepoints (either adding more or less) or perturb the training data even very slightly (e.g. by dropping a significant figure from one of the dates).With Newton (i.e.
model.fit(df, algorithm='Newton')
), I receive the following exception:Originally posted by @humphreyapplebee in https://github.com/facebook/prophet/issues/842#issuecomment-504472349