powered by
stcov
data
slag1
slag2
tlag
stcov(data, wlist, slag1, slag2, tlag)
stacf
stpacf
length(wlist)
It is computed as follows: $$\hat{\gamma}_{lk}(s) = \frac{1}{N(T-s)} Tr \left( \sum_{t=s+1}^{T} W^{(k)\prime} W^{(l)} z_t z_{t-k}^\prime \right)$$
data(nb_mat) # Get neighbourhood matrices data <- matrix(rnorm(9400), 100, 94) # Compute covariance between 2-nd and 1-st order neighbours, at time lag 5 stcov(data, blist, 2, 1, 5)
Run the code above in your browser using DataLab