<< distfun_expinv Exponential distfun_exprnd >>

distfun >> distfun > Exponential > distfun_exppdf

distfun_exppdf

Exponential PDF

Calling Sequence

y = distfun_exppdf ( x , mu )

Parameters

x:

a matrix of doubles

mu :

a matrix of doubles, the average. mu>0

y:

a matrix of doubles, the density

Description

This function computes the Exponential PDF.

Any scalar input argument is expanded to a matrix of doubles of the same size as the other input arguments.

Any optional input argument equal to the empty matrix will be set to its default value.

The exponential distribution with average mu has density

\begin{eqnarray}
f(x) = \frac{1}{\mu} e^{\frac{-x}{\mu}}
\end{eqnarray}

for x >= 0 and is zero if x<0.

Compatibility note.

Notice that mu, the average, is the inverse of the rate. Other computing languages (including R), use 1/mu as the parameter of the exponential distribution. The calling sequence

distfun_exppdf(x,mu)

corresponds to the R calling sequence:

dexp(x,1/mu)

Examples

// http://en.wikipedia.org/wiki/Exponential_distribution
scf();
x = linspace(0,5,1000);
y = distfun_exppdf ( x , 2 );
plot(x,y, "r-" );
y = distfun_exppdf ( x , 1 );
plot(x,y, "m-" );
y = distfun_exppdf ( x , 2/3 );
plot(x,y, "c-" );
xtitle("Exponential PDF","x","y");
legend(["mu=2","mu=1","mu=2/3"]);

// For negative inputs, the probability is
// zero
distfun_exppdf(-10,2)

Authors

Bibliography

Wikipedia, Exponential distribution function, http://en.wikipedia.org/wiki/Exponential_distribution


Report an issue
<< distfun_expinv Exponential distfun_exprnd >>