Hi! I am Mike Marin and in this video we'll talk about calculating probabilities for
a poisson random variable
using R. Throughout this video
we will focus on a random variable known to follow a poisson distribution
with a known rate of lambda equals 7.
We can calculate probabilities
for the poisson using the "ppois"
or "dpois" command. You can access the Help menu for these
by typing "help" and in the brackets entering the name of the command you
would like help for,
or by simply throwing a question mark (?) in front of the command name.
The "dpois" command
can be used to find values for the probability density function of X.
Suppose we would like to find the probability
that X is exactly equal to 4. To calculate this
we can use the "dpois" command. Here we would like to find the probability
of exactly 4 occurrences for a
poisson random variable with a rate lambda equal to 7;
We can see there is approximately
9.1 percent chance of exactly 4 occurrences.
We can also have R return
multiple probabilities to us.
Suppose we would like to have returned to us the probability of exactly 0 occurrences,
and exactly 1 occurrence,
and all the way
up to exactly
4 occurrences. To do so
we can again use the "dpois" command to have
probability densities returned to us, and here we would like probabilities
for X equals 0 all the way up to X equals 4.
We can now see the probability
of exactly 0,1, 2, 3 and 4 occurrences.
We may also like to find the probability that
X is less than or equal to 4. This can be found in a few ways:
the first would be to sum up all of those probabilities that we just calculated.
We can do this by hand or
we can make use of the "sum" command in R to sum up all of these probabilities.
Another way that we can calculate the probability
that X is less than or equal to 4 is by using the probability distribution function
for the poisson. To do so we can use the "ppois" command
to get probabilities
associated with the probability distribution function or big F.
Here we would like the probability associated with the value of 4,
our variable has a rate of 7,
and we would like to set the lower tail
equal to TRUE asking for a lower tail probability or
less than equal to four.
If we want to find the
probability that X is greater or equal to
say 12, we can do this again using the
"ppois" command. Here we would like the probability
associated with the value of X equals 12
and we will set the lower tail equal to FALSE
which will mean an upper tail probability or greater or equal to 12.
The "rpois" command can be used to take a random sample
from a poisson distribution and the
"qpois" command can be used to find quantiles
for the poisson distribution. Check out my video on the normal distribution
for some insight on how to use these commands.
Thanks for watching this video and make sure to check out my other instructional videos.