0
$\begingroup$

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}
$\endgroup$
6
$\begingroup$
Plot[PDF[WeibullDistribution[2, 3.5], x], {x, 0, 20}]

enter image description here

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]}]

enter image description here

However, your specified distributions are not the best fit to the data. Use EstimatedDistribution to get the best fit.

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}]

enter image description here

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.