Use MCMC to sample from the joint posterior of model parameters in an mbsts model.
mcmc( Smodel, X =NULL, H =NULL, nu0.r =NULL, s0.r, nu0.eps =NULL, s0.eps, niter, burn, ping =NULL)
Arguments
Smodel: A multivariate state space model of class SSModel.
X: t x N optional matrix of predictors.
H: P x P variance-covariance matrix of the regression coefficients. Set by default to H = c(X'X)^(-1) which is akin to the Zellner's g-prior. The value of the scaling factor is set to c = 1. Alternative priors could be H = cdiag((X'X)^(-1)) or H = cI. See also Smith & Kohn, 1995 that suggest setting c in the range [10,1000].
nu0.r: Degrees of freedom of the Inverse-Wishart prior for each Sigma.r. Set by default to n0.r = d + 2, where d is the number of time series in the multivariate model.
s0.r: Scale matrix of the Inverse-Wishart prior for each Sigma.r, a vector of errors for state r. Must be a (d x d) positive definite. Default set to the variance-covariance matrix of y multiplied by a scaling factor of 0.01.
nu0.eps: Degrees of freedom of the Inverse-Wishart prior for Sigma.eps, a vector of observation errors for each time series. Set by default to d + 2 (must be greater than d - 1).
s0.eps: Scale matrix of the Inverse-Wishart prior for Sigma.eps, a vector of observation errors for each time series. Must be a (d x d) positive definite. Default set to the variance-covariance matrix of y multiplied by a scaling factor of 0.01.
niter: Number of MCMC iterations.
burn: Desired burn-in, set by default to 0.1 * niter.
ping: A status message is printed every ping iteration. Default set to 0.1 * niter. Set to 0 to not track the status.
Returns
An object of class 'mbsts' which is a list with the following components:
eta.samples: (niter- burn) draws from the distribution of eta_r.
eps.samples: (niter- burn) draws from the distribution of eps.
states.samples: (niter- burn) draws from p(alpha_t | Y_1:T).
Sigma.r: (niter- burn) draws from the posterior distribution of Sigma.r.
Sigma.eps: (niter- burn) draws from the posterior distribution of Sigma.eps.
Z.beta: (niter- burn) x P matrix of the models selected at each iteration (if a matrix of predictors is provided).
beta: P x d x (niter- burn) ) array of the draws from the posterior distribution of the regression coefficient matrix (if a matrix of predictors is provided).
X: Predictor matrix (if provided).
y: Matrix of observations.
Z: (d x m) selection matrix of the observation equation.
Tt: (m x m) matrix of the state equation.
R: (m x r) matrix selecting the state disturbances.