The measurement model is given by \[\begin{equation}
Y_{i, t}
=
\left(
\begin{array}{cc}
1 & 0 \\
\end{array}
\right)
\left(
\begin{array}{c}
\eta_{0_{i, t}} \\
\eta_{1_{i, t}} \\
\end{array}
\right)
+
\boldsymbol{\varepsilon}_{i, t},
\quad
\mathrm{with}
\quad
\boldsymbol{\varepsilon}_{i, t}
\sim
\mathcal{N}
\left(
0,
\theta
\right)
\end{equation}\] where \(Y_{i, t}\), \(\eta_{0_{i, t}}\), \(\eta_{1_{i, t}}\), and \(\boldsymbol{\varepsilon}_{i, t}\) are random variables and \(\theta\) is a model parameter. \(Y_{i, t}\) is the observed random variable at time \(t\) and individual \(i\), \(\eta_{0_{i, t}}\) (intercept) and \(\eta_{1_{i, t}}\) (slope) form a vector of latent random variables at time \(t\) and individual \(i\), and \(\boldsymbol{\varepsilon}_{i, t}\) a vector of random measurement errors at time \(t\) and individual \(i\). \(\theta\) is the variance of \(\boldsymbol{\varepsilon}\).
The dynamic structure is given by \[\begin{equation}
\left(
\begin{array}{c}
\eta_{0_{i, t}} \\
\eta_{1_{i, t}} \\
\end{array}
\right)
=
\left(
\begin{array}{cc}
1 & 1 \\
0 & 1 \\
\end{array}
\right)
\left(
\begin{array}{c}
\eta_{0_{i, t - 1}} \\
\eta_{1_{i, t - 1}} \\
\end{array}
\right) .
\end{equation}\]
The mean vector and covariance matrix of the intercept and slope are captured in the mean vector and covariance matrix of the initial condition given by \[\begin{equation}
\boldsymbol{\mu}_{\boldsymbol{\eta} \mid 0}
=
\left(
\begin{array}{c}
\mu_{\eta_{0}} \\
\mu_{\eta_{1}} \\
\end{array}
\right) \quad \mathrm{and,}
\end{equation}\]
id time y1
Min. : 1 Min. :0 Min. :-10.7863
1st Qu.: 2501 1st Qu.:1 1st Qu.: 0.3943
Median : 5000 Median :2 Median : 2.1839
Mean : 5000 Mean :2 Mean : 2.5978
3rd Qu.: 7500 3rd Qu.:3 3rd Qu.: 4.4536
Max. :10000 Max. :4 Max. : 21.0250
dynr_dynamics<-dynr::prep.formulaDynamics( formula =list(eta_0~eta_0+eta_1,eta_1~eta_1), isContinuousTime =FALSE)
Warning in dynr::prep.formulaDynamics(formula = list(eta_0 ~ eta_0 + eta_1, :
You provided no start values: length(startval)==0. If you have no free
parameters, keep calm and carry on.