## 9.4 Stochastic regression model

The stochastic level models in Section 9.3 do not have predictor variables (covariates). Let’s add one predictor variable $$f_t$$ and write a simple DLM where the intercept $$\alpha$$ and slope $$\beta$$ are stochastic. We will specify that $$\alpha$$ and $$\beta$$ evolve according to a simple random walk. Normally $$x$$ is used for the predictor variables in a regression model, but we will avoid that since we are using $$x$$ for the state equation in a state-space model. This model is

$$$\tag{9.9} y_t = \alpha_t + \beta_t f_t + v_t \\ \alpha_t = \alpha_{t-1} + w_{\alpha,t} \\ \beta_t = \beta_{t-1} + w_{\beta,t}$$$ Written in matrix form, the model is $$$\tag{9.10} y_t = \begin{bmatrix} 1 & f_t \end{bmatrix}\begin{bmatrix} \alpha \\ \beta \end{bmatrix}_t + v_t \\ \begin{bmatrix} \alpha \\ \beta \end{bmatrix}_t = \begin{bmatrix} \alpha \\ \beta \end{bmatrix}_{t-1} + \begin{bmatrix} w_{\alpha} \\ w_{\beta} \end{bmatrix}_t$$$

Equation (9.10) is a MARSS model: $$$y_t = \mathbf{Z}\mathbf{x}_t + v_t \\ \mathbf{x}_t = \mathbf{x}_{t-1} + \mathbf{w}_t$$$ where $$\mathbf{x}=\begin{bmatrix}\alpha \\ \beta\end{bmatrix}$$ and $$\mathbf{Z}=\begin{bmatrix}1&f_t\end{bmatrix}$$.