CZ_MANOVA: RJMCMC convergence assessment of multiple parameters

View source: R/functions.R

CZ_MANOVAR Documentation

RJMCMC convergence assessment of multiple parameters

Description

This function creates an object of class CZ_MANOVA with the necessary information to plot the diagnostic graphics proposed by the \insertCiteCZ;textualconvRJMCMC criteria for multiple parameters.

Usage

CZ_MANOVA(theta,chains,models,mcmciterations,nbatches,batchsize,confidence,division)

Arguments

theta

Matrix with parameters observations, different parameters must be on different collumns. For some iteration, chain, and model in a row, there must be a vector of the observed paramenters.

chains

Chain index for the observed parameters. The number of iterations per chain must be equal.

models

Model index for the observed parameters.

mcmciterations

For a given chain is the iteration index value.

nbatches

Numbers of batches. The standard value is 20.

batchsize

It is the size of a batch given by iterations in a chain/nbatches consecutive integer. The function disregard nbatches value in case both are available. There is only a need to supply the nbatches or batchsize value.

confidence

It is the confidence level for the upper bound of both potential scale reduction factors. The standard value is 0.95.

division

Division criteria to make the batches. If division="Batch" the batches are partitions with size=batchsize of the iterations set. If division="Sequential" all the batches will have size=number of iterations/2, with the first batch starting at first iteration and the others at iteration 1+(number of iterations/2)/nbatches. Standard is division="Batch".

Details

The function output can be different from \insertCiteCZ;textualconvRJMCMC criteria in cases that at least one model is visited only for some chains as the degrees of freedom are automatically calculated by the manova function. We recommend not to use the original criteria from \insertCiteCZ;textualconvRJMCMC in the situation above and to use this function instead.

Value

An object of class CZ_MANOVA which saves a list for every batch with the V matrix, the Wc matrix, the Wm matrix, the WmWc matrix, MPSRF1, MPSRF2, the V matrix largest eigenvalue, the Wc matrix largest eigenvalue, the Wm matrix largest eigenvalue, and the WmWc matrix largest eigenvalue. For more details see \insertCiteCZ;textualconvRJMCMC article.

Author(s)

Tiago Pereira Marques and Miriam Harumi Tsunemi

References

\insertAllCited

Examples

#Example 1

set.seed(500)

chains<-c(rep(1,100000),rep(2,100000),rep(3,100000))
models<-factor(sample(c(1,2,3),300000,TRUE,c(0.25,0.5,0.25)))
mcmciterations<-rep(seq(1:100000),3)

{
theta1a<-rnorm(100000,mean=0,sd=1)
theta2a<-rnorm(100000,mean=1,sd=2)
theta3a<-rnorm(100000,mean=1,sd=3)
thetaa<-cbind(theta1a,theta2a,theta3a)

theta1b<-rnorm(100000,mean=0,sd=1)
theta2b<-rnorm(100000,mean=1,sd=2)
theta3b<-rnorm(100000,mean=1,sd=3)
thetab<-cbind(theta1b,theta2b,theta3b)

theta1c<-rnorm(100000,mean=0,sd=1)
theta2c<-rnorm(100000,mean=1,sd=2)
theta3c<-rnorm(100000,mean=1,sd=3)
thetac<-cbind(theta1c,theta2c,theta3c)

theta<-rbind(thetaa,thetab,thetac)
}

teste_2<-CZ_MANOVA(theta,chains,models,mcmciterations)

TPMarques/RJCA documentation built on Feb. 22, 2024, 8:05 p.m.