stacf {starma} | R Documentation |
Space-time autocorrelation functions
Description
The functions defined below are the main tools to the identification and the diagnostic part of the three-stage iterative model procedure building.
stacf
and stpacf
respectively compute the autocorrelation and partial autocorrelation functions of a space-time series.
Usage
stacf(data, wlist, tlag.max=NULL, plot=TRUE, use.ggplot=TRUE)
stpacf(data, wlist, tlag.max=NULL, plot=TRUE, use.ggplot=TRUE)
Arguments
data |
a matrix or data frame containing the space-time series: row-wise should be the temporal observations, with each column corresponding to a site. |
wlist |
a list of the weight matrices for each k-th order neighbours, first one being the identity. |
tlag.max |
the maximum time lag for the space-time autocorrelation functions. If |
plot |
whether to plot the autocorrelation functions or not. |
use.ggplot |
if |
Details
stacf
and stpacf
respectively compute the space-time autocorrelation and partial autocorrelation functions of the serie data
between s
-th and 0
-th order neighbors at time lag t
,
for s
ranging from 0
to length(wlist)
and t
ranging from 1
to tlag.max
.
The autocorrelation function is computed as follows:
\hat{\rho}_{l}(s) = frac{\hat{\gamma}_{l0}(s)}{\left( \hat{\gamma}_{ll}(0) \hat{\gamma}_{00}(s) \right) ^{1/2} }
The partial autocorrelation functions are computed solving iteratively the Yule Walker equations for increasing time lags and space lags.
Note that the identification might be biased if the partial autocorrelation functions are not computed with enough space lags, since Yule Walker equations are sensible to the maximum space lag given.
Value
An object of class matrix
containing the estimated acf.
Row-wise are the different time lags, column-wise the different space lags.
Author(s)
Felix Cheysson
References
Pfeifer, P., & Deutsch, S. (1980). A Three-Stage Iterative Procedure for Space-Time Modeling. Technometrics, 22(1), 35-47. doi:10.1080/00401706.1980.10486099
Examples
data(nb_mat) # Get neighbourhood matrices
# Simulate a STARMA model
eps <- matrix(rnorm(94*200), 200, 94)
sim <- eps
for (t in 3:200) {
sim[t,] <- (.4*blist[[1]] + .25*blist[[2]]) %*% sim[t-1,] +
(.25*blist[[1]] ) %*% sim[t-2,] +
( - .3*blist[[2]]) %*% eps[t-1,] +
eps[t, ]
}
sim <- sim[101:200,]
sim <- stcenter(sim) # Center and scale the dataset
# Plot stacf and stpacf
stacf(sim, blist)
stpacf(sim, blist)