## 14.5 Model Shared stochastic level with AR-1 observation errors

This time I will allow AR-1 errors that are not a random walk, so classic AR-1 errors. This means estimating the diagonals of a $$B$$ matrix. To do that I will need to get rid of the mean of the data since trying to estimate a $$B$$ matrix and mean levels is hard (there is a huge ridge in the likelihood and the problem is poorly defined).

$\begin{bmatrix}a \\ x1 \\ x2 \\ x3\end{bmatrix}_t = \begin{bmatrix}1&0&0&0\\0&b_1&0&0 \\ 0&0&b_2&0 \\ 0&0&0&b_3\end{bmatrix}\begin{bmatrix}a \\ x1 \\ x2 \\ x3\end{bmatrix}_{t-1} + \begin{bmatrix}e \\ w1 \\ w2 \\ w3\end{bmatrix}_t, \quad \begin{bmatrix}e \\ w1 \\ w2 \\ w3\end{bmatrix}_t \sim MVN\left(0, \begin{bmatrix}1&0&0&0\\0&q_1&0&0 \\ 0&0&q_2&0 \\ 0&0&0&q_3\end{bmatrix}\right)$

Here is the data model BUT the $$y$$ will be demeaned. Each sensor observes $$a$$ plus their own independent local AR-1 trend. Notice no $$v_t$$. The model error comes through the AR-1 $$x$$ processes.

$\begin{bmatrix}y1 \\ y2 \\ y3\end{bmatrix} = \begin{bmatrix}1&1&0&0 \\ 1&0&1&0 \\ 1&0&0&1\end{bmatrix} \begin{bmatrix}a \\ x1 \\ x2 \\ x3\end{bmatrix}_t$