*Structural time series* models are (linear Gaussian) state-space
models for (univariate) time series based on a decomposition of the
series into a number of components. They are specified by a set of
error variances, some of which may be zero.

The simplest model is the *local level* model specified by
`type = "level"`

. This has an underlying level \(\mu_t\) which
evolves by
$$\mu_{t+1} = \mu_t + \xi_t, \qquad \xi_t \sim N(0, \sigma^2_\xi)$$
The observations are
$$x_t = \mu_t + \epsilon_t, \qquad \epsilon_t \sim N(0, \sigma^2_\epsilon)$$
There are two parameters, \(\sigma^2_\xi\)
and \(\sigma^2_\epsilon\). It is an ARIMA(0,1,1) model,
but with restrictions on the parameter set.

The *local linear trend model*, `type = "trend"`

, has the same
measurement equation, but with a time-varying slope in the dynamics for
\(\mu_t\), given by
$$
\mu_{t+1} = \mu_t + \nu_t + \xi_t, \qquad \xi_t \sim N(0, \sigma^2_\xi)
$$
$$
\nu_{t+1} = \nu_t + \zeta_t, \qquad \zeta_t \sim N(0, \sigma^2_\zeta)
$$
with three variance parameters. It is not uncommon to find
\(\sigma^2_\zeta = 0\) (which reduces to the local
level model) or \(\sigma^2_\xi = 0\), which ensures a
smooth trend. This is a restricted ARIMA(0,2,2) model.

The *basic structural model*, `type = "BSM"`

, is a local
trend model with an additional seasonal component. Thus the measurement
equation is
$$x_t = \mu_t + \gamma_t + \epsilon_t, \qquad \epsilon_t \sim N(0, \sigma^2_\epsilon)$$
where \(\gamma_t\) is a seasonal component with dynamics
$$
\gamma_{t+1} = -\gamma_t + \cdots + \gamma_{t-s+2} + \omega_t, \qquad
\omega_t \sim N(0, \sigma^2_\omega)
$$
The boundary case \(\sigma^2_\omega = 0\) corresponds
to a deterministic (but arbitrary) seasonal pattern. (This is
sometimes known as the ‘dummy variable’ version of the BSM.)