Learn R Programming

tsdecomp (version 0.2)

compare.acf: Compare ACF of Theoretical, Estimator and Empirical Component

Description

Compute the AutoCorrelation functions of the following elements: the theoretical ARMA model of each component, the estimator for each component, the filtered or estimated components.

Usage

compare.acf(x, mod, lag.max = 12, ...) "plot"(x, component = c("trend", "transitory", "seasonal"), ci = 0.95, ci.type = c("ma", "white"), ci.class = c("estimator", "theoretical", "empirical"), plot = TRUE, ...)

Arguments

x
for compare.acf, an object of class ARIMAdec; for plot.tsdecAcf, an object of class tsdecAcf returned by compare.acf.
mod
the object of class Arima decomposed in x. See arima.
lag.max
maximum lag at which to calculate the autocorrelations.
component
a character, the label of the component for which the ACF is to be obtained.
ci
coverage probability for confidence interval. If this is zero or negative, confidence intervals are not computed
ci.type
a character, the type of confidence interval. See details.
ci.class
a character, the element that is taken as reference to computed the confidence intervals. Ignored if ci.class='white'.
plot
logical, if TRUE the ACF is plotted.
...
further arguments to be passed to acf and plot.

Value

compare.acf returns the ACF of the components, respectively for their theoretical ARMA model, estimator and estimates.plot.tsdecAcf displays a plot and returns a invisible copy of a matrix containing the confidence intervals.

Details

The ACF is obtained upon the stationary transformation of the models for the components and the estimators; i.e., non-stationary roots (if any) are removed from the AR polynomials. The estimated components are also transformed according to the polynomials x$ar$polys.nonstationary that render the signals stationary.

Argument ci.type behaves similarly to the same argument in plot.acf. If ci.type = "white", the confidence bands are fixed to $t_{alpha/2}/sqrt(n)$, where $n$ is the number of observations in the fitted model model. If ci.type = "ma", confidence bands are obtained upon Bartlett's approximations for the standard deviations of the autocorrelations.

See Also

ARIMAdec.

Examples

Run this code
# 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)
cacf <- compare.acf(x = dec, mod=fit, lag.max=24)
plot(cacf, component="seasonal")
# unexpected discrepancy between the ACF of the estimator and the 
# ACF of the empirical signal
plot(cacf, component="trend")

# Nile time series
y <- Nile
fit <- arima(y, order=c(0,1,1))
dec <- ARIMAdec(y, fit, extend=16)
cacf <- compare.acf(x = dec, mod=fit, lag.max=24)
plot(cacf, component="trend")

Run the code above in your browser using DataLab