New in Wolfram
Mathematica
8: Probability and Statistics Solvers and Properties
◄
previous
|
next
►
Core Algorithms
Perform an Edgeworth Expansion to Approximate a Distribution
Use central moments of data to approximate a population distribution via an Edgeworth expansion.
In[1]:=
X
pdf = With[{len = 4}, PDF[NormalDistribution[], x] (1 + Sum[ 1/(2^(s/2 + r) s!) HermiteH[s + 2 r, x/Sqrt[2]] BellY[s, r, Table[Cumulant[k]/(k (k - 1)), {k, 3, s - r + 3}]], {s, 1, len - 2}, {r, 1, s}])];
In[2]:=
X
data = Standardize[Total[RandomReal[1, {3, 10^5}]]]; dist = ProbabilityDistribution[ MomentEvaluate[pdf, data], {x, -\[Infinity], \[Infinity]}];
In[3]:=
X
Show[Histogram[data, Automatic, "ProbabilityDensity", ChartStyle -> Directive[EdgeForm[Gray], Hue[.15, .3, .9]]], Plot[{PDF[dist, z], PDF[NormalDistribution[], z]}, {z, -3, 3}, PlotStyle -> {Directive[Thick, Hue[.6, 1, .6]], Directive[Thick, Dashed, Red]}], ImageSize -> 500]
Out[3]=