starma-package: Space Time AutoRegressive Moving Average (STARMA) modelling...

Description Details Author(s) References Examples

Description

This package aims to provide all the tools needed to identify, estimate and diagnose STARMA models for space-time series. It follows the three-stage iterative model building procedure developed by (Box and Jenkins, 1970) and extended to space-time modelling by (Pfeifer and Deutsch, 1980). Designed with large datasets in mind, the package has been optimized by integrating C++ code via Rcpp and RcppArmadillo (Eddelbuettel and Sanderson, 2014). Furthermore, the parameter estimation, which is usually computationally very expensive when using common optimization routines, uses a Kalman filter (see Cipra and Motykova, 1987), making it extremely efficient when dealing with large datasets.

Details

Package: starma
Type: Package
Version: 1.2
Date: 2015-11-12
License: GPL-2

The three stages of the iterative model building procedure are as follow, after centering the space-time series with stcenter:

- Identification: Using stacf and stpacf, the user should try to identify which parameters should be estimated.

- Estimation: Use starma to estimate the parameters.

- Diagnostic: Use stacf, stpacf and stcor.test to check whether the residuals of the models are similar to white noise.

Refer to (Box and Jenkins, 1970) for details over the three-stage iterative model building procedure.

Author(s)

Felix Cheysson

Maintainer: Felix Cheysson <felix@cheysson.fr>

References

- Box, G. E. P., & Jenkins, G. M. (1970). Time Series Analysis: Forecasting and Control. Holden Day.

- 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.

- Cipra, T., & Motykova, I. (1987). Study on Kalman filter in time series analysis. Commentationes Mathematicae Universitatis Carolinae, 28(3).

- Dirk Eddelbuettel, Conrad Sanderson (2014). RcppArmadillo: Accelerating R with high-performance C++ linear algebra. Computational Statistics and Data Analysis, Volume 71, March 2014, pages 1054-1063. URL http://dx.doi.org/10.1016/j.csda.2013.02.005

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Load spdep library to easily create weight matrices
library(spdep)

# Create a 5x5 regular grid which will be our lattice
sites <- matrix(0, 25, 2)
for (i in 1:5) {
	for (j in 1:5)
		sites[(i-1)*5 + j, ] <- c(i, j) - .5
}
plot(sites)

# Create a uniform first order neighbourhood
knb <- dnearneigh(sites, 0, 1)
plot(knb, sites)

# Lag the neighbourhood to create other order matrices
knb <- nblag(knb, 4)
klist <- list(order0=diag(25),
           order1=nb2mat(knb[[1]]),
           order2=nb2mat(knb[[2]]),
           order3=nb2mat(knb[[3]]),
           order4=nb2mat(knb[[4]]))
		   
# Simulate a STARMA(2;1) process
eps <- matrix(rnorm(200*25), 200, 25)
star <- eps
for (t in 3:200) {
	star[t,] <- (.4*klist[[1]] + .25*klist[[2]]) %*% star[t-1,] +
		(.25*klist[[1]]                ) %*% star[t-2,] +
		(            - .3*klist[[2]]) %*% eps[t-1,] +
		eps[t, ]
}

star <- star[101:200,]	# Remove first observations
star <- stcenter(star)	# Center and scale the dataset
										   
# Identify the process
stacf(star, klist)
stpacf(star, klist)

# Estimate the process
ar <- matrix(c(1, 1, 1, 0), 2, 2)
ma <- matrix(c(0, 1), 1, 2)
model <- starma(star, klist, ar, ma)
model
summary(model)

# Diagnose the process
stcor.test(model$residuals, klist, fitdf=4)
stacf(model$residuals, klist)
stpacf(model$residuals, klist)

Example output

Loading required package: sp
Loading required package: Matrix
Call:
starma.default(data = star, wlist = klist, ar = ar, ma = ma)
---------------------------------------------------------------

AR parameters:
        slag 0 slag 1
tlag 1 0.39290 0.2083
tlag 2 0.27154     NA

Standard deviation:
         slag 0 slag 1
tlag 1 0.019516 0.0436
tlag 2 0.019452     NA
---------------------------------------------------------------

MA parameters:
       slag 0  slag 1
tlag 1     NA -0.2292

Standard deviation:
       slag 0 slag 1
tlag 1     NA 0.0558
---------------------------------------------------------------

sigma2 estimated as 0.6315699:  log likelihood = -2971.68  bic = 5974.657
Call:
starma.default(data = star, wlist = klist, ar = ar, ma = ma)

         Estimate Std..Error t.value   p.value    
phi10    0.392898   0.019516 20.1323 < 2.2e-16 ***
phi11    0.208329   0.043599  4.7783 1.870e-06 ***
phi20    0.271538   0.019452 13.9597 < 2.2e-16 ***
theta11 -0.229221   0.055762 -4.1107 4.072e-05 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
	Multivariate Box-Pierce Non Correlation Test
	--------------------------------------------

  X.squared df   p.value
1   97.8638 96 0.4279065

Decision: Can't reject Non Correlation Hypothesis.

starma documentation built on May 2, 2019, 1:26 p.m.