# Unobserved components

The first model considered in the state space models GSoC 2015 project is the class of univariate unobserved components models. This blog post lays out the general structure and the different variations that will be allowed.

The basic unobserved components (or structural time series) model can be written (see Durbin and Koopman 2012, Chapter 3 for notation and additional details):

where different specifications for the different individual components can support a range of models.

### Trend

The trend component is a dynamic extension of a regression model that includes an intercept and linear time-trend.

where the level is a generalization of the intercept term that can dynamically vary across time, and the trend is a generalization of the time-trend such that the slope can dynamically vary across time.

For both elements (level and trend), we can consider models in which:

- The element is included vs excluded (if the trend is included, there must also be a level included).
- The element is deterministic vs stochastic (i.e. whether or not the variance on the error term is confined to be zero or not)

The only additional parameters to be estimated via MLE are the variances of any included stochastic components.

This leads to the following specifications:

Level | Trend | Stochastic Level | Stochastic Trend | |
---|---|---|---|---|

Constant | ✓ | |||

Local Level (random walk) |
✓ | ✓ | ||

Deterministic trend | ✓ | ✓ | ||

Local level with deterministic trend (random walk with drift) |
✓ | ✓ | ✓ | |

Local linear trend | ✓ | ✓ | ✓ | ✓ |

Smooth trend (integrated random walk) |
✓ | ✓ | ✓ |

### Seasonal

The seasonal component is written as:

The periodicity (number of seasons) is `s`

, and the defining character is that (without the error term), the seasonal components sum to zero across one complete cycle. The inclusion of an error term allows the seasonal effects to vary over time.

The variants of this model are:

- The periodicity
`s`

- Whether or not to make the seasonal effects stochastic.

If the seasonal effect is stochastic, then there is one additional parameter to estimate via MLE (the variance of the error term).

### Cycle

The cyclical component is intended to capture cyclical effects at time frames much longer than captured by the seasonal component. For example, in economics the cyclical term is often intended to capture the business cycle, and is then expected to have a period between “1.5 and 12 years” (see Durbin and Koopman).

The cycle is written as:

The parameter `lambda_c`

(the frequency of the cycle) is an additional parameter to be estimated by MLE. If the seasonal effect is stochastic, then there is one another parameter to estimate (the variance of the error term - note that both of the error terms here share the same variance, but are assumed to have independent draws).

### Irregular

The irregular component is assumed to be a white noise error term. Its variance is a parameter to be estimated by MLE.

## Extensions

The following extensions may be included in the model depending on time-constraints:

### Autoregressive irregular

In some cases, we may want to generalize the irregular component to allow for autoregressive effects:

In this case, the autoregressive parameters would be estimated via MLE.

### Regression effects

We may want to allow for explanatory variables by including additional terms

(where a futher extension would allow time-varying regression parameters) or for intervention effects by including

These additional parameters could be estimated via MLE or by including them as components of the state space formulation.