View source: R/ts_moving_average.R
ts_moving_average | R Documentation |
Computes the moving average for a ts_data
object.
ts_moving_average(ts, order)
ts_ma(ts, order)
ts |
a |
order |
integer: order of the moving average |
Returns an extended ts_data
object with list elements:
filter
the filter used
moving.average
the computed moving average
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.