View source: R/BayesMultMeta.R
| split_rank_hatR | R Documentation |
The function computes the split-\hat{R} estimate based on the rank normalization.
split_rank_hatR(MC)
MC |
An N \times M matrix with N draws in each of M constructed Markov chains. |
a value with the the split-\hat{R} estimate based on the rank normalization
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
}
# Generating M Markov chains for mu_1
M<-4 # number of chains
MC <-NULL
for (i in 1:M) {
chain <- BayesMultMeta(X, U, 1e2, burn_in = 1e2,
likelihood = "t", prior="jeffrey",
algorithm_version = "mu",d=3)
MC<- cbind(MC,chain$mu[1,])
}
split_rank_hatR(MC)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.