New in Wolfram
Mathematica
8: Nonparametric, Derived, and Formula Distributions
◄
previous
|
next
►
Core Algorithms
Study the Properties of a Custom Probability Distribution
Define a
ProbabilityDistribution
by specifying its PDF and study the properties of the distribution.
In[1]:=
X
\[ScriptCapitalD] = ProbabilityDistribution[ 1/5/E^((1/5)*Abs[2*x - 3]), {x, -Infinity, Infinity}]; properties = {{HoldForm[ PDF[\[ScriptCapitalD], x]], PDF[\[ScriptCapitalD], x]}, {HoldForm[ "Plot the PDF of \[ScriptCapitalD] "], Plot[PDF[\[ScriptCapitalD], x], {x, -8, 11}, Filling -> Axis, PlotStyle -> Black, FillingStyle -> Lighter[Orange, 0.4]]}, {HoldForm[ Integrate[PDF[\[ScriptCapitalD], x], {x, -Infinity, Infinity}]], Integrate[ PDF[\[ScriptCapitalD], x], {x, -Infinity, Infinity}]}, {HoldForm[ Mean[\[ScriptCapitalD]]], Mean[\[ScriptCapitalD]]}, {HoldForm[Variance[\[ScriptCapitalD]]], Variance[\[ScriptCapitalD]]}, {HoldForm[ Skewness[\[ScriptCapitalD]]], Skewness[\[ScriptCapitalD]]}, {HoldForm[ Kurtosis[\[ScriptCapitalD]]], Kurtosis[\[ScriptCapitalD]]}, {HoldForm[ Moment[\[ScriptCapitalD], 4]], Moment[\[ScriptCapitalD], 4]}, {HoldForm[ MomentGeneratingFunction[\[ScriptCapitalD], t]], MomentGeneratingFunction[\[ScriptCapitalD], t]}};
In[2]:=
X
Labeled[TraditionalForm@ Grid[properties, Dividers -> All, Spacings -> {{2, 2}, 5}, Alignment -> {{Left, Left}, Baseline}, BaseStyle -> {FontFamily -> "Verdana"}, Background -> {None, {{Lighter[Blend[{Blue, Green, Blue}], 0.7], GrayLevel[.9]}}}, FrameStyle -> Directive[Thick, White]], Style[Row[{" \[ScriptCapitalD] = ", Text[" "], TraditionalForm[ProbabilityDistribution[ 1/5/E^((1/5)*Abs[2*x - 3]), {x, -Infinity, Infinity}]], " "}, Frame -> True, RoundingRadius -> 3, Background -> Lighter[Blend[{Blue, Green, Blue}], 0.5]], FontSize -> 14, FontWeight -> Bold, FontFamily -> "Verdana"], Top]
Out[2]=