Example: Gamma Distribution Functions
1. Use the
dgamma function to calculate the probability density for vector
x and shape parameter
s:
2. Use the
pgamma function to calculate the cumulative probability distribution for vector
x and shape parameter
s:
3. Use the
qgamma function to calculate the inverse cumulative probability distribution for vector
x/100 and shape parameter
s:
The first argument of function qgamma is the probability and must be less than 1, hence the division of x by 100.
4. Use the
rgamma function to create a vector of
m random numbers having the gamma distribution and shape parameter
s:
| Recalculating the worksheet causes function rgamma to return a new set of random numbers. |