arrep: Compute the Autoregressive Representation of a SARIMA Model

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Invert (invertible) SARIMA(p, d, q, P, D, Q) models to ar representation.

Usage

1
2
arrep(notation = "arima", phi = c(rep(0, 10)), d = 0, theta = c(rep(0, 10)),
 Phi = c(rep(0, 10)), D = 0, Theta = c(rep(0, 10)), frequency = 1)

Arguments

notation

"arima" for notation of the type used by the function arima(stats), "dse1" for type notation used by the package dse1.

phi

p vector of autoregressive coefficient.

d

difference operator, implemented: d element of (0,1,2).

theta

q vector of moving average coefficients.

Phi

P vector of seasonal autoregressive coefficients.

D

Seasonal difference operator, implemented: D element of (0,1,2).

Theta

Q vector of seasonal moving average coefficients.

frequency

The frequency of the seasonality (e.g. frequency = 12 for monthly series with annual periodicity).

Details

For input, positive values of phi, theta, Phi and Theta indicate positive dependence. Implemented for p,q,P,Q element of c(0,1,2,3,4,5,6,7,8,9,10). The ar representation is truncated at coefficients less than 1.0e-10. Values of theta, Theta near non invertibility (-1 or 1) will not be practical and will cause near infinite lags, especially for Theta and large frequency.

Value

A vector containing a truncated autoregressive representation of a SARIMA model. This can be used as input for the function gar.sim.

Author(s)

Olivier Briet o.briet@gmail.com

References

Briet OJT, Amerasinghe PH, Vounatsou P: Generalized seasonal autoregressive integrated moving average models for count data with application to malaria time series with low case numbers. PLoS ONE, 2013, 8(6): e65761. doi:10.1371/journal.pone.0065761 https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0065761 If you use the gsarima package, please cite the above reference.

See Also

'garsim'.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
phi<-c(0.5, 0.3, 0.1)
theta<-c(0.6, 0.2, 0.2)
ar<-arrep(phi=phi, theta=theta, frequency=12)
check<-(acf2AR(ARMAacf(ar=phi, ma=theta, lag.max = 100, pacf = FALSE))[100,1:length(ar)])
as.data.frame(cbind(ar,check))

phi<-c(0.2,0.5)
theta<-c(0.4)
Phi<-c(0.6)
Theta<-c(0.3)
d<-2
D<-1
frequency<-12
ar<-arrep(phi=phi, theta=theta, Phi=Phi, Theta=Theta, frequency= frequency, d=d, D=D)
N<-500
intercept<-10
data.sim <- garsim(n=(N+length(ar)),phi=ar, X=matrix(rep(intercept,(N+ length(ar)))),
beta=1, sd=1) 
y<-data.sim[1+length(ar): (N+length(ar))]
tsy<-ts(y, freq= frequency)
plot(tsy)
arima(tsy, order=c(2,2,1), seasonal=list(order=c(1,1,1)))

Example output

              ar         check
1   1.100000e+00  1.100000e+00
2  -1.600000e-01 -1.600000e-01
3   1.760000e-01  1.760000e-01
4  -2.936000e-01 -2.936000e-01
5   1.729600e-01  1.729600e-01
6  -8.025600e-02 -8.025600e-02
7   7.228160e-02  7.228160e-02
8  -6.190976e-02 -6.190976e-02
9   3.874074e-02  3.874074e-02
10 -2.531881e-02 -2.531881e-02
11  1.982509e-02  1.982509e-02
12 -1.457944e-02 -1.457944e-02
13  9.846408e-03  9.846408e-03
14 -6.956975e-03 -6.956975e-03
15  5.120791e-03  5.120791e-03
16 -3.650361e-03 -3.650361e-03
17  2.557453e-03  2.557453e-03
18 -1.828558e-03 -1.828558e-03
19  1.315716e-03  1.315716e-03
20 -9.352089e-04 -9.352089e-04
21  6.636937e-04  6.636937e-04
22 -4.743177e-04 -4.743177e-04
23  3.388937e-04  3.388937e-04
24 -2.412114e-04 -2.412114e-04
25  1.718116e-04  1.718116e-04
26 -1.226234e-04 -1.226234e-04
27  8.745402e-05  8.745402e-05
28 -6.231005e-05 -6.231005e-05
29  4.441992e-05  4.441992e-05
30 -3.168074e-05 -3.168074e-05
31  2.258647e-05  2.258647e-05
32 -1.609972e-05 -1.609972e-05
33  1.147868e-05  1.147868e-05
34 -8.184562e-06 -8.184562e-06
35  5.834944e-06  5.834944e-06
36 -4.159791e-06 -4.159791e-06
37  2.965798e-06  2.965798e-06
38 -2.114509e-06 -2.114509e-06
39  1.507504e-06  1.507504e-06
40 -1.074760e-06 -1.074760e-06
41  7.662572e-07  7.662572e-07
42 -5.463031e-07 -5.463031e-07
43  3.894825e-07  3.894825e-07
44 -2.776803e-07 -2.776803e-07
45  1.979723e-07  1.979723e-07
46 -1.411438e-07 -1.411438e-07
47  1.006279e-07  1.006279e-07
48 -7.174243e-08 -7.174243e-08
49  5.114865e-08  5.114864e-08
50 -3.646628e-08 -3.646628e-08
51  2.599853e-08  2.599852e-08
52 -1.853559e-08 -1.853559e-08
53  1.321490e-08  1.321490e-08
54 -9.421530e-09 -9.421529e-09
55  6.717055e-09  6.717054e-09
56 -4.788908e-09 -4.788907e-09
57  3.414240e-09  3.414239e-09
58 -2.434173e-09 -2.434173e-09
59  1.735438e-09  1.735437e-09
60 -1.237276e-09 -1.237276e-09
61  8.821126e-10  8.821126e-10
62 -6.288999e-10 -6.289002e-10
63  4.483726e-10  4.483726e-10
64 -3.196661e-10 -3.196659e-10
65  2.279051e-10  2.279049e-10
66 -1.624844e-10 -1.624841e-10
67  1.158428e-10  1.158426e-10

Call:
arima(x = tsy, order = c(2, 2, 1), seasonal = list(order = c(1, 1, 1)))

Coefficients:
         ar1     ar2     ma1    sar1    sma1
      0.0246  0.6054  0.5072  0.6641  0.3021
s.e.  0.0957  0.0607  0.1156  0.0460  0.0606

sigma^2 estimated as 1.086:  log likelihood = -719.44,  aic = 1450.87

gsarima documentation built on Sept. 4, 2020, 1:08 a.m.