Distributions

Daniel D. Warner
June 7, 1999

Normal Distribution

The Normal Probability Density

The normal probability density is given by [Maple Math] [Maple Math] ,

where [Maple Math] .

> Npd := (x,sigma,mu) -> (1/(sigma*sqrt(2*Pi)))*exp(-((x-mu)/(sigma*sqrt(2)))^2);

[Maple Math]

> Digits := 20;

[Maple Math]

> sigma := 2; mu := 35;

[Maple Math]

[Maple Math]

> evalf(Npd(36,sigma,mu));

[Maple Math]

> plot(Npd(x,sigma,mu),x=mu-3*sigma..mu+3*sigma);

[Maple Plot]

The Normal Probability Distribution

The Normal Probability Distribution, [Maple Math] , is given by [Maple Math] [Maple Math] ,

where [Maple Math] is the lower boundary and [Maple Math] is the upper boundary.

> sigma := 'sigma'; mu := 'mu';

[Maple Math]

[Maple Math]

> Ncd := (a,b,sigma,mu) -> int(Npd(x,sigma,mu),x=a..b);

[Maple Math]

> evalf(Ncd(-10^99,36,2,35));

[Maple Math]

> Ncd2 := (a,b,sigma,mu) -> (1/2)*(erf((b-mu)/(sigma*sqrt(2))) - erf((a-mu)/(sigma*sqrt(2))));

[Maple Math]

> p2 := evalf(Ncd2(-10^99,36,2,35));

[Maple Math]

> plot(Ncd2(-10^99,b,2,35),b=29..41);

[Maple Plot]

The Inverse Cumulative Normal Distribution

The Inverse Cumulative Normal Probability Distribution finds [Maple Math] given [Maple Math] [Maple Math] ,

> InvN := (p,sigma,mu) -> solve(Ncd2(-infinity,x,sigma,mu)=p,x);

[Maple Math]

> InvN(1/2,1,0);

[Maple Math]

> evalf(%);

[Maple Math]

> InvN(p2,2,35);

[Maple Math]

Student-t Distribution

Student-t Probability Density

The Student-t Probability Density, [Maple Math] , is given by [Maple Math] [Maple Math] ,

> Tpd := (x,df) -> (GAMMA((df+1)/2)/GAMMA(df/2))*(1+x^2/df)^(-(df+1)/2)/sqrt(Pi*df);

[Maple Math]

> Tpd(1,2);

[Maple Math]

> evalf(%);

[Maple Math]

> plot(Tpd(x,2),x=-4..4);

[Maple Plot]

Student-t Cumulative Distribution

The Student-t Probability Distribution, [Maple Math] , is given by [Maple Math] [Maple Math] ,

where [Maple Math] is the lower boundary and [Maple Math] is the upper boundary.

> Tcd := (a,b,df) -> (GAMMA((df+1)/2)/GAMMA(df/2))*int((1+x^2/df)^(-(df+1)/2)/sqrt(Pi*df),x=a..b);

[Maple Math]

> Tcd(-2,3,18);

[Maple Math]

> evalf(%);

[Maple Math]

> evalf(Tcd(0,2.160,13));

[Maple Math]

Chi-square Distribution

[Maple Math] Probability Distribution

The [Maple Math] Probability density, [Maple Math] , is given by [Maple Math] [Maple Math] ,

> Cpd := (x,df) -> ((1/2)^(df/2)/GAMMA(df/2))*(x^(df/2-1)*exp(-x/2));

[Maple Math]

> Cpd(1,3);

[Maple Math]

> evalf(%);

[Maple Math]

> plot(Cpd(x,3),x=0..6);

[Maple Plot]

[Maple Math] Probability Distribution

The [Maple Math] Probability distribution, [Maple Math] is given by [Maple Math] [Maple Math] ,

where [Maple Math] is the lower boundary and [Maple Math] is the upper boundary.

> Ccd := (a,b,df) -> (((1/2)^(df/2))/GAMMA(df/2))*int((x^(df/2-1)*exp(-x/2)),x=a..b);

[Maple Math]

> Ccd(0,19.023,9);

[Maple Math]

> evalf(%);

[Maple Math]

> plot(Ccd(0,b,9),b=0..25);

[Maple Plot]

[Maple Math] Distribution

[Maple Math] Probability Density

The [Maple Math] probibility density is given by [Maple Math] [Maple Math]

> Fpd := (x,n, d) -> GAMMA((n+d)/2)/(GAMMA(n/2)*GAMMA(d/2)) * (n/d)^(n/2)*x^(n/2-1) * (1+n*x/d)^(-(n+d)/2);

[Maple Math]

> Fpd(1,24,19);

[Maple Math]

> evalf(%);

[Maple Math]

[Maple Math] Probability Distribution

The [Maple Math] probability distribution is given by [Maple Math] [Maple Math] ,

where [Maple Math] is the lower boundary.and [Maple Math] is the upper boundary.

> Fcd := (a,b,n, d) -> GAMMA((n+d)/2)/(GAMMA(n/2)*GAMMA(d/2)) * (n/d)^(n/2)*int(x^(n/2-1) * (1+n*x/d)^(-(n+d)/2),x=a..b);

[Maple Math]

> Fcd(0,1.9824,19,16);

[Maple Math]

> evalf(%);

[Maple Math]

Binomial Probability

Binomial Probability Density

The Binomial probability density is given by [Maple Math]

where ( [Maple Math] , 2, 3, ...), [Maple Math] is the probability of success and [Maple Math] is the number of trials.

> Bpd := (x,n,p) -> binomial(n,x)*p^x*(1-p)^(n-x);

[Maple Math]

> Bpd(10,15,6/10);

[Maple Math]

> evalf(%);

[Maple Math]

> Bpd(11,15,6/10);

[Maple Math]

> evalf(%);

[Maple Math]

> Bpd(12,15,6/10);

[Maple Math]

> evalf(%);

[Maple Math]

> Bpd(13,15,6/10);

[Maple Math]

> evalf(%);

[Maple Math]

> Bpd(14,15,6/10);

[Maple Math]

> evalf(%);

[Maple Math]

Binomial Probability Distribution

The Poisson probability distribution is given by [Maple Math]

where ( [Maple Math] , 1, 2, ...), [Maple Math] is the probability of success and [Maple Math] is the number of trials.

> Bcd := (x,n,p) -> sum(binomial(n,k)*p^k*(1-p)^(n-k),k=0..x);

[Maple Math]

> Bcd(10,15,6/10);

[Maple Math]

> evalf(%);

[Maple Math]

> Bcd(11,15,6/10);

[Maple Math]

> evalf(%);

[Maple Math]

> Bcd(12,15,6/10);

[Maple Math]

> evalf(%);

[Maple Math]

> Bcd(13,15,6/10);

[Maple Math]

> evalf(%);

[Maple Math]

> Bcd(14,15,6/10);

[Maple Math]

> evalf(%);

[Maple Math]

Poisson Probability

Poisson Probability Density

The Poisson probability density is given by [Maple Math] where ( [Maple Math] , 2, 3, ...),

and [Maple Math] is the population mean.

> Ppd := (x,mu) -> exp(-mu)*mu^x/x!;

[Maple Math]

> Ppd(2,6);

[Maple Math]

> evalf(%);

[Maple Math]

> Ppd(3,6);

[Maple Math]

> evalf(%);

[Maple Math]

> Ppd(4,6);

[Maple Math]

> evalf(%);

[Maple Math]

Poisson Probability Distribution

The Poisson probability distribution is given by [Maple Math]

where ( [Maple Math] , 2, 3, ...), and [Maple Math] is the population mean.

> Pcd := (x,mu) -> sum(exp(-mu)*mu^t/t!,t=0..x);

[Maple Math]

> Pcd(2,6);

[Maple Math]

> evalf(%);

[Maple Math]

> Pcd(3,6);

[Maple Math]

> evalf(%);

[Maple Math]

> Pcd(4,6);

[Maple Math]

> evalf(%);

[Maple Math]

Geometric Probability

Geometric Probability Density

The Geometric probability density is given by [Maple Math]

where ( [Maple Math] , 2, 3, ...).

> Gpd := (x,p) -> p*(1-p)^(x-1);

[Maple Math]

> Gpd(3,4/10);

[Maple Math]

> evalf(%);

[Maple Math]

> Gpd(4,4/10);

[Maple Math]

> evalf(%);

[Maple Math]

> Gpd(5,4/10);

[Maple Math]

> evalf(%);

[Maple Math]

Geometric Probability Distribution

The Geometric probability density is given by [Maple Math]

where ( [Maple Math] , 2, 3, ...).

> Gcdc := (x,p) -> sum(p*(1-p)^(k-1),k=1..x);

[Maple Math]

> Gcdc(2,5/10);

[Maple Math]

> evalf(%);

[Maple Math]

> Gcdc(3,5/10);

[Maple Math]

> evalf(%);

[Maple Math]

> Gcdc(4,5/10);

[Maple Math]

> evalf(%);

[Maple Math]