ldhmm.sma: Simple moving average of a time series

Description Usage Arguments Value Author(s) Examples

View source: R/ldhmm-sma.R

Description

This utility calculates simple moving average, with option to backfill for NA.

Usage

1
ldhmm.sma(x, order, na.backfill = TRUE)

Arguments

x

numeric, the time series.

order

a positive integer to specify order of moving average.

na.backfill

logical, specify whether to backfill for NA. Default is TRUE.

Value

numeric, simple moving average, same length as x.

Author(s)

Stephen H. Lihn

Examples

1
2
x <- 1:100
a <- ldhmm.sma(x, 10)

Example output



ldhmm documentation built on Jan. 11, 2020, 9:16 a.m.