ldhmm.sma: Simple moving average of a time series

View source: R/ldhmm-sma.R

ldhmm.smaR Documentation

Simple moving average of a time series

Description

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

Usage

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

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

ldhmm documentation built on May 29, 2024, 7:05 a.m.