Continuous Probability Distributions
Read sections 3.1 to 3.3 of the S manual and use this to do the
following exercises.
Include answers to all
questions in your lab report.
- Create a vector p containing nineteen equally-spaced values
between 0 and 1.
Do not use the values of 0 or
1 themselves (i.e., start at .05 and end at .95).
- Find the pth quantile of the exponential distribution with scale
parameter
for each of the values in p. Save these
values in a vector yp. Note that you can use a single
command in S applied to the vector p which will
operate on each entry of p and create a vector of the same
length, rather than finding each pth quantile separately.
- Compute the density of the exponential distribution (note : rate
in the command, is the inverse of the scale parameter)
with scale parameter
for each
of the values in yp using the S function dexp.
Save these values in a vector fy.
- Evaluate the distribution function
using
each of the values in the vector yp. Save your answers in a
vector Fy.
- Make a scatter plot of fy versus yp. These points are
from what curve? (Remember to open grahpical window).
- Compare your vectors p and Fy. They should be the same.
Why?