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.
nsigma(x)
nu(x)
nv(x)
# S3 method for ssa
nspecial(x)
# S3 method for ssa
summary(object, digits = max(3, getOption("digits") - 3), …)
# S3 method for ssa
$(x, name)
SSA object to query
an object for which a summary is desired
integer, used for number formatting
additional arguments affecting the summary produced
field of SSA object to extract. See 'Details' for list of the fields
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: $$% {(*)} \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.
the SVD, consistent, minimal, bi-orthogonal and
therefore F-orthogonal decomposition. Implemented in
ssa
with kind='1d-ssa'
consistent, minimal F-orthogonal
decomposition. Implemented in fossa
consistent, minimal oblique decomposition. Implemented
in iossa
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, \dots,
n_\mathrm{special}\). Implemented in ssa
with
kind='1d-ssa'
and non-NULL
row.projector
or
column.projector
arguments
generally, non-consistent, non-minimal
F-orthogonal decomposition. Implemented in
ssa
with kind='toeplitz-ssa'
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:
Vector of singular values
The matrix of eigenvectors
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:
the number of row projection triples, may be NULL
the number of column projection triples, may be NULL
Rssa
for an overview of the package, as well as,
ssa
,
calc.v
,
iossa
,
fossa
,
# NOT RUN {
# 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