plotPoisRule: Plot a Poisson decision rule

Description Usage Arguments Value Author(s) Examples

Description

Plot a Poisson decision rule

Usage

1
2
3
plotPoisRule(t, a1, b1, a2, b2, a = a1, b = b1, pi0 = 0.5, pi1 = 1
  - pi0, c1 = 1, c2 = 1, c = c1/c2, rule = pi1/pi0 * c2/c1,
  sizeby = c("none", "null", "alt"), geom = c("auto", "point", "tile"))

Arguments

t

the sample size

a1

alpha, the hyperparameter of the gamma distribution of the first poisson rate

b1

beta, the hyperparameter of the gamma distribution of the first poisson rate

a2

alpha, the hyperparameter of the gamma distribution of the second poisson rate

b2

beta, the hyperparameter of the gamma distribution of the second poisson rate

a

alpha, the hyperparameter of the gamma distribution under the null

b

beta, the hyperparameter of the gamma distribution under the null

pi0

the prior probability of the null hypothesis

pi1

the prior probability of the alternative hypothesis

c1

loss associated with type I error

c2

loss associated with type I error

c

relative loss constant (loss due to type II error divided by loss due to type I error)

rule

the decision rule for the Bayes factor B. by default, test rejects when B < pi1/pi0 * c2/c1

sizeby

size the outcomes by the probability under the null or alternative

geom

ggplot2 geom used

Value

a ggplot object

Author(s)

David Kahle david.kahle@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
 
plotGamma(c(1,1), c(1,1))
plotPoisRule(1, 1, 1, 1, 1)
plotPoisRule(2, 1, 1, 1, 1)
plotPoisRule(3, 1, 1, 1, 1)
plotPoisRule(4, 1, 1, 1, 1)
plotPoisRule(5, 1, 1, 1, 1)
plotPoisRule(10, 1, 1, 1, 1)
plotPoisRule(30, 1, 1, 1, 1)
plotPoisRule(100, 1, 1, 1, 1)


plotPoisRule(5, 1, 1, 1, 1, sizeby = "null")
plotPoisRule(5, 1, 1, 1, 1, sizeby = "alt") 

plotPoisRule(30, 3, 7, 7, 3, geom = "point")
plotPoisRule(100, 3, 7, 7, 3)

plotPoisRule(30, 3, 7, 7, 3, sizeby = "null") + theme_bw()
plotPoisRule(30, 3, 7, 7, 3, sizeby = "alt") + theme_bw()


## End(Not run)

dkahle/bayesRates documentation built on May 15, 2019, 9:07 a.m.