ARIMAdec: ARIMA-Model-Based Decomposition of Time Series

Description Usage Arguments Details Value References See Also Examples

View source: R/ARIMAdec.R

Description

This is the main function for the ARIMA-model-based decomposition of a time series.

Usage

1
2
3
4
5
6
ARIMAdec(x, mod, width = c(0.035, 0.035), min.modulus = 0.4, 
  extend = 16, drift = FALSE, optim.tol = 1e-04, ...)
## S3 method for class 'ARIMAdec'
print(x, units = c("radians", "degrees", "pi"), digits = 4, ...)
## S3 method for class 'ARIMAdec'
plot(x, ...)

Arguments

x

for ARIMAdec, a univariate time series; for plot.ARIMAdec and print.ARIMAdec, an object of class ARIMAdec returned by ARIMAdec.

mod

an object of class Arima. See arima.

width

numeric of length two, width of the interval of frequencies allocated to the trend and the seasonal components (measured in radians). If a numeric of length one is passed as argument, the same width is used for both components. See roots.allocation.

min.modulus

numeric, minimum modulus of the roots assigned to the trend component. See roots.allocation.

extend

integer; if greater than zero, the series is extended by means of forecasts and backcasts based on the fitted model mod. See filtering.

drift

logical, if TRUE the intercept in the fitted model mod or an external regressor named "drift" is treated as a deterministic linear trend. See filtering.

optim.tol

numeric, the convergence tolerance to be used by optimize.

units

character, the units in which the argument of the roots are printed. units="pi" prints the argument in radians as multiples of pi.

digits

numeric, the number of significant digits to be used by print.

...

further arguments to be passed to poly2acgf or to plot.tsdecFilter and print methods.

Details

This function is a wrapper to the sequence of calls to roots.allocation, pseudo.spectrum, canonical.decomposition and filtering.

Value

An object of class ARIMAdec containing the following: 1) ar: the output from {roots.allocation}, 2) spectrum: the output from {pseudo.spectrum}, 3) ma: the output from {canonical.decomposition}, 4) xextended: the series extended with backcasts and forecasts (if extend > 0), 5) filters: the filters returned by {filtering}, 6) components: the estimated components returned by {filtering}.

References

Burman, J. P. (1980) ‘Seasonal Adjustment by Signal Extraction’. Journal of the Royal Statistical Society. Series A (General), 143(3), pp. 321-337. doi: 10.2307/2982132

Hillmer, S. C. and Tiao, G. C. (1982) ‘An ARIMA-Model-Based Approach to Seasonal Adjustment’. Journal of the American Statistical Association, 77(377), pp. 63-70. doi: 10.1080/01621459.1982.10477767

See Also

canonical.decomposition, filtering, pseudo.spectrum, roots.allocation.

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
# Airlines model and monthly data
y <- log(AirPassengers)
fit <- arima(y, order=c(0,1,1), seasonal=list(order=c(0,1,1)))
dec <- ARIMAdec(y, fit, extend=72)
dec
plot(dec)

# JohnsonJohnson quarterly data
y <- log(JohnsonJohnson)
fit <- arima(y, order=c(0,1,1), seasonal=list(order=c(0,1,1)))
dec <- ARIMAdec(y, fit, extend=16)
dec
plot(dec)

# Nile annual data
# this series is better modelled as a level shift at 
# observation 29 and a mean (no ARMA structure),
# here the shift is ignored for illustration of the 
# decomposition of the fitted ARIMA(0,1,1) model
y <- Nile
fit <- arima(y, order=c(0,1,1))
dec <- ARIMAdec(y, fit, extend=72)
dec
plot(dec, overlap.trend=TRUE, args.trend=list(col="blue"))

Example output

Roots of AR polynomial
----------------------
(1 - L)(1 - L^12) = (1 - 2L + L^2)(1 + L + L^2 + L^3 + L^4 + L^5 + L^6 + L^7 + L^8 + L^9 + L^10 + L^11) 

   Component          Root Modulus Argument Period Cycles.per.Year
1      trend  1.000+0.000i       1   0.0000    Inf               0
2      trend  1.000+0.000i       1   0.0000    Inf               0
3   seasonal  0.866+0.500i       1   0.5236 12.000               1
4   seasonal  0.500+0.866i       1   1.0472  6.000               2
5   seasonal  0.000+1.000i       1   1.5708  4.000               3
6   seasonal -0.500+0.866i       1   2.0944  3.000               4
7   seasonal -0.866+0.500i       1   2.6180  2.400               5
8   seasonal -1.000+0.000i       1   3.1416  2.000               6
9   seasonal -0.866-0.500i       1   3.6652  1.714               7
10  seasonal -0.500-0.866i       1   4.1888  1.500               8
11  seasonal  0.000-1.000i       1   4.7124  1.333               9
12  seasonal  0.500-0.866i       1   5.2360  1.200              10
13  seasonal  0.866-0.500i       1   5.7596  1.091              11

MA polynomials
--------------

  Trend:
  (1 + 0.048L - 0.952L^2)a_t,  a_t ~ IID(0, 0.054)
  Seasonal:
  (1 + 1.431L + 1.585L^2 + 1.486L^3 + 1.264L^4 + 1.022L^5 + 0.753L^6 + 0.449L^7 + 0.197L^8 + 0.039L^9 - 0.161L^10 - 0.497L^11)c_t,  c_t ~ IID(0, 0.0485)

Variances
---------

    trend  seasonal irregular 
  0.05401   0.04848   0.29932 

Roots
-----

   Component            Root Modulus Argument Period
1      trend  0.9525+0.0000i  0.9525   0.0000    Inf
2      trend -1.0000+0.0000i  1.0000   3.1416  2.000
3   seasonal  0.6749-0.0000i  0.6749   0.0000    Inf
4   seasonal  0.6377+0.6485i  0.9095   0.7938  7.915
5   seasonal  0.2420+0.9175i  0.9489   1.3129  4.786
6   seasonal -0.2605+0.9655i  1.0000   1.8343  3.425
7   seasonal -0.7319+0.6814i  1.0000   2.3919  2.627
8   seasonal -0.9758+0.2185i  1.0000   2.9213  2.151
9   seasonal -0.9545-0.2983i  1.0000   3.4445  1.824
10  seasonal -0.6825-0.7309i  1.0000   3.9612  1.586
11  seasonal -0.2605-0.9655i  1.0000   4.4489  1.412
12  seasonal  0.2420-0.9175i  0.9489   4.9703  1.264
13  seasonal  0.6377-0.6485i  0.9095   5.4894  1.145
Roots of AR polynomial
----------------------
(1 - L)(1 - L^4) = (1 - 2L + L^2)(1 + L + L^2 + L^3) 

  Component  Root Modulus Argument Period Cycles.per.Year
1     trend  1+0i       1    0.000    Inf               0
2     trend  1+0i       1    0.000    Inf               0
3  seasonal  0+1i       1    1.571  4.000               1
4  seasonal -1+0i       1    3.142  2.000               2
5  seasonal  0-1i       1    4.712  1.333               3

MA polynomials
--------------

  Trend:
  (1 + 0.205L - 0.795L^2)a_t,  a_t ~ IID(0, 0.0178)
  Seasonal:
  (1 - 0.153L - 0.48L^2 - 0.367L^3)c_t,  c_t ~ IID(0, 0.0768)

Variances
---------

    trend  seasonal irregular 
  0.01777   0.07683   0.25647 

Roots
-----

  Component            Root Modulus Argument Period
1     trend  0.7949-0.0000i  0.7949    0.000    Inf
2     trend -1.0000+0.0000i  1.0000    3.142  2.000
3  seasonal  1.0000+0.0000i  1.0000    0.000    Inf
4  seasonal -0.4235+0.4327i  0.6055    2.345  2.679
5  seasonal -0.4235-0.4327i  0.6055    3.938  1.596
Roots of AR polynomial
----------------------
(1 - L) = (1 - L) 

  Component Root Modulus Argument Period Cycles.per.Year
1     trend    1       1        0    Inf               0

MA polynomials
--------------

  Trend:
  (1 + L)a_t,  a_t ~ IID(0, 0.0178)

Variances
---------

    trend irregular 
  0.01783   0.75077 

Roots
-----

  Component  Root Modulus Argument Period
1     trend -1+0i       1    3.142      2

tsdecomp documentation built on May 1, 2019, 9:15 p.m.