filmov
tv
An Introduction to the Geometric Distribution
Показать описание
An introduction to the geometric distribution. I discuss the underlying assumptions that result in a geometric distribution, the formula, and the mean and variance of the distribution. I work through an example of the calculations and then discuss the cumulative distribution function.
For those using R, here is the R code for the example in this video:
NB R uses a different definition of the random variable than I do here. I define the random variable X to be the number of trials required to get the first success. R defines the random variable to be the number of *failures* before getting the first success (let's call this Y). Then Y = X - 1, and we'll have to make this adjustment when using dgeom, pgeom, or rgeom. Some might find this confusing, and if you do, don't use these functions.
Sampling from a large population where 30% have CPR training until we get the first person with CPR training.
Finding the probability that it happens on the sixth person sampled:
(.3)*(.7)^5
[1] 0.050421
or
dgeom(6-1,.3)
[1] 0.050421
Finding the probability that it happens on or before the third person sampled:
.3+.3*.7+.3*.7^2
[1] 0.657
or
1-.7^3
[1] 0.657
or
pgeom(3-1,.3)
[1] 0.657
For those using R, here is the R code for the example in this video:
NB R uses a different definition of the random variable than I do here. I define the random variable X to be the number of trials required to get the first success. R defines the random variable to be the number of *failures* before getting the first success (let's call this Y). Then Y = X - 1, and we'll have to make this adjustment when using dgeom, pgeom, or rgeom. Some might find this confusing, and if you do, don't use these functions.
Sampling from a large population where 30% have CPR training until we get the first person with CPR training.
Finding the probability that it happens on the sixth person sampled:
(.3)*(.7)^5
[1] 0.050421
or
dgeom(6-1,.3)
[1] 0.050421
Finding the probability that it happens on or before the third person sampled:
.3+.3*.7+.3*.7^2
[1] 0.657
or
1-.7^3
[1] 0.657
or
pgeom(3-1,.3)
[1] 0.657
Комментарии