filtering: Double-Sided Symmetric Linear Filter

Description Usage Arguments Details Value See Also

View source: R/filtering.R

Description

Double-sided symmetric linear filter.

Usage

1
2
3
4
5
6
7
filtering(x, mod, 
  trend = list(ar=1, ma=1, sigma2=NULL), 
  transitory = list(ar=1, ma=1, sigma2=NULL), 
  seasonal = list(ar=1, ma=1, sigma2=NULL),
  irregular.sigma2 = NULL,
  extend = 16, drift = FALSE)
dsfilter(x, w, mod, extend = 16)

Arguments

x

a univariate time series.

mod

an object of class Arima. See arima.

trend

a list containing the coefficients and variance of the ARIMA model related to the trend component.

transitory

a list containing the coefficients and variance of the ARIMA model related to the transitory component.

seasonal

a list containing the coefficients and variance of the ARIMA model related to the seasonal component.

irregular.sigma2

numeric, variance of the irregular component. If NULL, the estimate of the irregular component is not computed.

extend

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

drift

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

w

a vector of filter coefficients (one side).

Details

These functions perform the convolution of the time series and the double-sided symmetric filter. They perform:

stats::filter(c(rep(0, n-1), x, rep(0, n-1)),

+ filter=c(rev(w[-1]), w), method="convolution", sides=1)

where n is length(x).

The design of the filter in the ARIMA-model-based decomposition procedure relies on the following result. The minimum mean squared error estimator of the component is given by the ACGF of the model:

theta(L)x[t] = phi_n(L)theta_s(L)a[t],

where theta(L) is the MA of the model fitted to the observed data, theta_s(L) is the MA of the component (signal) to be estimated and phi_n(L) is the product of the AR polynomials of the remaining components. The estimate of the signal, s[t], is obtained by means of a double-sided symmetrical filter where the weights, w, are the theoretical autocovariances of the model above:

s[t] = sum_[i=-infty]^infty w[i] x[t-i].

Value

filtering returns a list of class tsdecFilter containing the series extended with forecasts (if extend > 0) (based on the ARMA model given as input), the weights of one side of the filter for each component and the corresponding estimate of the components.

dsfilter returns the filtered time series.

See Also

ARIMAdec, filter.


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