geweke_diagTAR: Geweke's convergence diagnostic for 'mtar' objects

View source: R/wrapperfunctions.R

geweke_diagTARR Documentation

Geweke's convergence diagnostic for mtar objects

Description

This function computes Geweke's convergence diagnostic for Markov chain Monte Carlo (MCMC) output obtained from Bayesian estimation of multivariate TAR models. It is a wrapper around geweke.diag() that applies the diagnostic to the posterior chains returned by a call to mtar().

Usage

geweke_diagTAR(x, frac1 = 0.1, frac2 = 0.5)

Arguments

x

An object of class mtar returned by the function mtar().

frac1

A numeric value in (0,1) specifying the fraction of the initial part of each chain to be used in the diagnostic.

frac2

A numeric value in (0,1) specifying the fraction of the final part of each chain to be used in the diagnostic.

Value

A list containing the Geweke z-scores for the parameters of the mtar model.

See Also

geweke.diag

Examples


###### Example 1: Returns of the closing prices of three financial indexes
data(returns)
fit1 <- mtar(~ COLCAP + BOVESPA | SP500, data=returns, row.names=Date,
             subset={Date<="2015-12-07"}, dist="Student-t",
             ars=ars(nregim=3,p=c(1,1,2)), n.burnin=1000, n.sim=2000,
             n.thin=2)
geweke_diagTAR(fit1)

###### Example 2: Rainfall and two river flows in Colombia
data(riverflows)
fit2 <- mtar(~ Bedon + LaPlata | Rainfall, data=riverflows, row.names=Date,
             subset={Date<="2009-02-13"}, dist="Laplace",
             ars=ars(nregim=3,p=5), n.burnin=1000, n.sim=2000, n.thin=2)
geweke_diagTAR(fit2)

###### Example 3: Temperature, precipitation, and two river flows in Iceland
data(iceland.rf)
fit3 <- mtar(~ Jokulsa + Vatnsdalsa | Temperature | Precipitation,
             data=iceland.rf, subset={Date<="1974-11-06"}, row.names=Date,
             ars=ars(nregim=2,p=15,q=4,d=2), n.burnin=1000, n.sim=2000,
             n.thin=2, dist="Slash")
geweke_diagTAR(fit3)

###### Example 4: U.S. stock returns
data(US.returns)
fit4 <- mtar(~ CCR | dVIX, data=US.returns, subset={Date<="2025-11-28"},
             row.names=Date, ars=ars(nregim=2,p=3,d=3), n.burnin=1000,
             n.sim=2000, n.thin=2, dist="Student-t")
geweke_diagTAR(fit4)




mtarm documentation built on June 12, 2026, 5:07 p.m.