powered by
This utility calculates simple moving average, with option to backfill for NA.
ldhmm.sma(x, order, na.backfill = TRUE)
numeric, simple moving average, same length as x.
numeric, the time series.
a positive integer to specify order of moving average.
logical, specify whether to backfill for NA. Default is TRUE.
TRUE
Stephen H. Lihn
x <- 1:100 a <- ldhmm.sma(x, 10)
Run the code above in your browser using DataLab