Description Usage Arguments Details Value Note Author(s) See Also Examples
View source: R/initialize.msbvar.R
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.
1 2 | initialize.msbvar(y, p, z = NULL, lambda0, lambda1, lambda3, lambda4,
lambda5, mu5, mu6, nu, qm, prior, h, Q = NULL)
|
y |
T x m multiple time
series object created with |
p |
Lag length, an integer |
z |
NOT IMPLEMENTED AT PRESENT: THIS SHOULD BE A T x k matrix of exogenous variables. Can
be |
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 ≥0. Larger values imply difference stationarity. |
mu6 |
Dummy initial observations or drift prior ≥0. 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
|
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.)
A list with three elements (these are the inputs for the
initialize.opt
argument in msbvar
)
init.model |
An object of the class SZBVAR, see
|
thetahat.start |
The starting values for the regression
parameters for the block optimization algorithm in
|
Qhat.start |
Initial value of |
This function can be used to model other ways to set the initial
conditions. The subsequent calls to the msbvar
function
only require an object that satisfies having the elements returned
from this function — computed by this function or the user in some
way.
Patrick T. Brandt
1 | ##
|
##
## MSBVAR Package v.0.9-2
## Build date: Mon Jul 10 09:15:21 2017
## Copyright (C) 2005-2017, Patrick T. Brandt
## Written by Patrick T. Brandt
##
## Support provided by the U.S. National Science Foundation
## (Grants SES-0351179, SES-0351205, SES-0540816, and SES-0921051)
##
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.