filtering {tsdecomp} | R Documentation |
Double-Sided Symmetric Linear Filter
Description
Double-sided symmetric linear filter.
Usage
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 |
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 |
extend |
integer; if greater than zero, the series is extended by means of forecasts
and backcasts based on the fitted model |
drift |
logical, if |
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, \hat{s}_t
, is obtained by means of a
double-sided symmetrical filter where the weights, w
, are the
theoretical autocovariances of the model above:
%
\hat{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.