Some STA205 demos involving  (χ^2)

Andy Long

Here’s the (χ^2) density function (the (χ^2) version of the bell curve), for 3 degrees of freedom (df), as well as a plot of the amount of area left in the tail as (χ^2) gets bigger):

Mathematica already has this built in, of course: you just can’t see how it’s made.

Plot[PDF[ChiSquareDistribution[3],x],{x,0,8}]
Plot[1-CDF[ChiSquareDistribution[3],x],{x,0,8}]

To illustrate the role of df (degrees of freedom) in the shape of a  (χ^2):

Manipulate[
Module[{p1,p2},
p1=Plot[PDF[ChiSquareDistribution[df],x],{x,0,2*df},PlotRange->All,Filling->Axis,PlotLabel->StringJoin[{"df=",TextString[df]}]]
],
{df,2,30,1}
]