Sample Probability Calculations

We can calculate probabilities for the t ( [Maple Math] ) 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 [Maple Math] .

> restart: with(plots):

> nu:=1:

> f:=x->TPDF(nu,x);

[Maple Math]

> F:=x->TCDF(nu,x);

[Maple Math]

> plot(F(x),x=-6..6, title="CDF for t(1)");

[Maple Plot]

> 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.

[Maple Plot]

> evalf(F(-1));

[Maple Math]

The value of this area can also be found by using the integration command.

> evalf(int(f(x),x=-infinity..-1));

[Maple Math]

> 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.

[Maple Plot]

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);

[Maple Math]

> area2:=F(0.6);

[Maple Math]

> area_between:=area1-area2;

[Maple Math]

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));

[Maple Math]

> 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]);

[Maple Plot]

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);

[Maple Math]