ts_fil_ema: Time Series Exponential Moving Average

View source: R/ts_fil_ema.R

ts_fil_emaR Documentation

Time Series Exponential Moving Average

Description

Used to smooth out fluctuations, while giving more weight to recent observations. Particularly useful when the data has a trend or seasonality component.

Usage

ts_fil_ema(ema = 3)

Arguments

ema

exponential moving average size

Value

a ts_fil_ema object.

Examples

# time series with noise
library(daltoolbox)
data(tsd)
tsd$y[9] <- 2*tsd$y[9]

# filter
filter <- ts_fil_ema(ema = 3)
filter <- fit(filter, tsd$y)
y <- transform(filter, tsd$y)

# plot
plot_ts_pred(y=tsd$y, yadj=y)

tspredit documentation built on June 22, 2025, 5:07 p.m.