BayesMultMeta: Interface for the BayesMultMeta class

View source: R/BayesMultMeta.R

BayesMultMetaR Documentation

Interface for the BayesMultMeta class

Description

The BayesMultMeta package implements two methods of constructing Markov chains to assess the posterior distribution of the model parameters, namely the overall mean vector \mathbf{μ} and the between-study covariance matrix \mathbf{Ψ}, of the generalized marginal multivariate random effects models. The Bayesian inference procedures are performed when the model parameters are endowed with the Berger and Bernardo reference prior \insertCiteberger1992developmentBayesMultMeta and the Jeffreys prior \insertCite1946RSPSA.186..453JBayesMultMeta. This is achieved by constructing Markov chains using the Metropolis-Hastings algorithms developed in \insertCitebodnar2021objectiveBayesMultMeta. The convergence properties of the generated Markov chains are investigated by the rank plots and the split-\hat{R} estimate based on the rank normalization, which are proposed in \insertCitevehtari2021rankBayesMultMeta.

Usage

BayesMultMeta(X, U, N, burn_in, likelihood, prior, algorithm_version, d = NULL)

Arguments

X

A p \times n matrix which contains n observation vectors of dimension p

U

A pn \times pn block-diagonal matrix which contains the covariance matrices of observation vectors.

N

Length of the generated Markov chain.

burn_in

Number of burn-in samples

likelihood

Likelihood to use. It currently supports "normal" and "t".

prior

Prior to use. It currently supports "reference" and "jeffrey".

algorithm_version

One of "mu" or "Psi". Both algorithms samples the same quantities.

d

Degrees of freedom for the t-distribution when the "t" option is used for the likelihood.

Value

a BayesMultMeta class which contains simulations from the MCMC inference procedure as well as many of the input parameters. The elements 'psi' and 'mu' in the list contains simulations from the posterior distribution. All other elements are input parameters to the class.

References

\insertAllCited

Examples

dataREM<-mvmeta::hyp
# Observation matrix X
X<-t(cbind(dataREM$sbp,dataREM$dbp))
p<-nrow(X)  # model dimension
n<-ncol(X)  # sample size
# Matrix U
U<-matrix(0,n*p,n*p)
for (i_n in 1:n) {
  Use<-diag(c(dataREM$sbp_se[i_n],dataREM$dbp_se[i_n]))
  Corr_mat<-matrix(c(1,dataREM$rho[i_n],dataREM$rho[i_n],1),p,p)
  U[(p*(i_n-1)+1):(p*i_n),(p*(i_n-1)+1):(p*i_n)]<- Use%*%Corr_mat%*%Use
}

bmgmr_run <- BayesMultMeta(X, U, 1e2, burn_in = 100,
                   likelihood = "normal", prior="jeffrey",
                   algorithm_version = "mu")
summary(bmgmr_run)
plot(bmgmr_run)


BayesMultMeta documentation built on June 9, 2022, 9:06 a.m.