BayesMultMeta {BayesMultMeta} | R 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{\mu}`

and the between-study covariance matrix
`\mathbf{\Psi}`

, 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
(Berger and Bernardo 1992) and the Jeffreys prior
(Jeffreys 1946). This is achieved by
constructing Markov chains using the Metropolis-Hastings algorithms developed
in (Bodnar and Bodnar 2021). 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 (Vehtari et al. 2021).

### Usage

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

### Arguments

`X` |
A |

`U` |
A |

`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

Berger JO, Bernardo JM (1992).
“On the development of the reference prior method.”
*Bayesian statistics*, **4**(4), 35–60.

Bodnar O, Bodnar T (2021).
“Objective Bayesian meta-analysis based on generalized multivariate random effects model.”
2104.02105.

Jeffreys H (1946).
“An invariant form for the prior probability in estimation problems.”
*Proceedings of the Royal Society of London Series A*, **186**(1007), 453-461.
doi: 10.1098/rspa.1946.0056.

Vehtari A, Gelman A, Simpson D, Carpenter B, BÃ¼rkner P (2021).
“Rank-normalization, folding, and localization: An improved hatR for assessing convergence of MCMC (with Discussion).”
*Bayesian analysis*, **16**(2), 667–718.

### 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*version 0.1.1 Index]