Download lab3

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Birthday problem wikipedia , lookup

Inductive probability wikipedia , lookup

Ars Conjectandi wikipedia , lookup

Probability interpretations wikipedia , lookup

Conditioning (probability) wikipedia , lookup

Transcript
Stat 401 Lab Activity 3
Part I. The Gamma distribution.
Reliability theory deals with models for probability distributions for life times, also called
times to failure, or survival times. Failure time data are often positively skewed. The
gamma family of distributions is one of the failure time distributions used in reliability
theory.
Failure-time distributions have their own terminology. If f(x), F(x) denote the pdf and cdf
of the time to failure, X, of some product, the probability P(X>t) is denoted by R(t) and
is called the reliability of the product at time t. Viewed as a function, it is called the
reliability function, or the survival function. Thus
R(t) = 1-F(t).
The failure rate, also called hazard function, is defined as
h(t)= f(t)/R(t).
The failure or hazard rate provides information regarding the conditional probability of
failure in the small interval (t, t+h) given that the product has not failed up to time t.
In particular,
P(t<X<t+h) is approximately equal to h(t)h.
We will use Minitab to plot the pdf, the reliability function, and the hazard function of the
gamma distribution.
The probability density function (pdf) is:
f ( x) 
a ( x   ) a 1exp[  ( x   )]
(a )
, x   , a  0,   0
where:
a = shape parameter (when a = 1, the gamma pdf is the same as the exponential pdf)
 = scale parameter,  = threshold parameter, and  =
function.
Mean = a 
1
+  , Variance = a 2


0
x a 1e  x dx is the gamma
Note Minitab uses b= 
parameter is 0.
1
for scale parameter. Also, the default value of the threshold
We will plot gamma pdfs through Minitab.
a) Generate data from 0 to 10 in steps of 0.01:
Calc>Make Patterned Data>Simple Set of Numbers> Store Patterned Data in “C1”;
From first value “0”; To last value “7”; In step of “0.01”, OK.
b) Find the value of the gamma density function, for a=2, and   0.5 (so b=2), for each
entry in C1:
Calc> Probability Distributions > Gamma> check “Probability Density”; enter “2”
and “2” for Shape parameter and Scale parameter; enter “C1” and “C2” for Input
column and Optional storage, OK.
c) Do a scatter plot (with Connect Line) of C1 as X and C2 as Y.
d) Repeat step b) using the cdf instead of the pdf. Store the cdf in C3, and repeat c) but
with C3 as Y.
e) Use the calculator option to compute the reliability function and store it in C4. Repeat
part c) but with C4 as Y.
f) Use the calculator option to compute the hazard function and store it in C5. Repeat
part c) but with C5 as Y.
Superimposing plots
Next we will superimpose the plot of the gamma pdf with a=2 and b=2, and the pdf a=2
and b=1.
d) Repeat step b), but change “2” to “1” for the Scale parameter, and enter “C3” for
Optional storage.
e) Graph> ScatterPlot > With Connected Line> input “C2” and “C1” under Y and
X in the first row, and input “C3” and “C1” under Y and X in the second row; Click
Multiple Graphs, select “Overlaid on the same graph”, OK, OK.
Part II. The Normal distribution.
1. Plotting the Normal Probability Density Function.
a) Generate data from -3.4 to 3.4 in steps of 0.01:
Calc>Make Patterned Data>Simple Set of Numbers> Store Patterned Data in
“C11”; From first value “-3.4”; To last value “3.4”; In step of “0.01”, OK.
b) Find the value of the probability density function of N(0,1) for each entry in C1:
Calc> Probability Distributions > Normal> check “Probability Density”; enter “0”
and “1” for Mean and Standard Deviation; enter “C11” and “C12” for Input
column and Optional storage, OK.
g) Do a scatter plot (with Connect Line) of C1 as X and C2 as Y.
Next we will superimpose the plot of the pdf of N(0,1/16) to that of the pdf of N(0,1).
Note: N(0,1/16) is the distribution of the sample mean of a sample of size n=16 from a
N(0,1) population.
d) Repeat step b), but change “1” to “0.25” for Standard Deviation, and enter “C13” for
Optional storage.
e) Graph> ScatterPlot > With Connected Line> input “C12” and “C11” under Y
and X in the first row, and input “C13” and “C11” under Y and X in the second
row; Click Multiple Graphs, select “Overlaid on the same graph”, OK, OK.
2. Finding Normal Probabilities and Population Percentiles
To find a percentile, such as the 95th of a normal distribution, first enter “0.95” in a
column, e.g. column c14, and follow the commands
Calc> Probability Distributions> Normal> Select “Inverse cumulative probability”;
fill “0 and 1” for Mean and Standard Deviation; select “C14” and “C15” for Input
column and Optional Storage, OK.
Several percentiles can be found at once, by entering, e.g.0.25, 0.5, 0.75, 0.950 in C14
and using the above sequence of commands.
To find the cumulative distribution use the above sequence of commands except for
selecting “Cumulative probability” instead of “Inverse cumulative probability”..
Part III. Probability Plots.
Probability plots plot sample percentiles vs population percentiles. They are used to
ascertain the extend to which observed data conform to an assumption about the
population distribution. A straight line at 45 degrees validates the distributional
assumption.
a) The normal probability plot is used to check the conformance of the data to the
assumption that the population distribution is normal.
Calc > Random data > Normal > Enter 50 in “Generate BLANK rows of data”,
enter c21 in “Store in column(s)”, enter 0 and 1 for Mean and StDev > OK
Now we will do the normal probability plot to confirm the normality assumption:
Graph> Probability Plots> Select “Single”> Enter C21 for Graph variable; click
Distribution> select “Normal” under distribution; 0 and 1 for Mean and StDev. OK,
OK.
b) Now generate 50 data points from the Gamma distribution with a=2 and b=2, and
apply the normal probability plot to these data.
c) Apply the gamma probability plot to the data in b).
Part IV. To be turned in together with your Homework #5.
a) In separate panels, plot the pdf, the reliability function and the hazard function of
the exponential distribution with mean 1.
b) Overlay the plots of the cdf for N(0,1), and N(0,1/16). Turn in the plot.
c) Overlay the plots of the pdf for N(0,1), and N(0,16) (so st.dev.=4). Turn in the
plot.
d) Overlay the plots of the pdf for gamma with a=2, b=1, and gamma with a=5, b=1.
Turn in the plot.
e) Generate 50 random data from the gamma distribution with a=2 and b=1. Apply
the normal probability plot to the data. Turn in the plot and comment.
f) Appy the gamma probability plot to the data in e). Turn in the plot and comment.
g) Repeat e) and f) with data generated from the gamma distribution with a=5 and
b=1. Turn in the plots with comments.