credsetC: Credible set of variants from matrix of PPs

Description Usage Arguments Value Examples

View source: R/extra_functions.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)

corrcoverage documentation built on Dec. 7, 2019, 1:07 a.m.