Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/regimeSummary.R
Provides summary and quantile computations for regime probabilities and regime durations based on MSBVAR MCMC output
1 | regimeSummary(x, quantiles = c(0.025, 0.25, 0.5, 0.75, 0.975))
|
x |
output from |
quantiles |
quantiles one wants to compute, as is done in the
|
This function is mainly a wrapper for calls to the coda
package
to summarize the MCMC output for the transition matrix of an MSBVAR
model estimated from gibbs.msbvar
. It adds labels to
the output so one know which regime is which in the output. In the
summary of the transition matrix Q's elements q(ij)
for the transition from regime i to regime j.
The ergodic regime probabilities are computed for draw k of the MSBVAR MCMC sampler as described in Kim and Nelson (1999):
eta <- solve(rbind(cbind(diag(h-1) - t(Q)[1:(h-1),1:(h-1)], t(Q)[1:(h-1),h]), rep(1,h)))
This is the gives N2 draws of the ergodic probabilities of being
in regime k. These are summarized again using coda
functions.
Finally, the ergodic regime probabilities can be used to estimate
expected long run regime durations. For eta(k) the
expected regime duration is 1/(1-eta(k). This
again is summarized over the N2 draws using coda
functions.
Invisible list with 3 elements:
Q.summary |
Summary and quantiles of the |
lrQ |
Summary and quantiles of the long run or ergodic regime probabilities |
durations |
Summary and quantiles of the estimated regime durations |
Patrick T. Brandt
Kim, Chang-Jin and Charles R. Nelson. 1999. State-Space Models with Regime Switching: Classical and Gibbs-Sampling Approaches with Applications. Cambridge: MIT Press.
gibbs.msbvar
, plotregimeid
, msbvar
1 2 3 4 | ## Not run:
regimeSummary(x)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.