Constructs an object of class nlg_ssm
by defining the corresponding terms
of the observation and state equation:
nlg_ssm(y, Z, H, T, R, Z_gn, T_gn, a1, P1, theta, known_params = NA,
known_tv_params = matrix(NA), n_states, n_etas, log_prior_pdf,
time_varying = rep(TRUE, 4), state_names = paste0("state",
1:n_states))
Observations as multivariate time series (or matrix) of length \(n\).
An external pointers for the C++ functions which define the corresponding model functions.
An external pointers for the C++ functions which define the gradients of the corresponding model functions.
Prior mean for the initial state as a vector of length m.
Prior covariance matrix for the initial state as m x m matrix.
Parameter vector passed to all model functions.
Vector of known parameters passed to all model functions.
Matrix of known parameters passed to all model functions.
Number of states in the model.
Dimension of the noise term of the transition equation.
An external pointer for the C++ function which computes the log-prior density given theta.
Optional logical vector of length 4, denoting whether the values of Z, H, T, and R vary with respect to time variable (given identical states). If used, this can speed up some computations.
Names for the states.
Object of class nlg_ssm
.
$$y_t = Z(t, \alpha_t, \theta) + H(t, \theta) \epsilon_t, (\textrm{observation equation})$$ $$\alpha_{t+1} = T(t, \alpha_t, \theta) + R(t, \theta)\eta_t, (\textrm{transition equation})$$
where \(\epsilon_t \sim N(0, I_p)\), \(\eta_t \sim N(0, I_m)\) and \(\alpha_1 \sim N(a_1, P_1)\) independently of each other, and functions \(Z, H, T, R\) can depend on \(\alpha_t\) and parameter vector \(\theta\).
Compared to other models, these general models need a bit more effort from the user, as you must provide the several small C++ snippets which define the model structure. See examples in the vignette.