Creates a seasonal forecasting model based on similar historical dates. Each seasonal position is forecast by the mean of every historical observation at that position, together with the `window_width` time points either side of it.

LSDModel(s, window_width = 0L)

Arguments

s

Seasonal period (e.g., 7 for weekly, 12 for monthly)

window_width

Number of neighbouring time points averaged either side of each seasonal position (default: 0, averaging each position on its own). Wider windows blur the seasonal profile, and the value must be smaller than `s`.

Value

A spec for a Julia `LSDModel`, built when it is fitted (see [juliabridge::julia_spec()])

Examples

if (FALSE) { # \dontrun{
# Weekly seasonality
model <- LSDModel(s = 7)

# Monthly seasonality with window
model <- LSDModel(s = 12, window_width = 2)
} # }