Last chance! 50% off unlimited learning
Sale ends in
stacf
and stpacf
respectively compute the autocorrelation and partial autocorrelation functions of a space-time series.
stacf(data, wlist, tlag.max=NULL, plot=TRUE, use.ggplot=TRUE)
stpacf(data, wlist, tlag.max=NULL, plot=TRUE, use.ggplot=TRUE)
tlag.max = NULL
, it will use a large enough number of time lags. plot = TRUE
, whether to use ggplot2
or not to display the autocorrelation functions. Not using ggplot2
is depreciated. matrix
containing the estimated acf.
Row-wise are the different time lags, column-wise the different space lags.
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:
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.
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)
Run the code above in your browser using DataLab