rfilter: Time Series Recursive Filters

Description Usage Arguments Details Value Author(s) Examples

View source: R/RcppExports.R

Description

Applies a recursive filter to a univariate time series.

Usage

1
rfilter(x, filter, init)

Arguments

x

A column vector of length T

filter

A column vector of length f

init

A column vector of length f that contains the initial values of the time series in reverse.

Details

Note: The length of 'init' must be equal to the length of 'filter'. This is a port of the rfilter function harnessed by the filter function in stats. It is about 6-7 times faster than R's base function. The benchmark was done on iMac Late 2013 using vecLib as the BLAS.

Value

x A column vector with its contents reversed.

Author(s)

R Core Team and JJB

Examples

1
2
3
4
5
x = 1:15
# 
rfilter(x, rep(1, 3), rep(1, 3))
# Using R's function
filter(x, rep(1, 3), method="recursive", init=rep(1, 3))

SMAC-Group/gmwm documentation built on Sept. 11, 2021, 10:06 a.m.