ts_fil_seas_adj: Seasonal Adjustment

View source: R/ts_fil_seas_adj.R

ts_fil_seas_adjR Documentation

Seasonal Adjustment

Description

Remove the seasonal component from a time series while preserving level and trend, using a state-space/BATS approach.

Usage

ts_fil_seas_adj(frequency = NULL)

Arguments

frequency

Frequency of the time series. It is an optional parameter. It can be configured when the frequency of the time series is known.

Value

A ts_fil_seas_adj object.

References

  • R. J. Hyndman and G. Athanasopoulos (2021). Forecasting: Principles and Practice (3rd ed). OTexts. (BATS/seasonal adjustment)

Examples

# Seasonal adjustment using BATS at known frequency
# Load package and example data
library(daltoolbox)
data(tsd)
tsd$y[9] <- 2 * tsd$y[9]  # inject an outlier (illustrative)

# Fit seasonal adjustment (set frequency if known) and transform
filter <- ts_fil_seas_adj(frequency = 26)
filter <- fit(filter, tsd$y)
y <- transform(filter, tsd$y)

# Plot original vs seasonally adjusted series
plot_ts_pred(y = tsd$y, yadj = y)

tspredit documentation built on Feb. 11, 2026, 9:08 a.m.