credsetC {corrcoverage}R Documentation

Credible set of variants from matrix of PPs

Description

Quick credset function for matrix of posterior probabilities (using RCpp)

Usage

credsetC(pp, CV, thr)

Arguments

pp

Matrix of posterior probabilities of causality (one row per system)

CV

Vector of CV indices (one per system/row)

thr

Minimum threshold for credible set size

Value

Data.frame of claimed coverage (sum of posterior probabilities of variants in the set), binary covered indicator and number of variants (nvar).

Examples


set.seed(1)
nsnps <- 100

# simulate matrix of posterior probabilities
# 1 simulation per row

pp <- matrix(rnorm(nsnps*100, 0.3, 0.05), ncol = nsnps)
pp <- pp/rowSums(pp)

iCV <- rep(71, times = dim(pp)[1])

credsetC(pp, CV = iCV, thr = 0.9)


[Package corrcoverage version 1.2.1 Index]