Learn R Programming

Rssa (version 0.11)

ssa-object: Properties of SSA object

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

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

Value

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

About decompositions

The result of Decomposition step of SSA and its modifications can be written down in the following form: $${(*)} \quad \mathbf{X} = \sum_i \mathbf{X}_i, \qquad \mathbf{X}_i = \sigma_i U_i V_i^\mathrm{T},$$ where $\mathbf{X}$ is the trajectory matrix, $U_i \in R^L$, $V_i \in R^K$, $\sigma_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 $(\sigma_i, U_i, V_i)$ eigentriple, $\sigma_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 $\mathbf{X}$, while $V_i$ belongs to the row space of $\mathbf{X}$. Therefore, let us consider such decompositions called consistent.

Note that $(*)$ is a decomposition of $\mathbf{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 $\mathbf{X}$. Minimal decomposition has exactly $r$ addends. Introduce the Frobenius-inner product as $\langle \mathbf{Z}, \mathbf{Y} \rangle _\mathrm{F} = \sum_{i, j} z_{i, j} \cdot y_{i, j}$. Thus, we can say about F-orthogonality and F-orthogonal decompositions if $\mathbf{X}_i$ are F-orthogonal. For F-orthogonality, left or right orthogonality is sufficient.

Generally, $\|\mathbf{X}\|^2$ can be not equal to $\sum_i \|\mathbf{X}_i\|^2$. For F-orthogonal decompositions, $\|\mathbf{X}\|^2 = \sum_i \|\mathbf{X}_i\|^2$.

The contribution of k-th matrix component is defined as ${\|\mathbf{X}_k\|^2} / {\|\mathbf{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.

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: [object Object],[object Object],[object Object]

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: [object Object],[object Object]

See Also

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

Examples

Run this code
# 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)))))

Run the code above in your browser using DataLab