Description Usage Arguments Details Value Author(s) References Examples
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.
1 2 |
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 |
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:
rho[l](s) = gamma[l0](s) / sqrt( (gamma[ll](0) * gamma[00](0)) )
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.
An object of class matrix
containing the estimated acf.
Row-wise are the different time lags, column-wise the different space lags.
Felix Cheysson
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.