Closed dashaub closed 9 years ago
I haven't tested it, but I'd imagine there would be a similar problem if the prediction intervals contain NaN
. For example, this fails with the same error
plot(wineind, ylim = c(0, NaN)) #error
This scenario is possible if the time series has very large numbers and the selected model has an increasing trend component..
Consider the following time series
This series could be fit by an ARIMA model nicely, but it has several outliers
Regardless, if we fit it as is, we get a selected model and finite prediction intervals
We might try a Box-Cox transform to stabilize the variance, and using
BoxCox.lambda()
we will get a selected value near 0. However, when we forecast with this model the prediction intervals are not finite, so theplot()
method fails.There is obviously an issue with the prediction intervals, and there could be several ways to solve it (e.g. add one and do a log or Box-Cox transform), but for now I'm addresing the failure of the
plot()
method for when the prediction intervals containsInf
. I'd propose solving this by creating a check inplot.forecast()
for if the prediction intervals are finite. If they are not, the method would not attempt to plot them and would instead merely plot the point estimitate, similar to howplot(forecast(nnetar(testseries)))
functions without the prediction intervals. A warning message for whenforecast()
does not generate finite prediction intervals might be nice too.