8.1 RW observed with multiple time series

A univariate random walk observed by 3 observation time series. \[\begin{equation} \begin{gathered} x_{t} = x_{t-1} + u + w_{t}, \text{ } w_t \sim \,\text{N}(0,q) \\ \\ \begin{bmatrix}y_1\\y_2\\y_3\end{bmatrix}_t = \begin{bmatrix}1\\1\\1\end{bmatrix} x_t + \begin{bmatrix}0\\0\\0\end{bmatrix} + \begin{bmatrix}v_1\\ v_2\\ v_3\end{bmatrix}, \textrm{ } \mathbf{v}_t \sim \,\text{MVN}\begin{pmatrix}\begin{bmatrix}0\\0\\0\end{bmatrix},\begin{bmatrix}r&0&0\\0&r&0\\0&0&r\end{bmatrix} \end{pmatrix} \end{gathered} \tag{8.2} \end{equation}\]

Create set up the model:

Z <- matrix(1, 3, 1)
R <- "diagonal and equal"

Fit with MARSS():

yt <- t(harborSealWA)[c("EBays", "PSnd", "HC"), ]
fit <- MARSS(yt, model = list(R = R, Z = Z))

Get confidence intervals with tidy():

broom::tidy(fit)
    term     estimate   std.error     conf.low      conf.up
1 A.PSnd -0.793079609 0.083137017 -0.956025168 -0.630134050
2   A.HC -0.864545855 0.090775537 -1.042462638 -0.686629073
3 R.diag  0.041048591 0.011183264  0.019129797  0.062967385
4    U.U  0.030295215 0.013645831  0.003549878  0.057040552
5    Q.Q  0.002704196 0.003471737 -0.004100284  0.009508676
6  x0.x0  6.964254445 0.122862306  6.723448750  7.205060139
plot.pars(fit)