lgg_ssm: General multivariate linear Gaussian state space models

Description Usage Arguments Details Value

View source: R/models.R

Description

Constructs an object of class llg_ssm by defining the corresponding terms of the observation and state equation:

Usage

1
2
3
4
lgg_ssm(y, Z, H, T, R, a1, P1, theta, obs_intercept, state_intercept,
  known_params = NA, known_tv_params = matrix(NA), n_states, n_etas,
  log_prior_pdf, time_varying = rep(TRUE, 6),
  state_names = paste0("state", 1:n_states))

Arguments

y

Observations as multivariate time series (or matrix) of length n.

Z, H, T, R, a1, P1, obs_intercept, state_intercept

An external pointers for the C++ functions which define the corresponding model functions.

theta

Parameter vector passed to all model functions.

known_params

Vector of known parameters passed to all model functions.

known_tv_params

Matrix of known parameters passed to all model functions.

n_states

Number of states in the model.

n_etas

Dimension of the noise term of the transition equation.

log_prior_pdf

An external pointer for the C++ function which computes the log-prior density given theta.

time_varying

Optional logical vector of length 6, denoting whether the values of Z, H, T, R, D and C can vary with respect to time variable. If used, can speed up some computations.

state_names

Names for the states.

Details

y_t = D(t,θ) + Z(t,θ) α_t + H(t, θ) ε_t, (\textrm{observation equation})

α_{t+1} = C(t,θ) + T(t, θ) α_t + R(t, θ)η_t, (\textrm{transition equation})

where ε_t \sim N(0, I_p), η_t \sim N(0, I_m) and α_1 \sim N(a_1, P_1) independently of each other.

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.

Value

Object of class llg_ssm.


bssm documentation built on Nov. 22, 2018, 5:06 p.m.