Construct an object of class ngssm
by defining the corresponding terms
of the observation and state equation:
ngssm(y, Z, T, R, a1, P1, distribution, phi, u = 1, xreg = NULL, beta,
state_names, Z_prior, T_prior, R_prior, state_intercept)
Observations as time series (or vector) of length \(n\).
System matrix Z of the observation equation. Either a vector of length m, a m x n matrix, or object which can be coerced to such.
System matrix T of the state equation. Either a m x m matrix or a m x m x n array, or object which can be coerced to such.
Lower triangular matrix R the state equation. Either a m x k matrix or a m x k x n array, or object which can be coerced to such.
Prior mean for the initial state as a vector of length m.
Prior covariance matrix for the initial state as m x m matrix.
distribution of the observation. Possible choices are
"poisson"
, "binomial"
, and "negative binomial"
.
Additional parameter relating to the non-Gaussian distribution. For Negative binomial distribution this is the dispersion term, and for other distributions this is ignored.
Constant parameter for non-Gaussian models. For Poisson and negative binomial distribution, this corresponds to the offset term. For binomial, this is the number of trials.
Matrix containing covariates.
Regression coefficients. Used as an initial value in MCMC. Defaults to vector of zeros.
Names for the states.
Priors for the NA values in system matrices.
Intercept terms for state equation, given as a m times n matrix.
Object of class ngssm
.
$$p(y_t | Z_t \alpha_t), (\textrm{observation equation})$$ $$\alpha_{t+1} = T_t \alpha_t + R_t \eta_t, (\textrm{transition equation})$$
where \(\eta_t \sim N(0, I_k)\) and \(\alpha_1 \sim N(a_1, P_1)\) independently of each other, and \(p(y_t | .)\) is either Poisson, binomial or negative binomial distribution.