New in Wolfram
Mathematica
8: Probability and Statistics Solvers and Properties
◄
previous

next
►
Core Algorithms
Demonstrate the GlivenkoCantelli Theorem
Demonstrate that the empirical distribution tends to the theoretical distribution as sample size increases by comparing empirical and theoretical CDFs.
In[1]:=
X
data = RandomVariate[FrechetDistribution[2, 3, .5], 2500]; lens = {10, 25, 50, 100, 250, 500, 1000, 2500}; edists = Table[EmpiricalDistribution[Take[data, k]], {k, lens}]; limitplot = Plot[CDF[FrechetDistribution[2, 3, .5], x], {x, 0, 20}];
In[2]:=
X
GraphicsGrid[ Partition[ Table[Show[ Plot[CDF[edists[[i]], x], {x, 0, 20}, PlotStyle > Directive[ColorData[1, 2], Thick], PlotRange > {0, 1}, PlotLabel > Style[StringJoin["n = ", ToString[lens[[i]]]]]], limitplot], {i, 8}], 2], ImageSize > 500, Background > White]
Out[2]=