Rssa (version 1.0)

rforecast: Perform recurrent SSA forecasting of the series

Description

Perform recurrent SSA forecasting of the series.

Usage

# S3 method for 1d.ssa
rforecast(x, groups, len = 1, base = c("reconstructed", "original"),
          only.new = TRUE, reverse = FALSE, …,
          drop = TRUE, drop.attributes = FALSE, cache = TRUE)
# S3 method for toeplitz.ssa
rforecast(x, groups, len = 1, base = c("reconstructed", "original"),
          only.new = TRUE, reverse = FALSE, …,
          drop = TRUE, drop.attributes = FALSE, cache = TRUE)
# S3 method for mssa
rforecast(x, groups, len = 1, base = c("reconstructed", "original"),
          direction = c("row", "column"), only.new = TRUE, …, drop = TRUE,
          drop.attributes = FALSE, cache = TRUE)
# S3 method for cssa
rforecast(x, groups, len = 1, base = c("reconstructed", "original"),
          only.new = TRUE, reverse = FALSE, …,
          drop = TRUE, drop.attributes = FALSE, cache = TRUE)
# S3 method for pssa.1d.ssa
rforecast(x, groups, len = 1, base = c("reconstructed", "original"),
          only.new = TRUE, reverse = FALSE, …,
          drop = TRUE, drop.attributes = FALSE, cache = TRUE)

Arguments

x

SSA object holding the decomposition

groups

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

len

integer, the desired length of the forecasted series

base

series used as a 'seed' of forecast: original or reconstructed according to the value of groups argument

direction

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

only.new

logical, if 'TRUE' then only forecasted values are returned, whole series otherwise

reverse

logical, direction of forecast in 1D SSA case, 'FALSE' (default) means that the forecast moves forward in the time and 'TRUE' means the opposite

additional arguments passed to reconstruct routines

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 attributes of the input series are not copied to the reconstructed ones.

cache

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

Value

List of forecasted objects. Elements of the list have the same names as elements of groups. If group is unnamed, corresponding component gets name `Fn', where `n' is its index in groups list.

Or, the forecasted object itself, if length of groups is one and 'drop = TRUE'.

Details

The routines applies the recurrent SSA forecasting algorithm to produce the new series which is expected to 'continue' the current series on the basis of the decomposition given. The algorithm sequentialy projects the incomplete embedding vectors (either original or from reconstructed series) onto the subspace spanned by the selected eigentriples of the decomposition to derive the missed (ending) values of the such vectors.

In such a way the forecasted elements of the series are produced on one-by-one basis.

In particular, the \(m\)-th step of the forecast is calculated by means of linear recurrence relation (see lrr) as \(y_{n+m}=\sum_{k=1}^{L-1} a_k y_{n+m-k}\) where the starting points \(y_{n-(L-2)}\), …, \(y_{n}\) are taken from the reconstructed time series (base="reconstructed") or from the initial (base="initial") time series.

For multichannel SSA the column forecast is obtained via applying the LRR to each series separately. Forecast uses the formulae from (Golyandina and Stepanov, 2005, and Golyandina et.al, 2015).

References

Golyandina, N., Nekrutkin, V. and Zhigljavsky, A. (2001): Analysis of Time Series Structure: SSA and related techniques. Chapman and Hall/CRC. ISBN 1584881941

Golyandina, N., Korobeynikov, A., Shlemov, A. and Usevich, K. (2015): Multivariate and 2D Extensions of Singular Spectrum Analysis with the Rssa Package. Journal of Statistical Software, Vol. 67, Issue 2. https://www.jstatsoft.org/article/view/v067i02

Golyandina, N. and Stepanov, D. (2005): SSA-based approaches to analysis and forecast of multidimensional time series. In Proceedings of the 5th St.Petersburg Workshop on Simulation, June 26-July 2, 2005, St. Petersburg State University, St. Petersburg, 293--298. http://www.gistatgroup.com/gus/mssa2.pdf

See Also

Rssa for an overview of the package, as well as, forecast, vforecast, bforecast.

Examples

Run this code
# NOT RUN {
# Decompose 'co2' series with default parameters
s <- ssa(co2)
# Produce 24 forecasted values of the series using different sets of eigentriples
# as a base space for the forecast.
rfor <- rforecast(s, groups = list(c(1,4), 1:4), len = 24, only.new=FALSE)
matplot(data.frame(c(co2, rep(NA, 24)), rfor), type = "l")

# Forecast `co2' trend by SSA with projections
s <- ssa(co2, column.projector = 2, row.projector = 2)
len <- 100
rfor <- rforecast(s, groups = list(trend = seq_len(nspecial(s))), len = len, only.new = FALSE)
matplot(data.frame(c(co2, rep(NA, len)), rfor), type = "l")

# Forecast finite rank series with polynomial component by SSA with projections
v <- 5000 * sin(2*pi / 13 * (1:100)) +  (1:100)^2 + 10000
s <- ssa(v, row.projector = 2, column.projector = 2)
plot(rforecast(s, groups = list(all = 1:6), len = 100, only.new = FALSE), type = "l")
# }

Run the code above in your browser using DataLab