Last chance! 50% off unlimited learning
Sale ends in
Perform recurrent SSA forecasting of the series.
# 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)
SSA object holding the decomposition
list, the grouping of eigentriples to be used in the forecast
integer, the desired length of the forecasted series
series used as a 'seed' of forecast: original or
reconstructed according to the value of groups
argument
direction of forecast in multichannel SSA case, "column" stands for so-called L-forecast and "row" stands for K-forecast
logical, if 'TRUE' then only forecasted values are returned, whole series otherwise
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
logical, if 'TRUE' then the result is coerced to series itself, when possible (length of 'groups' is one)
logical, if 'TRUE' then the attributes of the input series are not copied to the reconstructed ones.
logical, if 'TRUE' then intermediate results will be cached in the SSA object.
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'.
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 lrr
) as
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).
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
Rssa
for an overview of the package, as well as,
forecast
,
vforecast
,
bforecast
.
# 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