[R] Trouble with function nnetar

Paul Bernal paulbernal07 at gmail.com
Tue Jul 29 18:35:44 CEST 2014


 I was playing around with the nnetar function in the forecast package,
trying to generate a 3-year forecast (36 months), the R fit result is shown
below:

 #Neural Nets Fitting and Forecast
>
> fit<-nnetar(condataset$ConPcums97)
> fit
Series: condataset$ConPcums97
Model:  NNAR(13)
Call:   nnetar(x = condataset$ConPcums97)

Average of 20 networks, each of which is
a 13-7-1 network with 106 weights
options were - linear output units

sigma^2 estimated as 5.34e+12

Now, R is sending me the following error message:

 x<-forecast(fit, h=36)
Error in predict.nnet(X[[1L]], ...) : missing values in 'x'
>
> forecast(fit)
Error in predict.nnet(X[[1L]], ...) : missing values in 'x'
> x<-forecast(nnetar(condataset$ConPcums97), h=36)
Error in predict.nnet(X[[1L]], ...) : missing values in 'x'

I am attaching the same data I used to try the nnetar function. Can you
give me some guidance or tell me what could be done to generate the
forecast with this function?

Best regards,

Paul


More information about the R-help mailing list