saddlepoint: Saddlepoint Approximation

Description Usage Arguments Examples

Description

Let X_1,X_2,… X_N be independent Bernouilli trials with X_i \sim p_i. We evaluate the probability

P(s_1X_1+s_2X_2… s_NX_N > t)

.

Usage

1
saddlepoint(t, dat, lattice = 1L, log = T)

Arguments

t

Point where tail probability is evaluated (note this function is not vectorized over t)

dat

A data.table with columns 'x', 'y', and 'probabilities'. Column 'x' is a numeric indicator unique for each random variable to be convoluted together. Column 'y' is the outcome value, and colum 'probabilities' contains the probability corresponding to each value of the 'y' column.

lattice

Lattice size in minimal lattice

log

Return log probability

Examples

1
2
3
4
saddlepoint(51, dat = data.table(x = rep(1:10000, each = 2),
                                 y = rep(c(1,0),10000),
                                 probability = rep(c(0.01,0.99), 100)))
pbinom(299, 10000, 0.01, lower.tail = F, log.p = T)

TobiasMadsen/ncdDetect2 documentation built on May 14, 2019, 11:11 a.m.