Probability Distribution Function and Shape

The Exponential Distribution

A random variable X has an exponential distribution if and only if its probability density is given by

[Maple Math] for x > 0

f ( x ) =

0 elsewhere

where [Maple Math] > 0.

The following code will draw the density function for the Exp( [Maple Math] ) distribution for [Maple Math] = 1, but you are encouraged to try other values of [Maple Math] .

> restart;

> with(plots):

> theta:=1;

[Maple Math]

> f(x):=ExponentialPDF(theta,x);

[Maple Math]

> plot(f(x),x=0..3, title="Exp(1) PDF");

[Maple Plot]

To see the effect of [Maple Math] on the shape of the Exp( [Maple Math] ) distribution, the following animation will draw a series of probability density functions as [Maple Math] varies from 0.1 to 2.1 by increments of 0.1. What happens as [Maple Math] increases?

> theta[0]:=0.1; theta_step:=0.1;

[Maple Math]

[Maple Math]

> for n from 0 to 20 do

> density[n]:=plot(ExponentialPDF(theta[0]+n*theta_step,x),x=0..4):

> num:=convert(evalf(theta[0]+n*theta_step,3),string):

> tracker[n]:=textplot([3,6,`theta is `.num],color=blue);

> P[n]:=display({density[n],tracker[n]}):

> od:

> display([seq(P[n],n=0..20)],insequence=true,title="Increasing theta for PDF");

>

[Maple Plot]

This next bit of code will animate the CDF for a Exp( [Maple Math] ). What happens to the CDF as theta increases from 0.1 to 2.1?

Note that the plot range is the same as above, x=0..4. If you'd like, you can experiment with different values of [Maple Math] .

> theta[0]:=0.1; theta_step:=0.1;

[Maple Math]

[Maple Math]

> for n from 0 to 20 do

> density[n]:=plot(ExponentialCDF(theta[0]+n*theta_step,x),x=0..4):

> num:=convert(evalf(theta[0]+n*theta_step,3),string):

> tracker[n]:=textplot([3,0.8,`theta is `.num],color=blue);

> P[n]:=display({density[n],tracker[n]}):

> od:

> display([seq(P[n],n=0..20)],insequence=true,title="Increasing theta for CDF");

[Maple Plot]