density.exponential Function (GPL)

Syntax

density.exponential(<algebra>, rate(<numeric>), <function>)

or

density.exponential(<binning function>, rate(<numeric>), <function>)

<algebra>. Graph algebra, such as x*y. Refer to Brief Overview of GPL Algebra for an introduction to graph algebra. The algebra is optional.

<binning function>. A binning function. The binning function is optional.

<numeric>. rate defines the parameter for the distribution. This takes a numeric value greater than or equal to 0 and is optional. If the parameter is not specified, it is calculated from the underlying data.

<function>. A valid function. Use scaledToData("false") when comparing densities with very different same sizes.

Description

Calculates the probability density of the exponential distribution. This is often used to add a distribution curve. If you don't see the graphic element for the distribution, check the parameter for the distribution and the range for the x axis scale.

Examples

Figure 1. Example: Adding a chi-square distribution curve
ELEMENT: line(position(density.exponential(x, rate(1.5))))