# ssa-routines: Properties of SSA object In Rssa: A Collection of Methods for Singular Spectrum Analysis

## Description

Functions to access various fields of SSA object, query for number of singular values, eigenvectors, factor vectors and ‘special’ decomposition triples (now, ProjectionSSA triples) in the SSA object and other miscellaneous info.

## Usage

 ```1 2 3 4 5 6 7 8 9``` ```nsigma(x) nu(x) nv(x) ## S3 method for class 'ssa' nspecial(x) ## S3 method for class 'ssa' summary(object, digits = max(3, getOption("digits") - 3), ...) ## S3 method for class 'ssa' x\$name ```

## Arguments

 `x` SSA object to query `object` an object for which a summary is desired `digits` integer, used for number formatting `...` additional arguments affecting the summary produced `name` field of SSA object to extract. See 'Details' for list of the fields

## Details

The internals of SSA object is inheritely opaque, because depending on the selected SVD method and other conditions it might contains different fields.

However, it is possible to extract some fields out of it using the operator `\$`, in particular, the following values of argument `name` are supported:

sigma

Vector of singular values

U

The matrix of eigenvectors

V

The matrix of factor vectors. Might not exist depending on the selected SVD method

If SSA with projections is being performed, then the eigentriples are ordered as follows: at first, row projection triples, then column projection triples and then SVD-triples. Non-SVD triples (like projection triples) are called ‘special triples’. The number of special triples can be obtained by calling `nspecial` method. Also, one can use the following fields of the SSA object:

nPR

the number of row projection triples, may be NULL

nPL

the number of column projection triples, may be NULL

## Value

an 'integer' of length 1 for `nu`, `nv`, `nsigma`, `nspecial` routines, matrix or vector for `\$` operator.

The result of Decomposition step of SSA and its modifications can be written down in the following form:

(*) X = sum_i X_i, X_i = sigma_i U_i (V_i)^T,

where X is the trajectory matrix, U_i in R^L, V_i in R^K, σ_i are non-negative numbers. Also, we assume that ||U_i|| = 1, ||V_i|| = 1.

The Singular Value Decomposition is a particular case of (*) and corresponds to orthonormal systems of {U_i} and {V_i}. We call (σ_i, U_i, V_i) eigentriple, σ_i are singular values, U_i are left singular values or eigenvectors, V_i are right singular vectors or factor vectors, by analogy with the SVD.

For the most of SSA decompositions, U_i belongs to the column space of X, while V_i belongs to the row space of X. Therefore, let us consider such decompositions called consistent.

Note that (*) is a decomposition of X into a sum of rank-one matrices. If the systems {U_i} and {V_i} are linearly-independent, then the decomposition (*) is minimal (has minimal possible number of addends).

If at least one of the systems is not linear independent, the decomposition (*) is not minimal. If both {U_i} and {V_i} are orthonormal, then the decomposition (*) is called bi-orthogonal. If {U_i} is orthonormal, the decomposition is called left-orthogonal; If {V_i} is orthonormal, the decomposition is called right-orthogonal.

Let r be rank of X. Minimal decomposition has exactly r addends. Introduce the Frobenius-inner product as <Z, Y>_F = sum_{i, j} (z_{i, j} y_{i, j}). Thus, we can say about F-orthogonality and F-orthogonal decompositions if X_i are F-orthogonal. For F-orthogonality, left or right orthogonality is sufficient.

Generally, ||X||^2 can be not equal to sum_i ||X_i||^2. For F-orthogonal decompositions, ||X||^2 = sum_i ||X_i||^2.

The contribution of k-th matrix component is defined as ||X_k||^2 / ||X||^2 = sigma_k^2 / (sum_i sigma_i^2).

For F-orthogonal decompositions, the sum of component contributions is equal to 1. Otherwise, this sum can considerably differ from 1 (e.g., the sum of component contributions can be 90% or 146%).

Remark. If the system {U_i} (or {V_i}) has vectors that do not belong to the column (or row) spaces, then the decomposition can be not minimal even if {U_i} (or {V_i}) are linearly independent, since these projections on the column (or row) space can be dependent.

## Decompositions for different SSA modifications

Basic SSA

the SVD, consistent, minimal, bi-orthogonal and therefore F-orthogonal decomposition. Implemented in `ssa` with `kind='1d-ssa'`

FOSSA

consistent, minimal F-orthogonal decomposition. Implemented in `fossa`

IOSSA

consistent, minimal oblique decomposition. Implemented in `iossa`

SSA with projections

non-consistent if at least one basis vector used for the projection does not belong to the column (row) trajectory space, F-orthogonal decomposition. The components, which are obtained by projections, are located at the beginning of the decomposition and have numbers 1, …, n_special. Implemented in `ssa` with `kind='1d-ssa'` and non-`NULL` `row.projector` or `column.projector` arguments

Toeplitz SSA

generally, non-consistent, non-minimal F-orthogonal decomposition. Implemented in `ssa` with `kind='toeplitz-ssa'`

## Note

For `nsigma`, `nu`, `nv`, `\$` routines, the values returned solely depend on used singular value decomposition method and parameters of this method (e.g. 'neig' argument for 'propack' and 'nutrlan' SVD methods).

`Rssa` for an overview of the package, as well as, `ssa`, `calc.v`, `iossa`, `fossa`,

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17``` ```# Decompose 'co2' series with default parameters s <- ssa(co2, neig = 20) # Show the number of eigentriples saved in the 's' print(nsigma(s)) # Show the summary summary(s) # Show the set of singular values print(s\$sigma) # Show the first eigenvector print(s\$U[, 1]) # Decompose `co2' series with polynomial projections s <- ssa(co2, row.projector = 1, column.projector = 2) print(nspecial(s)) print(c(s\$nPL, s\$nPR)) # Reconstruct a polynomial trend plot(reconstruct(s, groups = list(trend = seq_len(nspecial(s))))) ```

### Example output

```Loading required package: svd

The following object is masked from 'package:stats':

decompose

[1] 20

Call:
ssa(x = co2, neig = 20)

Series length: 468,	Window length: 234,	SVD method: eigen
Special triples:  0

Computed:
Eigenvalues: 20,	Eigenvectors: 20,	Factor vectors: 0

Precached: 0 elementary series (0 MiB)

Overall memory consumption (estimate): 0.04228 MiB
[1] 78886.19075   329.03181   327.19839   184.65974    88.69527    88.19181
[7]    52.38050    40.52787    31.32993    29.40938    27.15770    22.33445
[13]    17.23793    14.17510    14.11140    12.97672    12.94377    12.21652
[19]    11.83064    11.61424
[1] -0.06300753 -0.06302338 -0.06303686 -0.06304999 -0.06306343 -0.06307730
[7] -0.06309236 -0.06310916 -0.06312838 -0.06314917 -0.06317087 -0.06319123
[13] -0.06320963 -0.06322595 -0.06323995 -0.06325341 -0.06326693 -0.06328087
[19] -0.06329626 -0.06331308 -0.06333319 -0.06335528 -0.06337822 -0.06339999
[25] -0.06341942 -0.06343660 -0.06345164 -0.06346611 -0.06348076 -0.06349547
[31] -0.06351169 -0.06352993 -0.06355037 -0.06357322 -0.06359616 -0.06361790
[37] -0.06363741 -0.06365439 -0.06366936 -0.06368357 -0.06369834 -0.06371384
[43] -0.06373062 -0.06374894 -0.06376996 -0.06379262 -0.06381645 -0.06383860
[49] -0.06385883 -0.06387629 -0.06389189 -0.06390675 -0.06392159 -0.06393679
[55] -0.06395335 -0.06397228 -0.06399328 -0.06401710 -0.06404180 -0.06406526
[61] -0.06408654 -0.06410547 -0.06412170 -0.06413748 -0.06415373 -0.06417102
[67] -0.06418916 -0.06420917 -0.06423122 -0.06425639 -0.06428174 -0.06430590
[73] -0.06432804 -0.06434777 -0.06436479 -0.06438168 -0.06439895 -0.06441726
[79] -0.06443643 -0.06445701 -0.06448069 -0.06450599 -0.06453221 -0.06455660
[85] -0.06457909 -0.06459900 -0.06461676 -0.06463360 -0.06465063 -0.06466848
[91] -0.06468721 -0.06470758 -0.06473036 -0.06475596 -0.06478256 -0.06480725
[97] -0.06482955 -0.06484907 -0.06486753 -0.06488495 -0.06490255 -0.06492074
[103] -0.06494060 -0.06496208 -0.06498566 -0.06501191 -0.06503879 -0.06506411
[109] -0.06508695 -0.06510808 -0.06512730 -0.06514584 -0.06516473 -0.06518415
[115] -0.06520498 -0.06522790 -0.06525287 -0.06528042 -0.06530858 -0.06533553
[121] -0.06536001 -0.06538193 -0.06540202 -0.06542127 -0.06544071 -0.06546066
[127] -0.06548236 -0.06550498 -0.06552990 -0.06555733 -0.06558545 -0.06561225
[133] -0.06563699 -0.06565905 -0.06567874 -0.06569782 -0.06571705 -0.06573738
[139] -0.06575900 -0.06578256 -0.06580803 -0.06583547 -0.06586375 -0.06589048
[145] -0.06591512 -0.06593726 -0.06595732 -0.06597716 -0.06599791 -0.06601893
[151] -0.06604067 -0.06606426 -0.06609059 -0.06611982 -0.06614953 -0.06617730
[157] -0.06620233 -0.06622490 -0.06624516 -0.06626537 -0.06628530 -0.06630602
[163] -0.06632836 -0.06635218 -0.06637830 -0.06640676 -0.06643537 -0.06646260
[169] -0.06648706 -0.06650899 -0.06652839 -0.06654743 -0.06656624 -0.06658533
[175] -0.06660585 -0.06662773 -0.06665189 -0.06667843 -0.06670593 -0.06673208
[181] -0.06675609 -0.06677777 -0.06679679 -0.06681542 -0.06683427 -0.06685403
[187] -0.06687579 -0.06689887 -0.06692428 -0.06695238 -0.06698088 -0.06700790
[193] -0.06703282 -0.06705530 -0.06707553 -0.06709540 -0.06711560 -0.06713652
[199] -0.06715852 -0.06718278 -0.06720903 -0.06723805 -0.06726755 -0.06729568
[205] -0.06732162 -0.06734466 -0.06736585 -0.06738600 -0.06740683 -0.06742838
[211] -0.06745152 -0.06747670 -0.06750423 -0.06753367 -0.06756398 -0.06759283
[217] -0.06761945 -0.06764322 -0.06766483 -0.06768552 -0.06770609 -0.06772747
[223] -0.06774995 -0.06777421 -0.06780067 -0.06782960 -0.06785926 -0.06788692
[229] -0.06791242 -0.06793534 -0.06795591 -0.06797598 -0.06799656 -0.06801852
[1] 3
[1] 2 1
```

Rssa documentation built on Oct. 4, 2017, 5:06 p.m.