forecast: Perform SSA forecasting of series

forecastR Documentation

Perform SSA forecasting of series

Description

All-in-one function to perform SSA forecasting of one-dimensional series.

Usage

## S3 method for class '1d.ssa'
forecast(object,
         groups, h = 1,
         method = c("recurrent", "vector"),
         interval = c("none", "confidence", "prediction"),
         only.intervals = TRUE,
         ...,
         drop = TRUE, drop.attributes = FALSE, cache = TRUE)
## S3 method for class 'toeplitz.ssa'
forecast(object,
         groups, h = 1,
         method = c("recurrent", "vector"),
         interval = c("none", "confidence", "prediction"),
         only.intervals = TRUE,
         ...,
         drop = TRUE, drop.attributes = FALSE, cache = TRUE)
## S3 method for class '1d.ssa'
predict(object,
        groups, len = 1,
        method = c("recurrent", "vector"),
        interval = c("none", "confidence", "prediction"),
        only.intervals = TRUE,
        ...,
        drop = TRUE, drop.attributes = FALSE, cache = TRUE)
## S3 method for class 'toeplitz.ssa'
predict(object,
        groups, len = 1,
        method = c("recurrent", "vector"),
        interval = c("none", "confidence", "prediction"),
        only.intervals = TRUE,
        ...,
        drop = TRUE, drop.attributes = FALSE, cache = TRUE)
## S3 method for class 'mssa'
predict(object,
        groups, len = 1,
        method = c("recurrent", "vector"),
        direction = c("column", "row"),
        ...,
        drop = TRUE, drop.attributes = FALSE, cache = TRUE)

Arguments

object

SSA object holding the decomposition

groups

list, the grouping of eigentriples to be used in the forecast

h, len

the desired length of the forecasted series

method

method of forecasting to be used

interval

type of interval calculation

only.intervals

logical, if 'TRUE' then bootstrap method is used for confidence bounds only, otherwise — mean bootstrap forecast is returned as well

direction

direction of forecast in multichannel SSA case, "column" stands for so-called L-forecast and "row" stands for K-forecast

...

further arguments passed for forecast routines (e.g. level argument to bforecast)

drop

logical, if 'TRUE' then the result is coerced to series itself, when possible (length of 'groups' is one)

drop.attributes

logical, if 'TRUE' then the forecast routines do not try to infer the time index arguments for the forecasted series.

cache

logical, if 'TRUE' then intermediate results will be cached in the SSA object.

Details

This function is a convenient wrapper over other forecast routines (see 'See Also') turning their value into object of type 'forecast' which can be used with the routines from forecast package.

Value

object of class 'forecast' for forecast function call, predicted series for predict call.

See Also

Rssa for an overview of the package, as well as, rforecast, vforecast, bforecast, forecast (package)

Examples

s <- ssa(co2)
# Calculate 24-point forecast using first 6 components as a base
f <- forecast(s, groups = list(1:6), method = "recurrent", bootstrap = TRUE, len = 24, R = 10)

# Plot the result including the last 24 points of the series
plot(f, include = 24, shadecols = "green", type = "l")
# Use of predict() for prediction
p <- predict(s, groups = list(1:6), method = "recurrent", len = 24)
# Simple plotting
plot(p, ylab = "Forecasteed Values")


Rssa documentation built on Sept. 11, 2024, 7:20 p.m.