The problem is I can not get estimation of parameters of any custom probability distribution (distributions are not built in Mathematica), here is an example:

First: I entered random numbers of custom distribution (I entered the PDF of Weibull distribution) and I want its parameters to be estimated then I have an infinite loop somewhere, and the program runs for hours on a relatively fast machine, without producing anything..the steps on Mathematica are:

custom[a_, b_] := ProbabilityDistribution[(a/b) ((x/b)^(a - 1)) E^-(x/b)^a, {x, 0, \[Infinity]}]
PDF[custom[a, b]]
W = RandomVariate[custom[2, 3], 50]
FindDistributionParameters[W, custom[a, b]]

Second: I entered the same steps but I replace final step with FindDistributionParameters[W, WeibullDistribution[a, b]]. I got the answer in one second

{a -> 1.99144, b -> 2.6355}

The problem is if the custom distribution is not built in Mathematica what will be happened to estimate its parameters???

  • 1
    $\begingroup$ Welcome! Please take some time to format your question in the future (@rhermans helped you out here already). See: mathematica.stackexchange.com/editing-help. $\endgroup$ – Yves Klett Oct 6 '14 at 14:43
  • 1
    $\begingroup$ On second thoughts: How does this question differ from your first one: How to estimate parameters of a custom distribution?? $\endgroup$ – Yves Klett Oct 6 '14 at 14:49
  • $\begingroup$ Dear Yves Keltt the main idea not on mathimatical properties as it was commented before..the main idea on Mathematica coding language..i illustrate my point on this example. $\endgroup$ – Momo Oct 7 '14 at 6:51
  • $\begingroup$ Dear Momo, I am not entirely sure about the difference between the questions. Hopefully the answer here can help you, otherwise please edit the original one to reflect the differences. $\endgroup$ – Yves Klett Oct 7 '14 at 9:24

When defining the custom distribution, include the parameter assumptions required for the custom distribution to be a valid distribution.

custom[a_, b_] = ProbabilityDistribution[
   (a/b) ((x/b)^(a - 1)) E^-(x/b)^a, {x, 0, Infinity},
   Assumptions -> a > 0 && b > 0];

DistributionParameterAssumptions[custom[a, b]]

a > 0 && b > 0

W = RandomVariate[custom[2, 3], 50];

FindDistributionParameters[W, custom[a, b]]

{a -> 2.11554, b -> 3.11318}

FindDistributionParameters[W, WeibullDistribution[a, b]]

{a -> 2.11554, b -> 3.11318}

As expected, the parameters are identical since

PDF[custom[a, b], x] == PDF[WeibullDistribution[a, b], x]


  • $\begingroup$ it works goo Thanks alot $\endgroup$ – Momo Oct 8 '14 at 7:44

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.