# Custom distribution [closed]

I am trying to define a custom distribution using the code below. Unfortunately, it did not produce a satisfactory result

f[x_] := ProbabilityDistribution[a*b*x^(b-1)*e^(-ax^b), {x, 0, ∞}, {a, 0, ∞}, {b, 0, ∞}]


## closed as unclear what you're asking by Simon Woods, m_goldberg, Yves Klett, Sjoerd C. de Vries, Michael E2Feb 1 '15 at 16:52

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Is e a constant you defined ? If not you should use E in case you are referring to the Euler's number. – Sektor Feb 1 '15 at 10:51
• Do you mean ax or a*x? – Yves Klett Feb 1 '15 at 12:35
• Hi arslan, welcome to Mathematica Stack Exchange. You've come to the right place for help but unfortunately you haven't supplied enough information for anyone to help you. The only clue about what you are trying to do is a line of code which doesn't do it! It's not even clear if you are trying to make a trivariate distribution or a univariate distribution in x with a and b as parameters. Please use the "edit" button underneath the question to add some details about your problem. – Simon Woods Feb 1 '15 at 14:10
• "it did not produce a satisfactory result" <-- Please explain in detail what you want to achieve, what you did, what you expected to happen, and what happened instead. There are several problems with the line of code you showed: 1. it makes no sense to substitute numerical values for x in this expression, so the f[x_]:=... definition is likely not what you want 2. ax is not the same thing as a x 3. the distribution is not normalized, so any operations on it will produce wrong results. – Szabolcs Feb 1 '15 at 15:15

ProbabilityDistribution defines a distribution. The constraints on the parameters are entered as Assumptions.

dist = ProbabilityDistribution[a*b*x^(b - 1) E^(-a*x^b), {x, 0, Infinity},
Assumptions -> {a > 0, b > 0}];

PDF[dist, x]


Piecewise[{{(abx^(-1 + b))/ E^(a*x^b), x > 0}}, 0]

dpa = DistributionParameterAssumptions[dist]


{a > 0, b > 0}

Assuming[dpa, Integrate[PDF[dist, x], {x, 0, Infinity}]]


1

Mean[dist]


Gamma[1/b]/(a^b^(-1)*b)

Assuming[dpa, Mean[dist] // FullSimplify]


Gamma[1 + 1/b]/a^b^(-1)

Assuming[dpa, StandardDeviation[dist] // Simplify]


Sqrt[-Gamma[1 + 1/b]^2 + Gamma[(2 + b)/b]]/a^b^(-1)

Assuming[dpa, Moment[dist, n] // Simplify]


Gamma[(b + n)/b]/a^(n/b)

EDIT:

Your distribution is a WeibullDistribution

PDF[dist, x] ==
PDF[WeibullDistribution[b, a^(-1/b)], x] //
Simplify[#, dpa] &


True