BeginPackage["UVW`DataRep`"] Histogram::usage = " Histogram[listofdata,listofbounds] represents the histogram of the data contained in listofdata. The bounds of the classes are read in listofbounds." RegularHisto::usage = " RegularHisto[listofdata,xmin,xmax,nx] represents the histogram of the data contained in list of data. There are nx regular classes between xmin and xmax." SamplePlot2D::usage = " SamplePlot2D[listof2Ddata] plots in the plane the points whose coordinates are read in listof2Ddata." Histogram2D::usage = " Histogram2D[listof2Ddata,xmin,xmax,nx,ymin,ymax,ny] represents a histogram in 3 dimensions for the two dimensional data contained in listof2Ddata. The classes are regular. There are nx classes in abscissa between xmin and xmax, and ny classes in ordinate between ymin and ymax." LargeNumbers::usage = " LargeNumbers[listofdata] plots the partial means of the data contained in listofdata." CentralLimit::usage = " CentralLimit[listofdata, mu, sigma, n] takes consecutive groups of n data in listofdata. The sum of each group is centered by n*mu then divided by Sqrt[n]*sigma. The results are represented on a regular histogram with 20 classes." Begin["`Private`"] Histogram[listofdata_List,listofbounds_List,opts___]:= Block[{list,nbclasses,cardinal,i,ordinates,abscissas,g}, list = Cases[listofdata,x_/;First[listofbounds] All, PlotJoined -> True] ] RegularHisto[listofdata_List,xmin_,xmax_,nx_,opts___]:= Block[{cardinal,list,step,i,abscissas,ordinates,g}, step = N[(xmax-xmin)/nx]; list = Cases[listofdata,x_/;xmin True, PlotRange -> All ] ] Histogram2D[list2Dofdata_List,xmin_,xmax_,nx_,ymin_,ymax_,ny_,opts___]:= Block[{cardinal,xmesh,ymesh,list,stepx,stepy,g,i,j}, stepx = N[(xmax-xmin)/nx]; stepy = N[(ymax-ymin)/ny]; list = Cases[list2Dofdata,x_List/; xmin All, AspectRatio -> Automatic, Boxed -> True, Axes -> Automatic, Ticks ->Automatic, AxesLabel ->{"x","y","f[x,y]"} ] ] SamplePlot2D[listof2Ddata_,opts___]:= ListPlot[listof2Ddata, opts, PlotRange -> All, AxesLabel -> {"x","y"}]; LargeNumbers[listofdata_List,opts___] := Block[ {listofmeans,len}, listofmeans = Rest[FoldList[Plus,0.,listofdata]]; len=Length[listofdata]; listofmeans = listofmeans / Range[len]; ListPlot[listofmeans , PlotRange -> All, Prolog -> PointSize[0.001], opts ] ] CentralLimit[ listofdata_List,mu_,sigma_,n_,opts___] := Block[ {listpart, max,min,g1,g2}, listpart = Transpose[Partition[listofdata,n]]; listpart = Apply[Plus,listpart]; listpart = listpart - (N[n] mu); listpart = listpart/(Sqrt[N[n]] sigma); min = Min[listpart]; max = Max[listpart]; g1 := RegularHisto[listpart,min,max,20, DisplayFunction -> Identity]; g2 := Plot[Exp[-(x^2)/2] / Sqrt[2 Pi], {x,min,max}, DisplayFunction -> Identity]; Show[g1,g2,DisplayFunction->$DisplayFunction] ] End[ ] EndPackage[ ]