Woh, didn’t think we’d put putting this into practive so soon!
#neural networks
fit.nnetar <- nnetar(ts2)
print(fit.nnetar)
## Series: ts2
## Model: NNAR(1,1,2)[12]
## Call: nnetar(y = ts2)
##
## Average of 20 networks, each of which is
## a 2-2-1 network with 9 weights
## options were - linear output units
##
## sigma^2 estimated as 6703
frc.nnetar <- forecast(fit.nnetar, h = 12)
plot(frc.nnetar)