fitted.nnetar {forecast}R Documentation

h-step in-sample forecasts using nnetar models

Description

Returns h-step forecasts for the data used in fitting the nnetar model.

Usage

## S3 method for class 'nnetar'
fitted(object, h=1, ...)

Arguments

object

An object of class "nnetar". Usually the result of a call to nnetar.

h

The number of steps to forecast ahead.

...

Other arguments.

Value

A time series of the h-step forecasts.

Author(s)

Rob J Hyndman & Mitchell O'Hara-Wild

See Also

forecast.nnetar.

Examples

fit <- nnetar(WWWusage)
plot(WWWusage)
lines(fitted(fit), col='red')
lines(fitted(fit, h=2), col='green')
lines(fitted(fit, h=3), col='blue')
legend("topleft", legend=paste("h =",1:3), col=2:4, lty=1)

[Package forecast version 7.3 Index]