Title: | Fast Additive Switching of Seasonality, Trend and Exogenous Regressors |
---|---|
Description: | Implementation of the FASSTER model for forecasting time series with multiple seasonalities using switching states. |
Authors: | Mitchell O'Hara-Wild [aut, cre], Rob Hyndman [aut, ths] |
Maintainer: | Mitchell O'Hara-Wild <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0.9100 |
Built: | 2024-11-01 03:24:45 UTC |
Source: | https://github.com/mitchelloharawild/fasster |
Implementation of the FASSTER model for forecasting time series with multiple seasonalities using switching states.
Package: | fasster |
Type: | Package |
License: | GPL3 |
LazyLoad: | yes |
Mitchell O'Hara-Wild
Maintainer: [email protected]
Implements FASSTER
FASSTER(formula, include = NULL, ...)
FASSTER(formula, include = NULL, ...)
formula |
An object of class "formula" (refer to 'Formula' for usage) |
include |
How many terms should be included to fit the model |
... |
Not used |
The fasster model extends commonly used state space models by introducing a switching component to the measurement equation. This is implemented using a time-varying DLM with the switching behaviour encoded in the measurement matrix.
Returns a mable containing the fitted FASSTER model.
fasster
inherits the standard formula specification from lm
for specifying exogenous regressors, including interactions and I()
functionality as described in formula
.
Special DLM components can be specified using special functions defined below:
seas(s): Creates seasonal factors with seasonal period s
fourier(s, K): Creates seasonal fourier terms with seasonal period s and K harmonics
poly(n): Creates a polynomial of order n (poly(1) creates a level, poly(2) creates a trend)
ARMA(ar, ma): Creates ARMA terms with coefficient vectors ar and ma
custom(dlm): Creates a custom dlm structure, using dlm
The switching operator, %S%
requires the switching factor variable on the LHS, and the model to switch over on the RHS (as built using the above components)
The model parameters are estimated using the following heuristic:
Filter the data using the specified model with non-zero state variances
Obtain smoothed states to approximate correct behaviour
The initial state parameters taken from the first smoothed state: ,
Obtain state noise variances from the smoothed variance of :
Obtain measurement noise variance from smoothed variance of
:
Repair restricted state variances for seasonal factors and ARMA terms
cbind(mdeaths, fdeaths) %>% as_tsibble(pivot_longer = FALSE) %>% model(FASSTER(mdeaths ~ fdeaths + trend(1) + fourier(12)))
cbind(mdeaths, fdeaths) %>% as_tsibble(pivot_longer = FALSE) %>% model(FASSTER(mdeaths ~ fdeaths + trend(1) + fourier(12)))
Obtains the mean and variance of the estimated initial states from a FASSTER
model. Values in the estimate
column are contains the mean, and the
std.error
column contains the standard deviation of the initial states.
## S3 method for class 'FASSTER' tidy(x, ...)
## S3 method for class 'FASSTER' tidy(x, ...)
x |
An object containing a FASSTER model. |
... |
Unused. |