Description Usage Arguments Details Value Author(s) References Examples
stplot
renders a nice 2d plot for autocorrelation functions.
1 |
acf |
a matrix containing the autocorrelation functions of a given space-time series: row-wise should be the temporal observations, with each column corresponding to a space lag. |
ci |
confidence intervals for the autocorrelation functions. |
call |
the name of the plot. |
ggplot |
a boolean indicating whether to use ggplot2 functions (they are recommended). |
This function plots the calculated autocorrelation functions of a space-time series.
In practice, the user should not use this function, as it is being called automatically when using stacf
or stpacf
.
The confidence intervals for the autocorrelation functions are approximated by
var(rho[lk]) = 1 / (N*(T-k))
where N is the number of sites, and T the number of temporal observations.
NULL
Felix Cheysson
- Pfeifer, P., & Deutsch, S. (1981). Variance of the Sample Space-Time Autocorrelation Function. Journal of the Royal Statistical Society. Series B (Methodological), 43(1): 28-33.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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*diag(94) + .25*blist[[2]]) %*% sim[t-1,] +
(.25*diag(94) ) %*% sim[t-2,] +
( - .3*blist[[2]]) %*% eps[t-1,] +
eps[t, ]
}
sim <- sim[101:200,]
sim <- stcenter(sim) # Center and scale the dataset
# Autocorrelation functions
sim.stacf <- stacf(sim, blist, plot=FALSE)
# Plot the autocorrelation function
stplot(sim.stacf, 2 / sqrt(nrow(sim) * ncol(sim)), "stacf(sim, blist)")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.