Learn R Programming

Rssa (version 0.13-1)

bforecast: Perform bootstrap SSA forecasting of the series

Description

Perform bootstrap SSA forecasting of the one-dimensional series.

Usage

"bforecast"(x, groups, len = 1, R = 100, level = 0.95, type = c("recurrent", "vector"), ..., drop = TRUE, drop.attributes = FALSE, cache = TRUE) "bforecast"(x, groups, len = 1, R = 100, level = 0.95, type = c("recurrent", "vector"), ..., 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
the desired length of the forecasted series
R
number of bootstrap replications
level
vector of confidence levels for bounds
type
the type of forecast method to be used during bootstrapping
...
additional arguments passed to forecasting 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 matricies. Each matrix has 1 + 2*length(level) columns and 'len' rows. First column contains the forecasted values, remaining columns --- low and upper bootstrap confidence bounds for average forecasted values.The matrix itself, if length of groups is one and 'drop = TRUE'.

Details

The routine uses the reconstruction residuals in order to calculate their empirical distribution (the residuals are assumed to be stationary). Empirical distribution of the residuals is used to perform bootstrap series simulation. Such bootsrapped series are then extended via selected forecast method. Finally, the distribution of forecasted values is used to calculate bootstrap estimate of series forecast and confidence bounds.

See Also

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

Examples

Run this code
# Decompose 'co2' series with default parameters
s <- ssa(co2)
# Produce 24 forecasted values and confidence bounds of the series using
# the first 3 eigentriples as a base space for the forecast.

f <- bforecast(s, groups = list(1:3), len = 24, R = 50)
matplot(f, col = c("black", "red", "red"), type='l')

Run the code above in your browser using DataLab