AproxBinomPois: Illustration of the Poisson approximation to Binomial

Description Usage Arguments Details Value Examples

View source: R/AproxBinomPois.R

Description

AproxBinomPois represents the probability mass associated with a Binomial distribution with certain parameters n and p joint with the Poisson distribution with mean equal to np. Note that the Binomial distribution can be approximated by a Poisson distribution when certain conditions are met (see Details).

Usage

1
2
3
AproxBinomPois(n, p, xlab = "x", ylab = "Probability Mass",
  main = "Poisson approximation to Binomial distribution", col1 = "grey",
  col2 = "red")

Arguments

n

number of independent Bernoulli trials.

p

probability of success associated with the Bernoulli trial.

xlab

x-axis label; default to "x".

ylab

y-axis label; default to "Probability Mass".

main

an overall title for the plot; default to "Poisson approximation to Binomial distribution".

col1

a single colour associated with the Binomial probability mass function; default to "grey".

col2

a single colour associated with the Poisson probability mass function; default to "red".

Details

The approximation is accurate only if one of these conditions is met:

- p in (0,0.1), n>=30 and np<5,

- p in (0.9,1), n>=30 and n(1-p)<5. Note that given X1 a Binomial distribution with parameters n and p, and X2 a Binomial distribution with parameters n and 1-p, it follows that P(X1=a)=P(X2=n-a). Then, the variable X2 can be approximated to a Poisson distribution with parameter lambda=n(1-p) and this Poisson distribution can be used in order to approximate the mass probability function associated with X1.

Value

This function is called for the side effect of drawing the plot.

Examples

1
2
3
4
n=50;p=0.93
AproxBinomPois(n,p)
n=100;p=0.03
AproxBinomPois(n,p)

LearningStats documentation built on April 21, 2021, 9:06 a.m.