Filter a time series with options to shift and scale. This function is used by mixFilter.
raghat1(filter, x, index, shift = 0, residual = FALSE, scale = 1)
A numeric vector of length equal to length(index)
.
The coefficients of the filter, numeric, see Details.
time series, numeric.
indices for which to compute the filtered values, numeric.
a constant to be added to each filtered element, a number.
if TRUE calculate a `residual', otherwise calculate a `hat' value.
if scale != 1
calculate scaled residuals by divividing by
this value. Probably meaningful only if residual=TRUE
.
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.