Sample Probability Calculations
We can calculate probabilities for the t ( ) distribution using either the probability distribution function (PDF) or the cumulative distribution function (CDF). We will denote the PDF by f and the CDF by F . The CDF for the t (1) appears below, but feel free to plot it for different values of .
> restart: with(plots):
> nu:=1:
> f:=x->TPDF(nu,x);
> F:=x->TCDF(nu,x);
> plot(F(x),x=-6..6, title="CDF for t(1)");
> a:=plot(f(x), x=-6..6, color=black):
> b:=plot(f(x), x=-6..-1, color=yellow, filled=true):
> display([a, b]);
Find the value of the yellow shaded area, the area under the t(1) density curve to the left of -1.
> evalf(F(-1));
The value of this area can also be found by using the integration command.
> evalf(int(f(x),x=-infinity..-1));
> a:=plot(f(x), x=-6..6, color=black):
> b:=plot(f(x), x=.6..1.4, color=yellow, filled=true):
> display([a, b]);
Find the value of the yellow shaded area, the area under the t (1) density curve between .6 and 1.4.
Using the CDF, we find the area to the left of 0.6 and then subtract the area to the left of 1.4.
> area1:=F(1.4);
> area2:=F(0.6);
> area_between:=area1-area2;
Using the integration command, we simply integrate the t PDF from 0.6 to 1.4.
> evalf(int(f(x),x=0.6..1.4));
> a:=plot(f(x),x=-6..6,labels=[" "," "]):
> b:=plot(f(x),x=1..6,color=yellow,filled=true,labels=[" "," "]):
> c:=textplot([1,-.01,"x"],color=blue):
> d:=textplot([2,0.02,".25"],color=black):
> display([a,b,c,d]);
Find the value of x, which has .75 area to the left of it. x is known as the third quartile of the t (1) distribution.
> fsolve(F(x)=.75,x);