Description Usage Arguments Details Value Author(s) References Examples
stcor.test
computes an extension of the Box-Pierce test statistic to accept or reject the
non correlation of the distinct observations of a given space-time series.
It is one of the main functions for the diagnostic part of the three-stage iterative model building procedure.
1 2 3 4 |
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 |
the maximum time lag for the space-time autocorrelation functions. If |
slag |
the maximum space lag for the space-time autocorrelation functions. If |
fitdf |
number of degrees of freedom to be subtracted if |
x |
a |
... |
unused |
Since (Pfeifer and Deutsch, 1981) gives:
Var(rho[l](s)) ~ 1 / N(T-s)
We can extend Box-Pierce test statistic to space-time series:
N ∑[(T-s)*rho[l](s)^2] ~ chisq(slag*tlag)
stcor.test
can be applied to a space-time series to test the null hypothesis of non correlation.
It is useful to check if the residuals of a STARMA models are multivariate white noise.
In this case, fitdf
should be set equal to the number of parameters in the model.
Please note that this is an empirical extension and it has not yet been the subject of a paper. The specifications of the weight matrices has not been studied either and could lead to inconsistencies.
A data.frame
containing the following elements:
X_squared |
The value of the chi squared statistic |
df |
The degrees of freedom of the statistic (taking |
p.value |
The p-value of the test |
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
- 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 | data(nb_mat)
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
# Test for multivariate normality
stcor.test(sim, blist) # Data is correlated
stcor.test(eps, blist) # Data should not be correlated (unless you're 5% unlucky)
|
Multivariate Box-Pierce Non Correlation Test
--------------------------------------------
X.squared df p.value
1 10505.41 100 0
Decision: Non Correlation Hypothesis should be rejected.
Multivariate Box-Pierce Non Correlation Test
--------------------------------------------
X.squared df p.value
1 132.8467 115 0.1221484
Decision: Can't reject Non Correlation Hypothesis.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.