Anda di halaman 1dari 1

ML4bio Alan Moses and Quaid Morris

Assignment #0: Review of probability distributions using R statistics package

1. Download and install R on your computer.


2. The Geometric distribution and the Poisson distribution both depend on one parameter and are
defined on the natural numbers, 0,1,2,3 . In statistics jargon, a set of datapoints is called a
sample. Use R to generate a random sample of 50 datapoints from a Geometric distribution
with parameter 0.25 and a Poisson distribution with parameter 3. (Hint: type the commands
?Geometric() and ?Poisson() to get help on how to do this. Hint: In statistics jargon,
randomly drawn datapoints from a known distribution are sometimes called a random variates or
random deviates.)
3. Plot a histogram of each sample. (Hint: use the hist() and plot() functions)
4. Calculate the mean and variance of each sample. Which has greater variance? Which has greater
mean? (Hint: use the command help.start() and search for the R functions to compute
mean and variance)
5. Repeat steps 2 4 with a sample of 50000 datapoints. Do your answers to question 4 change?
Why or why not?
6. Below is a sample of 50 datapoints. Use R to help you decide if these follow a Poisson or a
Geometric distribution.

0 1 2 0 3 0 0 1 0 0

1 1 1 1 6 2 4 2 0 1

2 0 0 1 1 0 1 2 6 1

0 0 3 3 1 0 2 1 0 0

0 0 2 0 2 1 0 0 0 0

Anda mungkin juga menyukai