prior.betabinomial: prior.betabinomial

Description Usage Arguments Details Value Author(s) Examples

Description

Beta Binomial prior for number of SNPs in a model

Usage

1
2
3
  prior.betabinomial(x = 1:n, n = length(groups), expected,
    overdispersion = 1, groups = NULL, pi0 = 0.2,
    value = c("odds", "prob"))

Arguments

x

number of SNPs in a model (defaults to 1:length(groups), ie returns a vector)

n

total number of SNPs or SNP groups available

expected

expected number of SNPs in a model

overdispersion

overdispersion parameter. Setting this to 1 gives a binomial prior. Values < 1 are nonsensical: if you really believe the prior should be underdispersed relative to a binomial distribution, consider using a hypergeometric prior.

groups

groups of SNPs, from which at most one SNP should be selected

pi0

prior probability that no SNP is associated

value

"odds" or "prob" for prior odds (relative to pi0) or prior probabilities

Details

A binomial prior for the number of SNPs in a model may be considered too peaked if there is relatively little prior information about the number of causal SNPs, and, particularly if the posterior model choice is sensitive to this prior, it can be useful to consider a prior with greater spread. One such choice is the beta binomial model, implemented here, under which the number of SNPs follows a binomial distribution with parameters n, p while p follows a beta distribution with parameters chosen so that the mean and the overdispersion (relative to a binomial distribution) of the number of SNPs is as specified by expected and overdispersion, respectively.

Value

prior probability/ies as a numeric vector

Author(s)

Chris Wallace

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
n<-100 # 100 SNPs in region
x <- 1:10 # consider prior for up to 10 causal SNPs
xbar <- 3 # expect around 3 causal

## a binomial prior
y <- prior.binomial(x, n, xbar)
plot(x, y, type="h")

## is equivalent to
y1.0 <- prior.betabinomial(x, n, xbar, overdispersion=1.0)
points(x, y1.0, col="red")

##larger values of overdispersion change the distribution:
y1.1 <- prior.betabinomial(x, n, xbar, overdispersion=1.1)
y1.5 <- prior.betabinomial(x, n, xbar, overdispersion=1.5)
y2.0 <- prior.betabinomial(x, n, xbar, overdispersion=2.0)
points(x, y1.1, col="orange")
points(x, y1.5, col="pink")
points(x, y2.0, col="green")

chr1swallace/snpBMA documentation built on May 13, 2019, 6:19 p.m.