density.beta Function (GPL)

Syntax

density.beta(<algebra>, shape1(<numeric>), shape2(<numeric>), <function>)

or

density.beta(<binning function>, shape1(<numeric>), shape2(<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>. shape1 and shape2 define the parameters for the distribution. These take numeric values and are required.

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

Description

Calculates the probability density for the beta distribution. This is often used to add a distribution curve. The distribution is defined on the closed interval [0, 1]. If you don't see the graphic element for the distribution, check the parameters for the distribution and the range for the x axis scale.

Because this function does not estimate parameters from the data, it can be used only for comparison and not for fitting.

Examples

Figure 1. Example: Adding a beta distribution curve
ELEMENT: line(position(density.beta(x, shape1(2), shape2(5))))