Learn R Programming

Rssa (version 0.8.2)

calc.v: Calculate Factor Vector(s)

Description

Generic function for the factor vector calculation given the SSA decomposition.

Usage

## S3 method for class 'ssa':
calc.v(this, idx, env = .GlobalEnv, \dots)

Arguments

this
SSA object holding the decomposition.
idx
indices of the factor vectors to compute.
env
temporary environment used for precalculation.
...
additional arguments to 'calc.v'.

Value

  • A numeric vector of suitable length (usually depends on SSA method and window length).

Details

Factor vector is a column of the factor matrix V, which is calculated as follows: $$V = \Sigma^{-1} X^{T} U,$$ where X is a Hankel trajectory matrix, U is the matrix of eigenvectors and Sigma is a matrix of singular values.

Note that for several SVD methods (`eigen' and `svd' currently) the matrix X is not stored inside the `ssa' object and must be calculated out of series which might be pretty time-consuming, especially if multiple calls to the routine are desired. User might provide a temporary garbage-collected environment, which the routine will use to store different values which will be shared between the calls. It is the user responsibility to ensure that the environment is valid (e.g. it was populated via the call of calc.v with the same `ssa' object as an argument). Temporary environment is not required for fast FFT-based SVD method (`propack' and `nutrlan').

Examples

Run this code
# Decompose 'co2' series with default parameters
s <- new.ssa(co2)
# Calculate the 5th factor vector
v <- calc.v(s, 5)

Run the code above in your browser using DataLab