Skip to contents

The centered forms e^(-x^2/n)/sqrt(pi n) (2n fair flips), e^(-2x^2/n)/sqrt(pi n/2) (n fair flips), e^(-x^2/(2npq))/sqrt(2 pi npq) (biased), and e^(-(k-a)^2/(2a))/sqrt(2 pi a) (Poisson). Mirrors morie.fn ch5.

Usage

morie_gaussian_approx(
  x,
  n = NULL,
  p = NULL,
  a = NULL,
  form = c("two_n", "n", "biased", "poisson")
)

Arguments

x

deviation from the center.

n

flip count (interpretation set by form).

p

success probability for the biased form.

a

Poisson mean for the Poisson form.

form

one of "two_n", "n", "biased", "poisson".

Value

the Gaussian density value.

References

Morin (2016), eqs. (5.13)-(5.15), (5.23).

Examples

morie_gaussian_approx(0, n = 50, form = "two_n")
#> [1] 0.07978846