The semi-local linear trend model is similar to the local linear trend, but more useful for long-term forecasting. It assumes the level component moves according to a random walk, but the slope component moves according to an AR1 process centered on a potentially nonzero value \(D\). The equation for the level is
$$\mu_{t+1} = \mu_t + \delta_t + \epsilon_t \qquad \epsilon_t \sim \mathcal{N(0, \sigma_\mu)}.$$
The equation for the slope is $$\delta_{t+1} = D + \phi (\delta_t - D) + \eta_t \qquad \eta_t \sim \mathcal{N(0, \sigma_\delta)}.$$
This model differs from the local linear trend model in that the latter assumes the slope \(\delta_t\) follows a random walk. A stationary AR(1) process is less variable than a random walk when making projections far into the future, so this model often gives more reasonable uncertainty estimates when making long term forecasts.
The prior distribution for the semi-local linear trend has four independent components. These are:
AddSemilocalLinearTrend(
state.specification = list(),
y = NULL,
level.sigma.prior = NULL,
slope.mean.prior = NULL,
slope.ar1.prior = NULL,
slope.sigma.prior = NULL,
initial.level.prior = NULL,
initial.slope.prior = NULL,
sdy = NULL,
initial.y = NULL)
sdy
and initial.y
are supplied, or if
all prior distributions are supplied directly.SdPrior
describing the prior
distribution for the standard deviation of the level component.NormalPrior
giving the prior distribution for
the mean parameter in the generalized local linear trend model (see
below). Ar1CoefficientPrior
giving the prior
distribution for the ar1 coefficient parameter in the generalized
local linear trend model (see below). SdPrior
describing the prior distribution of
the standard deviation of the slope component.NormalPrior
describing the initial distribution
of the level portion of the initial state vector.NormalPrior
describing the prior distribution
for the slope portion of the initial state vector.y
is provided, or if all the required
prior distributions are supplied directly. y
is provided, or if the priors for the initial
state are all provided directly.Durbin and Koopman (2001), "Time series analysis by state space methods", Oxford University Press.
bsts
.
SdPrior
NormalPrior