hmatr {Rssa} | R Documentation |
Calculate the heterogeneity matrix.
Description
Function calculates the heterogeneity matrix for the one-dimensional series.
Usage
hmatr(F, ...,
B = N %/% 4, T = N %/% 4, L = B %/% 2,
neig = 10)
## S3 method for class 'hmatr'
plot(x,
col = rev(heat.colors(256)),
main = "Heterogeneity Matrix", xlab = "", ylab = "", ...)
Arguments
F |
the series to be checked for structural changes |
... |
further arguments passed to |
B |
integer, length of base series |
T |
integer, length of tested series |
L |
integer, window length for the decomposition of the base series |
neig |
integer, number of eigentriples to consider for calculating projections |
x |
'hmatr' object |
col |
color palette to use |
main |
plot title |
xlab , ylab |
labels for 'x' and 'y' axis |
Details
The heterogeneity matrix (H-matrix) provides a
consistent view on the structural discrepancy between different parts of the
series. Denote by the subseries of F of the form:
. Fix two integers
and
. Let
these integers denote the lengths of base and test subseries,
respectively. Introduce the H-matrix
with the elements
as
follows:
for and
, that is we split the series
F into subseries of lengths B and T and calculate the heterogeneity index
between all possible pairs of the subseries.
The heterogeneity index between the series
and
can be calculated as follows: let
,
denote the eigenvectors of the
SVD of the trajectory matrix of the series
. Fix I to be a
subset of
and denote
. Denote by
(
) the
L-lagged vectors of the series
. Now define
where
denotes the Euclidean distance between the
vector X and the subspace
. One can easily see that
.
Value
object of type 'hmatr'
References
Golyandina, N., Nekrutkin, V. and Zhigljavsky, A. (2001): Analysis of Time Series Structure: SSA and related techniques. Chapman and Hall/CRC. ISBN 1584881941
See Also
Examples
# Calculate H-matrix for co2 series
h <- hmatr(co2, L = 24)
# Plot the matrix
plot(h)