Learn R Programming

MSBVAR (version 0.9-2)

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

y
$T x m$ multiple time series object created with ts().
p
Lag length, an integer
z
NOT IMPLEMENTED AT PRESENT: THIS SHOULD BE A $T x k$ matrix of exogenous variables. Can be z = NULL if there are none (the default).
lambda0
$[0,1]$, Overall tightness of the prior (discounting of prior scale).
lambda1
$[0,1]$, Standard deviation or tightness of the prior around the AR(1) parameters.
lambda3
Lag decay ($>0$, with 1=harmonic)
lambda4
Standard deviation or tightness around the intercept $>0$
lambda5
Standard deviation or tightness around the exogneous variable coefficients $>0$
mu5
Sum of coefficients prior weight $\ge0$. Larger values imply difference stationarity.
mu6
Dummy initial observations or drift prior $\ge0$. Larger values allow for common trends.
nu
Prior degrees of freedom, $m+1$
qm
Frequency of the data for lag decay equivalence. Default is 4, and a value of 12 will match the lag decay of monthly to quarterly data. Other values have the same effect as "4"
prior
One of three values: 0 = Normal-Wishart prior, 1 = Normal-flat prior, 2 = flat-flat prior (i.e., akin to MLE)
h
Number of regimes / states, an integer
Q
$ h$ dimensional transition matrix for the MS process. $h x h$ Markov transition matrix whose rows sum to 1 with the main weights on the diagonal elements. Default is NULL and the initial value is defined by qtune.

Value

initialize.opt argument in msbvar)
init.model
An object of the class SZBVAR, see szbvar for details
thetahat.start
The starting values for the regression parameters for the block optimization algorithm in msbvar. This is an $m x (mp+1 + m) x 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 x m$ elements are the error covariance for the regime, for that array element.
Qhat.start
Initial 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 x 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