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.
initialize.msbvar(y, p, z = NULL, lambda0, lambda1, lambda3, lambda4, lambda5, mu5, mu6, nu, qm, prior, h, Q = NULL)
ts()
.z = NULL
if there are none (the default). NULL
and the initial value is defined by qtune
.initialize.opt
argument in msbvar
)
szbvar
for detailsmsbvar
. This is an $m x (mp+1 + m) x h$ array of the initial coefficients. For the
i
th 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.Q
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.)
msbvar