convert {mtarm} | R Documentation |
Converts chains from the Bayesian estimation of a multivariate TAR model to a mcmc object.
Description
This function converts the chains obtained from the Bayesian estimation of a multivariate TAR model to a mcmc
object to be analyzed with the coda package.
Usage
convert(object, type = c("location", "scale", "extra"), regime = 1)
Arguments
object |
an object of the class mtar. |
type |
an (optional) character string that allows the user to specify the parameter that corresponds to the
chains to convert. The available options are: "location", "scale" and "extra". As default, |
regime |
an (optional) integer value that allows the user to specify the regime that corresponds to the chains to plot.
As default, |
Value
a mcmc
-type object.
Examples
###### Example 1: Returns of the closing prices of three financial indexes
data(returns)
fit1 <- mtar(~ COLCAP + BOVESPA | SP500, row.names=Date, dist="Slash",
data=returns, ars=list(p=c(1,1,2)), n.burnin=100, n.sim=3000)
location.chains.1 <- convert(fit1,type="location",regime=2)
summary(location.chains.1)
plot(location.chains.1)
###### Example 2: Rainfall and two river flows in Colombia
data(riverflows)
fit2 <- mtar(~ Bedon + LaPlata | Rainfall, row.names=Date, dist="Laplace",
data=riverflows, ars=list(p=c(5,5,5)), n.burnin=100, n.sim=3000)
location.chains.2 <- convert(fit2,type="location",regime=3)
summary(location.chains.2)
plot(location.chains.2)
[Package mtarm version 0.1.2 Index]