Example 1: Simple Simulations
by Zavan Karian
> restart: with(plots, display): libname:="C:/mylib/statistics",libname: with(stat);
> A := Die(6,8);
> Freq(A, 1..6);
> A := Die(4, 400):
> Freq(A, 1..4);
> Coins := DiscreteS( [0, 1/2, 1, 1/2], 8);
> pdf := x/10;
> Sample := DiscreteS(pdf, 1..4, 5);
> Sample := DiscreteS(pdf, 1..4, 300):
> EH := Histogram(Sample, 0.5..4.5, 4):
> PH := ProbHist(pdf, 1..4):
> display({EH,PH});
> S1 := BinomialS(10, 0.25, 200):
> S2 := GammaS(3, 2, 100):
> PlotEmpPDF(S2);
> PlotEmpPDF(S2, 0..25, 10);
> PlotEmpCDF(S2,0..25);
> BoxWhisker(S1,S2);
> QQ(S1,S2);