calculate_EPSR_gamma: Calculate the estimated potential scale reduction factors...

Description Usage Arguments Value Author(s) Examples

Description

When Gibbs sampler attains stationary, the distances between multiple chains (with multiple initial values) should be small. The EPSR factors are calculated to help decide the iteration number of Gibbs sampler.

Usage

1
calculate_EPSR_gamma(gamma_PosterSamp_chain1, gamma_PosterSamp_chain2)

Arguments

gamma_PosterSamp_chain1

posterior samples of location batch effects from chain 1.

gamma_PosterSamp_chain2

posterior samples of location batch effects from chain 2.

Value

EPSR_gamma

The EPSR factors for gamma, a G by B matrix. Note that EPSR_gamma[,1] is a NA vector. gamma[,1] are fixed at zero, so their EPSR factors are not taken into account.

Author(s)

Xiangyu Luo

Examples

1
2
3
4
#2 batches, 10 genes, 100 posterior samples per parameter
chain1 <- 1+array(rnorm(10*2*100,sd=0.05), dim=c(2,10,100))
chain2 <- 1+array(rnorm(10*2*100,sd=0.05), dim=c(2,10,100))
calculate_EPSR_gamma(chain1,chain2)

XiangyuLuo/BUScorrect documentation built on June 14, 2019, 3:31 p.m.