Description Usage Arguments Details Value See Also
Double-sided symmetric linear filter.
1 2 3 4 5 6 7 |
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). |
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].
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.