Example 6: Understanding an Important Theorem
by Zavan Karian
> restart: with(plots, display): libname:="C:/mylib/statistics",libname: with(stat):
> f := x -> (3/2)*x^2;
> int(f(x), x=-1..1);
> mu := int(x*f(x), x=-1..1);
> var := int(x^2*f(x), x=-1..1)- mu^2;
> F := int(f(t), t=-1..x);
> A := ContinuousS(f(x), -1..1, 5);
> A := ContinuousS(f(x), -1..1, 400):
> H := Histogram(A, -1..1, 12):
> P := plot(f(x), x=-1..1):
> display({P,H});
>
> S4 := [seq(ContinuousS(f(x), -1..1, 4), i=1..300)]:
> S4[1];
> M4 := [seq(Mean(S4[i]), i=1..300)]:
> H4 := Histogram(M4, -1..1, 7):
> n4 := NormalPDF(mu, var/4, x):
> N4 := plot(n4, x=-1..1, color=blue):
> # interface(plotdevice=postscript, plotoutput=Fig6a);
> display({P, H4, N4});
>
> S8 := [seq(ContinuousS(f(x), -1..1, 8), i=1..300)]:
> A[1];
> M8 := [seq(Mean(S8[i]), i=1..300)]:
> # interface(plotdevice=postscript, plotoutput=Fig6b);
> H8 := Histogram(M8, -1..1, 7):
> n8 := NormalPDF(mu, var/8, x):
> N8 := plot(n8, x=-1..1, color=blue):
> display({P, H8, N8});
>
> A := [seq(ContinuousS(f(x), -1..1, 16), i=1..300)]:
> M16 := [seq(Mean(A[i]), i=1..300)]:
> H16 := Histogram(M16, -1..1, 13):
> n16 := NormalPDF(mu, var/16, x):
> N16 := plot(n16, x=-1..1, color=blue):
> display({P, H16, N16});