predict.garma_model: Predict future values.

View source: R/predict.R

predict.garma_modelR Documentation

Predict future values.

Description

Predict ahead using algorithm of Godet (2009).

Usage

## S3 method for class 'garma_model'
predict(object, n.ahead = 1, newdata = NULL, ...)

Arguments

object

(garma_model) The garma_model from which to predict the values. This should have been generated by the [garma()] function.

n.ahead

(int) The number of time periods to predict ahead. Default: 1

newdata

(real vector or matrix) If the original model was fitted with the 'xreg=' option then this will provide the xreg values for predictions. If this is a vector then its length should be 'n.ahead'; if it is a matrix then it should have 'n.ahead' rows.

It should have columns with the same names as the original xreg matrix.

...

Other parameters. Ignored.

Value

A "ts" object containing the requested forecasts.

References

Godet, F. Linear prediction of long-range dependent time series, ESAIM: PS (2009) 13 115-134. DOI: https://doi.org/10.1051/ps:2008015

Examples

data(AirPassengers)
ap <- as.numeric(diff(AirPassengers, 12))
mdl <- garma(ap, order = c(9, 1, 0), k = 0, method = "CSS", include.mean = FALSE)
predict(mdl, n.ahead = 12)

garma documentation built on April 4, 2025, 2:13 a.m.