ts_moving_average {exams.forge} | R Documentation |
Moving Average
Description
Computes the moving average for a ts_data
object.
Usage
ts_moving_average(ts, order)
ts_ma(ts, order)
Arguments
ts |
a |
order |
integer: order of the moving average |
Value
Returns an extended ts_data
object with list elements:
-
filter
the filter used -
moving.average
the computed moving average
Examples
# trend from a quadratic model
ts <- ts_data(12, trend.coeff=c(sample(0:10, 1), sample(1+(1:10)/20, 1), 0.5))
ts_moving_average(ts, 3)
[Package exams.forge version 1.0.10 Index]