Learn R Programming

bssm (version 0.1.8)

ngssm: General univariate non-Gaussian/non-linear state space models

Description

Construct an object of class ngssm by defining the corresponding terms of the observation and state equation:

Usage

ngssm(y, Z, T, R, a1, P1, distribution, phi, u = 1, xreg = NULL, beta,
  state_names, Z_prior, T_prior, R_prior, state_intercept)

Arguments

y

Observations as time series (or vector) of length \(n\).

Z

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.

T

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.

R

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.

a1

Prior mean for the initial state as a vector of length m.

P1

Prior covariance matrix for the initial state as m x m matrix.

distribution

distribution of the observation. Possible choices are "poisson", "binomial", and "negative binomial".

phi

Additional parameter relating to the non-Gaussian distribution. For Negative binomial distribution this is the dispersion term, and for other distributions this is ignored.

u

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.

xreg

Matrix containing covariates.

beta

Regression coefficients. Used as an initial value in MCMC. Defaults to vector of zeros.

state_names

Names for the states.

Z_prior, T_prior, R_prior

Priors for the NA values in system matrices.

state_intercept

Intercept terms for state equation, given as a m times n matrix.

Value

Object of class ngssm.

Details

$$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.