bsts_modelspec | R Documentation |
Specifies a BSTS model prior to estimation.
bsts_modelspec( y, xreg = NULL, frequency = NULL, differences = 0, level = TRUE, slope = TRUE, damped = FALSE, seasonal = FALSE, seasonal_frequency = 4, ar = FALSE, ar_max = 1, cycle = FALSE, cycle_frequency = NULL, cycle_names = NULL, seasonal_type = "regular", seasonal_harmonics = NULL, transformation = "box-cox", lambda = NULL, lower = 0, upper = 1, distribution = "gaussian", ... )
y |
an xts vector. |
xreg |
an xts matrix of external regressors. |
frequency |
frequency of y (if using a seasonal model). |
differences |
number of differences to apply to the outcome variable y (max of 2). |
level |
whether to include a level component (Local Level Model). |
slope |
whether to include a slope component (Local Linear Model). |
damped |
whether to include a damped trend (damped Local Linear Model). |
seasonal |
whether to include a seasonal component. |
seasonal_frequency |
vector of seasonal frequencies. |
ar |
whether to include a sparse AR component. |
ar_max |
number of lags for the AR component. |
cycle |
whether to include a cyclical component. |
cycle_frequency |
number of periods in a cycle. This can be a vector in which case multiple cycles are included. |
cycle_names |
optional vector of cycle names. |
seasonal_type |
type of seasonality (regular or trigonometric). |
seasonal_harmonics |
number of harmonics to include in the seasonal component when seasonal_type is trigonometric. |
transformation |
a valid transformation for y from the “tstransform” function in the “tsaux” package (currently box-cox or logit are available). |
lambda |
the Box Cox lambda. If NA will estimate this using the method of Guerrero. |
lower |
lower bound for the transformation. |
upper |
upper bound for the transformation. |
distribution |
valid choices are currently only “gaussian”. |
... |
not currently used. |
An object of class “bsts.spec”.
This is a wrapper to part of the functionality of the bsts package. Once an object is estimated, all other methods are implemented locally (including prediction).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.