Example of time series prediction using neural networks in R

Anyone’s got a quick short educational example how to use neural networks (nnet in R for example) for the purpose of prediction?

Here is an example, in R, of a time series

T <- seq(0,20,length=200)
Y <- 1 + 3*cos(4*T+2) +.2*T^2 + rnorm(200)

This just an example but what I have is jumpy-seasonal data.


Rob Hyndman is doing some active research on forecasting with nueral nets. He recently added the nnetar() function to the forecast package that utilizes the nnet package you reference to fit to time series data.


The example from the help docs:

fit <- nnetar(lynx)
fcast <- forecast(fit)

Rob gives more context in this specific section of his online text: Forecasting: principles and practice.

(And a big thanks to Rob obviously.)

Source : Link , Question Author : dfhgfh , Answer Author : Shea Parkes

Leave a Comment