Learn R Programming

MSBVAR (version 0.7-0)

initialize.msbvar: Initializes the mode-finder for a Markov-switching Bayesian VAR model

Description

Sets up the initial values for the mode optimization of an MSBVAR model with a Sims-Zha prior. This sets up the initialize.opt argument of the msbvar function. Users can inputs values outside of the defaults for the Q transition matrix and other arguments with this function. This function also serves as a model for alternative, user-defined initial values for the Gibbs sampler.

Usage

initialize.msbvar(y, p, z = NULL, lambda0, lambda1, lambda3, lambda4,
                  lambda5, mu5, mu6, nu, qm, prior, h, Q = NULL)

Arguments

Value

A list with three elements (these are the inputs for the initialize.opt argument in msbvar)init.modelAn object of the class SZBVAR, see szbvar for detailsthetahat.startThe starting values for the regression parameters for the block optimization algorithm in msbvar. This is an $m \times (mp + 1 + m) \times h$ array of the initial coefficients. For the ith element of the array, the $m$ rows refer to the equations, the first column elements are the intercepts, the next $2:(mp + 1)$ columns are the AR(p) coefficients, and the final $m \times m$ elements are the error covariance for the regime, for that array element.Qhat.startInitial value of Q

Details

This function sets the initial or starting values for the the optimization algorithm for the mode of the MSBVAR models in msbvar. This is an attempt to (1) allow for a robust, smart guess for starting the block-optimization algorithm and (2) allow for user inputs to initialize.opt.

The function does three things:

(1) Estimates an initial szbvar model as a baseline, non-regime switching model.

(2) Estimates a set of h VAR regressions based on a kmeans clustering of the time series with $h$ clusters or centers. The VAR models fit to each of the $h$ subsets of data are used to initialize the msbvar function.

(3) Sets an initial value for Q in the block optimization algorithm for the mode of the MLE / posterior for the MSBVAR model. If Q=NULL, for an $h \times h$ transition matrix Q, this initial value is set based on the results from the kmeans clustering of the data. If the user inputs a value of Q, this is used and error checked to make sure it has the correct format (i.e., rows sum to 1, etc.)

See Also

msbvar

Examples

Run this code
##

Run the code above in your browser using DataLab