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 = "", ...)
ssa
routine for
hmatr
call or image
for plot.hmatr
callThe heterogeneity index $g(F^{(1)}, F^{(2)})$ between the series $F^{(1)}$ and $F^{(2)}$ can be calculated as follows: let $U_{j}^{(1)}$, $j=1,\dots,L$ denote the eigenvectors of the SVD of the trajectory matrix of the series $F^{(1)}$. Fix I to be a subset of $\left{1,\dots,L\right}$ and denote $\mathcal{L}^{(1)} = \mathrm{span}\,\left(U_{i},\, i \in I\right)$. Denote by $X^{(2)}_{1},\dots,X^{(2)}_{K_{2}}$ ($K_{2} = N_{2} - L + 1$) the L-lagged vectors of the series $F^{(2)}$. Now define $$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 $\mathrm{dist}\,(X,\mathcal{L})$ denotes the Euclidean distance between the vector X and the subspace $\mathcal{L}$. One can easily see that $0 \leq g \leq 1$.
ssa
# Calculate H-matrix for co2 series
h <- hmatr(co2, L = 24)
# Plot the matrix
plot(h)
Run the code above in your browser using DataLab