Description Usage Arguments Details Value Examples
View source: R/AproxBinomPois.R
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).
1 2 3 | AproxBinomPois(n, p, xlab = "x", ylab = "Probability Mass",
main = "Poisson approximation to Binomial distribution", col1 = "grey",
col2 = "red")
|
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". |
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.
This function is called for the side effect of drawing the plot.
1 2 3 4 | n=50;p=0.93
AproxBinomPois(n,p)
n=100;p=0.03
AproxBinomPois(n,p)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.