I would really rather someone else answer this questionAbout the program: lists are initialized as normal distribution (nd) AIC (ndAlist), nd BIC (ndBlist), uniform distribution (ud) AIC and will happily award the bountyBIC (udAlist, udBlist). Two do loops are used. The outer do loop increments $n$ from 5 to anyone who can take me out100 in increments of $n=5$. The inner do loop (1) creates $n$ random variates (named dat) from an $\mathcal{N}(0,1)$. Then (2) creates an emperical CDF named edistdata from dat. (3) Defines cdfn and cdfu functions for fitting from the echo chamberCDFs of my talkingnd and ud. (4) Best fits by variation of parameters of cdfn and cdfu to myselfedistdata. Note: Fitting to CDFs rather than PDFs markedly decreases noise and is a common procedure. This is done, rather than, for example, using mean and variance to calculate nd or min and max to calculate ud because the fitting uses a single algorithm for both nd and ud and that NonlinearModelFit routine outputs AIC and BIC for the models as well as parameters as options for the output nlmn and nlmu fit outputs, e.g., as nlmn["AIC"]. Note: it is assumed that the AIC and BIC fit parameters are correctly calculated using ML as the contrary case would be meaningless.
(*Mathematica Program*)
ndAlist = {};
ndBlist = {};
udAlist = {};
udBlist = {};
Do[
AICndlist = {};
BICndlist = {};
AICudlist = {};
BICudlist = {};
Do[dat =
RandomVariate[NormalDistribution[0, 1], n, WorkingPrecision -> 40];
edistdata = Table[{x, CDF[EmpiricalDistribution[dat], x]}, {x, dat}];
cdfn[a1_, a2_, x_] := CDF[NormalDistribution[a1, a2], x];
cdfu[b1_, b2_, x_] := CDF[UniformDistribution[{b1, b2}], x];
nlmn = NonlinearModelFit[edistdata, cdfn[a1, a2, x], {{a1, 0}, {a2, 1}}, x];
nlmu = NonlinearModelFit[edistdata, cdfu[b1, b2, x], {{b1, -2}, {b2, 2}}, x];
AICndlist = AppendTo[AICndlist, nlmn["AIC"]];
BICndlist = AppendTo[BICndlist, nlmn["BIC"]];
AICudlist = AppendTo[AICudlist, nlmu["AIC"]];
BICudlist = AppendTo[BICudlist, nlmu["BIC"]],
{i, 1, 1000}];
ndA = 0.; udA = 0.; ndB = 0.; udB = 0.;
Do[If[AICndlist[[j]] < AICudlist[[j]], ndA = ndA + 1, udA = udA + 1],
{j, 1, 1000}];
Do[If[BICndlist[[j]] < BICudlist[[j]], ndB = ndB + 1, udB = udB + 1],
{j, 1, 1000}];
Print["n: ", n, "\nAIC nd/1000: ", ndA, "\tAIC ud/1000: ", udA, "\nBIC nd/1000: ", ndB, "\tBIC ud/1000: ", udB];
ndAlist = AppendTo[ndAlist, {n, ndB}];
ndBlist = AppendTo[ndBlist, {n, ndB}], {n, 5, 100, 5}]
Print[ndAlist]
ListPlot[ndAlist, AxesLabel -> {"n", "AIC ND < AIC UD"}, PlotRange -> {{0, 100}, {0, 1000}}, PlotRangePadding -> {{0, 1}, {0, 0}}]
(Numerical Output)
n: 5
AIC nd/1000: 395. AIC ud/1000: 605.
BIC nd/1000: 395. BIC ud/1000: 605.
n: 10
AIC nd/1000: 572. AIC ud/1000: 428.
BIC nd/1000: 572. BIC ud/1000: 428.
n: 15
AIC nd/1000: 684. AIC ud/1000: 316.
BIC nd/1000: 684. BIC ud/1000: 316.
n: 20
AIC nd/1000: 725. AIC ud/1000: 275.
BIC nd/1000: 725. BIC ud/1000: 275.
n: 25
AIC nd/1000: 769. AIC ud/1000: 231.
BIC nd/1000: 769. BIC ud/1000: 231.
n: 30
AIC nd/1000: 777. AIC ud/1000: 223.
BIC nd/1000: 777. BIC ud/1000: 223.
n: 35
AIC nd/1000: 811. AIC ud/1000: 189.
BIC nd/1000: 811. BIC ud/1000: 189.
n: 40
AIC nd/1000: 841. AIC ud/1000: 159.
BIC nd/1000: 841. BIC ud/1000: 159.
n: 45
AIC nd/1000: 848. AIC ud/1000: 152.
BIC nd/1000: 848. BIC ud/1000: 152.
n: 50
AIC nd/1000: 848. AIC ud/1000: 152.
BIC nd/1000: 848. BIC ud/1000: 152.
n: 55
AIC nd/1000: 877. AIC ud/1000: 123.
BIC nd/1000: 877. BIC ud/1000: 123.
n: 60
AIC nd/1000: 886. AIC ud/1000: 114.
BIC nd/1000: 886. BIC ud/1000: 114.
n: 65
AIC nd/1000: 900. AIC ud/1000: 100.
BIC nd/1000: 900. BIC ud/1000: 100.
n: 70
AIC nd/1000: 901. AIC ud/1000: 99.
BIC nd/1000: 901. BIC ud/1000: 99.
n: 75
AIC nd/1000: 914. AIC ud/1000: 86.
BIC nd/1000: 914. BIC ud/1000: 86.
n: 80
AIC nd/1000: 932. AIC ud/1000: 68.
BIC nd/1000: 932. BIC ud/1000: 68.
n: 85
AIC nd/1000: 935. AIC ud/1000: 65.
BIC nd/1000: 935. BIC ud/1000: 65.
n: 90
AIC nd/1000: 946. AIC ud/1000: 54.
BIC nd/1000: 946. BIC ud/1000: 54.
n: 95
AIC nd/1000: 952. AIC ud/1000: 48.
BIC nd/1000: 952. BIC ud/1000: 48.
n: 100
AIC nd/1000: 949. AIC ud/1000: 51.
BIC nd/1000: 949. BIC ud/1000: 51.
{{5,395.},{10,572.},{15,684.},{20,725.},{25,769.},{30,777.},{35,811.},{40,841.},{45,848.},{50,848.},{55,877.},{60,886.},{65,900.},{70,901.},{75,914.},{80,932.},{85,935.},{90,946.},{95,952.},{100,949.}}
Plot output as above.