Adds a static intercept term to a state space model. If the model includes a traditional trend component (e.g. local level, local linear trend, etc) then a separate intercept is not needed (and will probably cause trouble, as it will be confounded with the initial state of the trend model). However, if there is no trend, or the trend is an AR process centered around zero, then adding a static intercept will shift the center to a data-determined value.
AddStaticIntercept(
state.specification,
y,
initial.state.prior = NormalPrior(y[1], sd(y, na.rm = TRUE)))
A list of state components that you wish to add to. If omitted, an empty list will be assumed.
The time series to be modeled, as a numeric vector.
An object created using
NormalPrior
, describing the prior distribution
of the intecept term.
Returns a list with the information required to specify the state component. If initial.state.prior is specified then y is unused.
Harvey (1990), "Forecasting, structural time series, and the Kalman filter", Cambridge University Press.
Durbin and Koopman (2001), "Time series analysis by state space methods", Oxford University Press.