Statistics

Dennis Silverman
Mathematical Physics 212C
Department of Physics and Astronomy
U. C. Irvine

Some Examples taken from 
      "Guide to Standard Mathematica Packages",  Version 2.2,  
    Wolfram Research.

Confidence Intervals

Confidence Intervals for Data

<< Statistics`ConfidenceIntervals`

data1  = 
       {2.1,  1.2,  0.7,  1.0,  1.1,  3.2,  3.2,  3.3,  2.1,  0.3};

mean  =  Mean[data1]

?? VarianceCI

VarianceCI[data1]

VarianceCI[data1,  ConfidenceLevel  ->  0.90]

Confidence Intervals For Distributions

?? NormalCI

NormalCI[0,  1]

NormalCI[0, 1, ConfidenceLevel  ->  0.90]

?? ChiSquareCI

ChiSquareCI[20, 20,  ConfidenceLevel  ->  0.67]

ChiSquareCI[20, 20, ConfidenceLevel  ->  0.90]

ChiSquareCI[20, 20]

Normal Distribution Functions

<< Statistics`NormalDistribution`

?ChiSquareDistribution

?PDF

chis  =  PDF[ChiSquareDistribution[5], x]

Plot[chis, {x, 0, 10}]

?NormalDistribution

ndf  =  PDF[NormalDistribution[5, 2], x]

Plot[ndf, {x, -1, 11}]

Mean[NormalDistribution[5, 2]]

Variance[NormalDistribution[5, 2]]

StandardDeviation[NormalDistribution[5, 2]]

?Quantile

Quantile[NormalDistribution[5, 2], .9]

Quantile[NormalDistribution[5, 2],  .1]

?CDF

ncdf  =  CDF[NormalDistribution[5, 2], x]

Plot[ncdf, {x, -1, 11}]

charndf  =  CharacteristicFunction[NormalDistribution[5, 2], k]

Discrete Distributions

<< Statistics`DiscreteDistributions`

?BinomialDistribution

binompdf  =  PDF[BinomialDistribution[4, .5], m]

Plot[binompdf, {m, 0, 6}]

?PoissonDistribution

poissonpdf  =  PDF[PoissonDistribution[4], m]

Plot[poissonpdf, {m, 0, 8}]

N[Exp[-4]]

Nonlinear Function Fitting

<< Statistics`NonlinearFit`

?NonlinearFit

data  =  Table[{n, 3  Cos[2  n]}, {n, 0., 1.5, .5}]

NonlinearFit[data,  b Cos[a x],  x,  {a, b}]

Uses Levenberg Marquardt Method going from steepest descents to
       quadratic minimization.