Title: Asymmetric distributions
1LECTURE 8
- Asymmetric distributions
- Lognormal, exponential, Weibull
- Fitting the above densities to data
- Probability computations from densities
- Reducing to a standard density computation
- Normal distribution computations
- Log-normal distribution computations
- Using S-PLUS functions such as
- pnorm,plogis,pexp,
2pdf for log-normal data X
Not quite the same form as a normal density!
3Log-normal distribution
Useful for data that takes on only positive
values, and for which the log transformation
produces approximately normally distributed data
xlnorm rlnorm(200, 2, 1) log-normal data
for histogram
4pdf for Y ln(X)
A normal distribution pdf
NOTE The above result requires a mathematical
proof that is beyond the scope of our present
emphasis.
THE NICE THING If you have data
that has a log-normal
distribution, then the transformed data
has a normal distribution
with parameters . So fit a normal
density to the
5First make the log transform, and fit the normal
density
- gt log.xlnorm log(xlnorm)
- gt mu mean(log.xlnorm)
- gt sd stdev(log.xlnorm)
- gt hist(log.xlnorm,
- probability T, col 0)
- gt x seq(-1, 5, 0.1)
- gt lines(x, dnorm(x, mu, sd))
- gt mu
- 1 2.037
- gt sd
- 1 1.012
- gt title(main "HISTOGRAM
6Then fit the log-normal density
hist(xlnorm,probabilityT,col0,xlimc(0,120),ylim
c(0,.09)) mumean(log.xlnorm) sdstdev(log.xlnorm
) xseq(0,120,.1) lines(x,dlnorm(x,mu,sd))
7The Weibull distribution
- A generalization of the exponential distribution
that is particularly useful in reliability
modeling applications - Show and discuss material on pages 44-45 of
Devore and Farnum - Fitting a Weibull density to data
- Requires more tools than we currently have at our
fingertips. - But we can easily fit an exponential density.
See next slide(s)
8Fitting an exponential density to data
From Lecture 7 (see handout, page 7.4), we know
that the p-quantile x(p) for an exponential
density is given by the expression
Textbook notation
For p .5 we have the expression for the median
of the density
Given you can compute
, OR Given
you can compute
!
9Now it is easy to do the fit
We see that
So just compute the sample median
and Substitute it in place of the median of
the density
to get
10Computing Probs. from Densities A Key
Location and scale family of densities
Change of variable
Standard form of density
Thats all there is to the tricky part of it!
11You also use
Draw sketches
12Normal density calculations andS-PLUS functions
- Go over some normal density calculations
- Section 1.4 Devore and Farnum
- Can use Table 1 or S-PLUS function pnorm
- Highly recommend reading pp, 55-63, S-PLUS 6
Guide to Statistics, Vol. 1 (on-line) - Use of pnorm, qnorm, dnorm, rnorm, and similarly
for other distributions.