1
$\begingroup$

I am a new member of this community and I try to learn Mathematica Software.

At moment I try to find the parameter of a Weibull distribution, but I cannot solve the problem.

This is the code and the data:

data = {2, 4, 3, 1, 2, 0, 3, 3, 0, 2, 0, 4, 2, 1, 1, 1, 2, 0, 5, 2, 3,
       0, 2, 2, 1, 0, 1, 3, 2, 0, 3, 3, 3, 1, 1, 2, 2, 0, 1, 2, 0, 2, 2, 
      0, 0, 4, 0, 4, 2, 2, 0, 0, 1, 1, 2, 1, 3, 2, 1, 0, 0, 1, 0, 2, 0, 4,
       2, 1, 2, 2, 1, 1, 1, 0, 0, 1, 1, 2, 1, 1, 2, 2, 1, 3, 1, 0, 4, 2, 
      3, 3, 1, 1, 2, 4, 4, 2, 0, 1, 1, 0, 2, 3, 2, 0, 2, 1, 1, 2, 2, 1, 5,
       1, 1, 1, 3, 1, 0, 3, 0, 1, 3, 1, 2, 3, 0, 0, 3, 2, 3, 1, 2, 0, 2, 
      1, 3, 0, 3, 4, 1, 3, 3, 2, 0, 2, 1, 2, 3, 0, 1, 2, 1, 1, 0, 0, 2, 0,
       1, 2, 1, 1, 2, 1, 0, 2, 3, 3, 5, 0, 0, 2, 2, 3, 4, 3, 1, 3, 0, 1, 
      1, 2, 1, 0, 3, 1, 1, 0, 1, 0, 3, 4, 2, 2, 3, 0, 4, 0, 2, 0, 1, 1, 2,
       1, 2, 2, 0, 1, 1, 3, 0, 1, 4, 3, 1, 3, 0, 1, 2, 1, 1, 2, 0, 1, 0, 
      1, 0, 1, 2, 4, 0, 0, 2, 3, 0, 0, 2, 1, 3, 1, 5, 1, 4, 1, 1, 0, 1, 2,
       5, 4, 1, 1, 2, 0, 2, 1, 1, 1, 1, 1, 0, 2, 3, 1, 3, 0, 0, 1, 0, 0, 
      3, 1, 2, 0, 4, 1, 7, 3, 0, 1, 0, 3, 1, 2, 3, 4, 0, 0, 2, 3, 0, 4, 2,
       1, 1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 2, 0, 2, 2, 0, 4, 2, 3, 4, 1, 2, 
      2, 3, 0, 0, 1, 2, 1, 3, 5, 1, 4, 6, 1, 1, 2, 2, 1, 2, 1, 4, 1, 1, 1,
       1, 0, 2, 1, 1, 3, 1, 3, 1, 7, 1, 0, 2, 1}
    Histogram[data, {-0.5, 10.5, 1}]
    FindDistributionParameters[data, WeibullDistribution[a, b]]

You can see from the Histogram that the distribution is a Weibull, but when I run an error occurs:

FindDistributionParameters::ntsprt: "One or more data points are not in support of the distribution WeibullDistribution[a,b]."

How can I solve it?

Thank you very much for your answer.

$\endgroup$
  • 3
    $\begingroup$ With all integer values you can't possibly have a Weibull distribution. Maybe a Poisson distribution? (As the mean and variance of the sample data are nearly equal and you have all integer values.) $\endgroup$ – JimB May 13 '17 at 5:19
1
$\begingroup$

You must have meant "Poisson" rather than "Weibull" as all of your data consists of small non-negative integers. (If you've rounded all of the data to integers, then you should make that explicit.)

To fit a Poisson distribution try

FindDistributionParameters[data, PoissonDistribution[λ]]
(* {λ -> 1.6085714285714285`} *)

You could also estimate λ with

Mean[data]
(* 1.6085714285714285 *)

To perform a test to see if there is any evidence against the data being from a Poisson try

PearsonChiSquareTest[data, PoissonDistribution[λ]]
(* 0.6877269523538061 *)

The PearsonChiSquareTest gives a P-value much larger than 0.05. The appropriate interpretation is that there is no evidence that the data is not distributed as a Poisson (as opposed to saying that the data comes from a Poisson distribution).

$\endgroup$
  • $\begingroup$ Thank you very much for your answer, I solved the problem! $\endgroup$ – D. Ercole Jun 7 '17 at 20:45

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.