Learn R Programming

bssm (version 0.1.8)

gssm: General univariate linear-Gaussian state space models

Description

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

Usage

gssm(y, Z, H, T, R, a1, P1, xreg = NULL, beta, state_names, H_prior,
  Z_prior, T_prior, R_prior, obs_intercept, 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 or a m x n array, or an object which can be coerced to such.

H

Vector of standard deviations. Either a scalar or a vector of length n, or an 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.

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.

H_prior, Z_prior, T_prior, R_prior

Priors for the NA values in system matrices.

obs_intercept, state_intercept

Intercept terms for observation and state equations, given as a length n vector and m times n matrix respectively.

Value

Object of class gssm.

Details

$$y_t = D_t + Z_t \alpha_t + H_t \epsilon_t, (\textrm{observation equation})$$ $$\alpha_{t+1} = C_t + T_t \alpha_t + R_t \eta_t, (\textrm{transition equation})$$

where \(\epsilon_t \sim N(0, 1)\), \(\eta_t \sim N(0, I_k)\) and \(\alpha_1 \sim N(a_1, P_1)\) independently of each other.

The priors are defined for each NA value of the system matrices, in the same order as these values are naturally read in R. For more flexibility, see lgg_ssm.