Learn R Programming

Rssa (version 0.8.2)

reconstruct: Perform a series reconstruction

Description

Reconstruct the series given the SSA decomposition and the desired grouping of the elementary subseries.

Usage

## S3 method for class 'ssa':
reconstruct(this, groups, \dots, cache = TRUE)

Arguments

this
SSA object
groups
list of numeric vectors, indices of elementary subseries used for reconstruction.
...
further arguments passed to routines (e.g. to decompose routine if the continuation is desired).
cache
logical, if 'TRUE' then intermediate results will be cached in the SSA object.

Value

  • List of vectors of reconstructed series. Elements of the list are named 'F1'', 'F2', and so on.

Examples

Run this code
# Decompose 'co2' series with default parameters
s <- new.ssa(co2)
# Reconstruct the series, grouping elementary subseries 2, 3 and 4, 5.
r <- reconstruct(s, groups = list(1, c(2,3), c(4,5)))
plot(r$F1, col = "black")
lines(r$F1 + r$F2, col = "red")
lines(r$F1 + r$F2 + r$F3, col = "blue")
# 'groups' argument might contain duplicate entires as well
r <- reconstruct(s, groups = list(1, 1:3, 1:5))
plot(r$F1, col = "black")
lines(r$F2, col = "red")
lines(r$F3, col = "blue")

Run the code above in your browser using DataLab