hmatr function

Calculate the heterogeneity matrix.

Calculate the heterogeneity matrix.

Function calculates the heterogeneity matrix for the one-dimensional series.

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 ssa routine for hmatr call or image for plot.hmatr call
  • 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 Fi,jF_{i,j} the subseries of F of the form: c("Fi,j=\nF_{i,j} =\n", "left(fi,dots,fjright) \\left(f_{i},\\dots,f_{j}\\right)"). Fix two integers B>LB > L and TLT \geq L. Let these integers denote the lengths of base and test subseries, respectively. Introduce the H-matrix GB,TG_{B,T} with the elements gijg_{ij} as follows:

gij=g(Fi,i+B,Fj,j+T), g_{ij} = g(F_{i,i+B}, F_{j,j+T}),

for i=1,,NB+1i=1,\dots,N-B+1 and j=1,,NT+1j=1,\dots,N-T+1, 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 g(F(1),F(2))g(F^{(1)}, F^{(2)}) between the series F(1)F^{(1)} and F(2)F^{(2)} can be calculated as follows: let Uj(1)U_{j}^{(1)}, j=1,,Lj=1,\dots,L denote the eigenvectors of the SVD of the trajectory matrix of the series F(1)F^{(1)}. Fix I to be a subset of {1,,L}\left\{1,\dots,L\right\} and denote c("mathcalL(1)=\n\\mathcal{L}^{(1)} =\n", "mathrmspan,left(Ui,,iinIright) \\mathrm{span}\\,\\left(U_{i},\\, i \\in I\\right)"). Denote by X1(2),,XK2(2)X^{(2)}_{1},\dots,X^{(2)}_{K_{2}} (K2=N2L+1K_{2} = N_{2} - L + 1) the L-lagged vectors of the series F(2)F^{(2)}. Now define

g(F(1),F(2))=j=1K2dist2(Xj(2),L(1))j=1K2Xj(2)2, g(F^{(1)},F^{(2)})= \frac{\sum_{j=1}^{K_{2}}{\mathrm{dist}^{2}\left(X^{(2)}_{j},\mathcal{L}^{(1)}\right)}}{\sum_{j=1}^{K_{2}}{\left\|X^{(2)}_{j}\right\|^{2}}},

where dist(X,L)\mathrm{dist}\,(X,\mathcal{L}) denotes the Euclidean distance between the vector X and the subspace L\mathcal{L}. One can easily see that 0g10 \leq g \leq 1.

Returns

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

ssa

Examples

# Calculate H-matrix for co2 series h <- hmatr(co2, L = 24) # Plot the matrix plot(h)
  • Maintainer: Anton Korobeynikov
  • License: GPL (>= 2)
  • Last published: 2024-09-05