forecast: Forecast future values

Description Usage Arguments Details Value See Also Examples

View source: R/itsmr.R

Description

Forecast future values

Usage

1
forecast(x, M, a, h = 10, opt = 2, alpha = 0.05)

Arguments

x

Time series data

M

Data model

a

ARMA model

h

Steps ahead

opt

Display option (0 silent, 1 tabulate, 2 plot and tabulate)

alpha

Level of significance

Details

The data model can be NULL for none. Otherwise M is a vector of function names and arguments.

Example:

M = c("log","season",12,"trend",1)

The above model takes the log of the data, then subtracts a seasonal component of period 12, then subtracts a linear trend component.

These are the available functions:

diff Difference the data. Has a single argument, the lag.
hr Subtract harmonic components. Has one or more arguments, each specifying the number of observations per harmonic.
log Take the log of the data, has no arguments.
season Subtract a seasonal component. Has a single argument, the number of observations per season.
trend Subtract a trend component. Has a single argument, the order of the trend (1 linear, 2 quadratic, etc.)

At the end of the model there is an implicit subtraction of the mean operation. Hence the resulting time series always has zero mean.

All of the functions are inverted before the forecast results are displayed.

Value

Returns the following list invisibly.

pred

Predicted values

se

Standard errors (not returned for data models with log)

l

Lower bounds (95% confidence interval)

u

Upper bounds

See Also

arma Resid test

Examples

1
2
3
4
M = c("log","season",12,"trend",1)
e = Resid(wine,M)
a = arma(e,1,1)
forecast(wine,M,a)

itsmr documentation built on Sept. 11, 2018, 1:05 a.m.