Filter a time series with options to shift and scale
raghat1.Rd
Filter a time series with options to shift and scale. This function is used by mixFilter.
Arguments
- filter
The coefficients of the filter, numeric, see Details.
- x
time series, numeric.
- index
indices for which to compute the filtered values, numeric.
- shift
a constant to be added to each filtered element, a number.
- residual
if TRUE calculate a `residual', otherwise calculate a `hat' value.
- scale
if
scale != 1
calculate scaled residuals by divividing by this value. Probably meaningful only ifresidual=TRUE
.
Details
This function is used by mixFilter
. Applies an autoregressive
filter to a time series for indices specified by index
.
Note that `filter' here is equivalent to calculating one-step
predictions (or residuals if residual=TRUE
) from
autoregressions.
index
should not specify indices smaller than
length(filter)+1
or larger than length(x)+1
. The value
length(x)+1
can legitimately be used to calculate a prediction
(but not a residual of course) for the first value after the end of the
series.