convert: Converts chains from the Bayesian estimation of a...

View source: R/mtar.R

convertR 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, type is set to "location".

regime

an (optional) integer value that allows the user to specify the regime that corresponds to the chains to plot. As default, regime is set to 1.

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)



mtarm documentation built on June 22, 2024, 9:50 a.m.

Related to convert in mtarm...