Learn R Programming

repfdr (version 1.0)

piem: Estimation of the prior probabilities for each association status vector.

Description

The function calls an expectation-maximization (EM) algorithm to estimate the prior probabilities of each association status vector. It is also used internally in repfdr.

Usage

piem(pdf.binned.z, binned.z.mat, control = em.control())

Arguments

pdf.binned.z
Same input as in repfdr. A 3-dimensional array which contains for each study (first dimension), the probabilities of a z-score to fall in the bin (second dimension), under each hypothesis status (third dim
binned.z.mat
Same input as in repfdr. A matrix of the bin numbers for each the z-scores (rows) in each study (columns). Element [[2]] in the output of ztobins
control
List of control parameters to pass to the EM algorithm. See em.control.

Value

  • all.iterationsMatrix with number of columns equal to the number of EM iterations, and each column is the estimated probability distribution of the vector of association status.
  • last.iterationMatrix of the vectors of association status along with the column vector of the last EM iteration, which contains the estimated probabilities of the vectors of association status.

Details

The implementation of the EM algorithm is in C, and allows paralel processing. By default, the software automatically detects the number of available processing threads. See em.control for the option of providing the number of threads to use, as well as for the additional control parameters.

References

Heller, Ruth, and Daniel Yekutieli. "Replicability analysis for Genome-wide Association studies." arXiv preprint arXiv:1209.2829 (2012).

See Also

repfdr

Examples

Run this code
data(zmat)
input.to.piem <- ztobins(zmat, 3, plot = TRUE)
pbz    <- input.to.piem$pdf.binned.z
bz     <- input.to.piem$binned.z.mat

output <- piem(pbz, bz, control = em.control(verbose = TRUE,nr.threads = 2))
# converge after 209 iterations.
# iterations are printed
# Set nr.threads = 0 to optimal use of threads.

Pi <- output$last.iteration

Run the code above in your browser using DataLab