
Last chance! 50% off unlimited learning
Sale ends in
cfilter(x, filter, sides, circular)
column vector
of length Tcolumn vector
of length fint
that takes either 1:for using past values only or 2: filter coefficients are centered around lag 0.bool
that indicates if the filter should be wrapped around the ends of the time series.column vec
that contains the results of the filtering process.
x = 1:100
#
cfilter(x, rep(1, 3), sides = 2, circular = FALSE)
# Using R's function
filter(x, rep(1, 3))
#
cfilter(x, rep(1, 3), sides = 1, circular = FALSE)
# Using R's function
filter(x, rep(1, 3), sides = 1)
#
cfilter(x, rep(1, 3), sides = 1, circular = TRUE)
# Using R's function
filter(x, rep(1, 3), sides = 1, circular = TRUE)
Run the code above in your browser using DataLab