Learn R Programming

Rssa (version 0.8.2)

new.ssa: Create a new SSA object

Description

Set up the SSA object and perform the decomposition, if necessary.

Usage

new.ssa(x,
        L = (N - 1) %/% 2,
        ...,
        kind = c("1d-ssa", "2d-ssa", "toeplitz-ssa"),
        svd_method = c("nutrlan", "propack", "svd", "eigen"),
        force.decompose = TRUE)

Arguments

x
object to be decomposed. Vector for 1d SSA (or something which can be coerced to a vector), matrix-like object for 2d SSA.
L
integer, window length. Fixed to half of the series length by default. Should be vector of length 2 for 2d SSA
...
further arguments passed to decompose (e.g. neig).
kind
SSA method. This includes ordinary 1d SSA, 2d SSA and toeplitz variant of 1d SSA.
svd_method
singular value decomposition method. See 'Details' for more info.
force.decompose
logical, if 'TRUE' then the decomposition is performed before return.

Value

  • Object of class `ssa'. The precise layout of the object is mostly meant opaque and subject to change in different version of the package.

Details

This is the main entry point to the package. This routine constructs the SSA object filling all necessary internal structures and performing the decomposition if necessary. The following implementations of the SSA method are supported (corresponds to different values of kind argument):
  • Basic 1d SSA as described in Chapter 1 of (Golyandina at all, 2001).
  • 2d SSA for decomposition of images and fields. See (Golyandina and Usevich, 2009) for more information.
  • Toeplitz variant of 1d SSA. See Section 1.7.2 in (Golyandina at all, 2001).
Note that so-called M-SSA method (aka multichannel SSA) is a special version of 2d SSA with window length having one component set to one.

The main step of the SSA method is the singular decomposition of the so-called series trajectory matrix. Package provides several implementations of this procedure (corresponds to different values of svd_method) argument: [object Object],[object Object],[object Object],[object Object]

Usually the new.ssa function tries to provide the best SVD implementation for given series length and the window size. In particular, for small series and window sizes it is better to use generic black-box routines (as provided by 'svd' and 'eigen' methods). For long series special-purpose routines are to be used.

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. and Usevich, K. (2009). 2D-extensions of singular spectrum analysis: algorithm and elements of theory. In Matrix Methods: Theory, Algorithms, Applications. World Scientific Publishing, 450-474.

Korobeynikov, A. (2010) Computation- and space-efficient implementation of SSA. Statistics and Its Interface, Vol. 3, No. 3, Pp. 257-268

See Also

svd, decompose, ssa

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)))

Run the code above in your browser using DataLab