fitted.Arima: h-step in-sample forecasts for time series models.

Description Usage Arguments Value Author(s) See Also Examples

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S3 method for class 'Arima'
fitted(object, h=1, ...)
## S3 method for class 'fracdiff'
fitted(object, h=1, ...)
## S3 method for class 'bats'
fitted(object, h=1, ...)
## S3 method for class 'tbats'
fitted(object, h=1, ...)
## S3 method for class 'ets'
fitted(object, h=1, ...)
## S3 method for class 'nnetar'
fitted(object, h=1, ...)

Arguments

object

An object of class "Arima", "bats", "tbats", "ets" or "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.Arima, forecast.bats, forecast.tbats, forecast.ets, forecast.nnetar, residuals.Arima, residuals.bats, residuals.tbats, residuals.ets, residuals.nnetar.

Examples

1
2
3
4
5
6
fit <- ets(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)

pli2016/forecast documentation built on May 25, 2019, 8:22 a.m.