# On plotting the Weibull distribution

First: How can I plot the Weibull distribution with parameters a = 2 and b = 3.5 on the range of x = {0, 20}?

Second: for the following 20 observations, I want a histogram with a plot of the Weibull distribution a = 2.29 and b = 2.95 and exponential distribution a = 1.95, all in the same plot.

The observation data:

{0.4, 0.7, 0.4, 0.8, 0.7, 0.7, 0.3, 0.1, 0.2, 0.3, 0.1, 0.7, 0.4, 0.7, 0.4, 0.5, 0.5, 0.5,
0.5, 0.5, 0.5, 0.3, 0.9, 0.4, 0.4, 0.4, 0.4, 0.7, 0.1, 0.7, 0.7, 0.7, 0.7, 0.5, 0.7, 0.7,
0.4, 0.7, 0.5, 0.3, 0.9}

Plot[PDF[WeibullDistribution[2, 3.5], x], {x, 0, 20}]

data = {0.4, 0.7, 0.4, 0.8, 0.7, 0.7, 0.3, 0.1, 0.2, 0.3, 0.1, 0.7, 0.4, 0.7,
0.4, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.3, 0.9, 0.4, 0.4, 0.4, 0.4, 0.7, 0.1,
0.7, 0.7, 0.7, 0.7, 0.5, 0.7, 0.7, 0.4, 0.7, 0.5, 0.3, 0.9};

Show[
Histogram[data, Automatic, "PDF"],
Plot[Tooltip[PDF[#, x], #],
{x, 0, 1}] & /@
{WeibullDistribution[2.29, 2.95],
ExponentialDistribution[1.95]}]

wd = EstimatedDistribution[data, WeibullDistribution[a, b]]

WeibullDistribution[2.70657, 0.574639]

ed = EstimatedDistribution[data, ExponentialDistribution[a]]

ExponentialDistribution[1.95238]

Show[
Histogram[data, Automatic, "PDF"],
Plot[Tooltip[PDF[#, x], #], {x, 0, 1}] & /@
{wd, ed}]

• thanks @Bob..can we use manipulate with the last graph (i mean Histogram + distribution curve + Manipulate] All in one graph, manipulate {a,o,3} ???
– Momo
Oct 14, 2014 at 2:32
• You could put this into a Manipulate; however, it would not return any better results than the EstimatedDistribution. Oct 14, 2014 at 2:54