Learn R Programming

MSBVAR (version 0.9-2)

regimeSummary: Regime probability summaries and regime duration estimates based on MCMC output for MSBVAR models

Description

Provides summary and quantile computations for regime probabilities and regime durations based on MSBVAR MCMC output

Usage

regimeSummary(x, quantiles = c(0.025, 0.25, 0.5, 0.75, 0.975))

Arguments

x
output from gibbs.msbvar, the MCMC sampler for the MSBVAR models
quantiles
quantiles one wants to compute, as is done in the coda package. Defaults are as given above.

Value

Q.summary
Summary and quantiles of the x$Q.sample draws of the transition matrix
lrQ
Summary and quantiles of the long run or ergodic regime probabilities
durations
Summary and quantiles of the estimated regime durations

Details

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.

References

Kim, Chang-Jin and Charles R. Nelson. 1999. State-Space Models with Regime Switching: Classical and Gibbs-Sampling Approaches with Applications. Cambridge: MIT Press.

See Also

gibbs.msbvar, plotregimeid, msbvar

Examples

Run this code
## Not run: 
# regimeSummary(x)
# ## End(Not run)

Run the code above in your browser using DataLab