Continuous Distribution Examples

Worked examples for standard continuous distributions. Expected values are the known analytical results; ToFUL results match to the displayed precision.


Uniform Distribution

Parameters: \(a = 0\), \(b = 1\)

Lower:  0
Upper:  1
PDF:    1 if 0 <= x <= 1 else 0

Known analytical values:

Mean      = (a+b)/2         = 0.5
Variance  = (b-a)²/12       = 1/12 ≈ 0.0833
Skewness  = 0               (symmetric)
Excess kurtosis = −6/5      = −1.2  (platykurtic)

Raw moments about origin:

\[\mu'_r = \frac{1}{r+1}\]

So \(\mu'_1 = 1/2\), \(\mu'_2 = 1/3\), \(\mu'_3 = 1/4\), \(\mu'_4 = 1/5\).


Exponential Distribution

Parameters: \(\lambda = 2\)

Lower:  0
Upper:  inf
PDF:    2 * exp(-2*x) if x >= 0 else 0

Known analytical values:

Mean      = 1/λ         = 0.5
Variance  = 1/λ²        = 0.25
Std Dev   = 0.5
Skewness  = 2           (strong right skew)
Excess kurtosis = 6     (heavy tails)

Raw moments about origin:

\[\mu'_r = \frac{r!}{\lambda^r}\]

So \(\mu'_1 = 0.5\), \(\mu'_2 = 0.5\), \(\mu'_3 = 0.75\), \(\mu'_4 = 1.5\).

Note

For this distribution, ToFUL uses Gauss-Laguerre quadrature (domain \([0, \infty)\)) and typically achieves near-exact results. The method shown will be gauss-laguerre+quad.


Standard Normal Distribution

Parameters: \(\mu = 0\), \(\sigma = 1\)

Lower:  -inf
Upper:  inf
PDF:    exp(-(x**2)/2) / sqrt(2*pi)

Known analytical values:

Mean      = 0
Variance  = 1
Skewness  = 0   (symmetric)
Kurtosis  = 3   (excess = 0, mesokurtic)

Raw moments about origin:

All odd raw moments are 0. Even raw moments satisfy:

\[\mu'_{2k} = (2k-1)!! = 1 \cdot 3 \cdot 5 \cdots (2k-1)\]

So \(\mu'_2 = 1\), \(\mu'_4 = 3\), \(\mu'_6 = 15\).

Tip

The Normal PDF has no if/else guard, so ToFUL’s SymPy path computes these moments exactly. The method shown will be sympy-exact and all values will be precise integers or exact fractions.


Normal Distribution (general)

Parameters: \(\mu = 3\), \(\sigma = 2\)

Lower:  -inf
Upper:  inf
PDF:    exp(-((x-3)**2) / 8) / (2 * sqrt(2*pi))

Known analytical values:

Mean      = 3
Variance  = 4
Std Dev   = 2
Skewness  = 0
Excess kurtosis = 0

Gamma Distribution

Parameters: \(\alpha = 3\) (shape), \(\beta = 1\) (rate)

Lower:  0
Upper:  inf
PDF:    (x**2 * exp(-x)) / 2  if x >= 0 else 0

(This is the Gamma(3,1) PDF normalised by \(\Gamma(3) = 2! = 2\).)

Known analytical values:

Mean      = α/β         = 3
Variance  = α/β²        = 3
Skewness  = 2/sqrt(α)   ≈ 1.1547
Excess kurtosis = 6/α   = 2

Raw moments about origin:

\[\mu'_r = \frac{\Gamma(\alpha + r)}{\beta^r\,\Gamma(\alpha)} = \frac{(\alpha+r-1)!}{(\alpha-1)!\,\beta^r}\]

For \(\alpha = 3\), \(\beta = 1\): \(\mu'_1 = 3\), \(\mu'_2 = 12\), \(\mu'_3 = 60\), \(\mu'_4 = 360\).


Beta Distribution

Parameters: \(\alpha = 2\), \(\beta = 3\)

The normalising constant \(B(\alpha,\beta)^{-1} = \Gamma(\alpha+\beta)/(\Gamma(\alpha)\Gamma(\beta)) = 12\).

Lower:  0
Upper:  1
PDF:    12 * x * (1-x)**2  if  0 <= x <= 1  else  0

Known analytical values:

Mean      = α/(α+β)           = 0.4
Variance  = αβ/((α+β)²(α+β+1)) = 0.04
Skewness  ≈ 0.5963
Excess kurtosis ≈ −0.1429

Triangular Distribution

Parameters: lower = 0, upper = 2, mode = 1

Lower:  0
Upper:  2
PDF:    x if 0<=x<=1 else (2-x) if 1<x<=2 else 0

Known analytical values:

Mean      = (a + b + c)/3     = 1
Variance  = (a²+b²+c²-ab-ac-bc)/18 = 1/6 ≈ 0.1667
Skewness  = 0  (symmetric for this parameterisation)

Cauchy Distribution

The Cauchy distribution is the classic example of a distribution with no finite moments of any order.

Lower:  -inf
Upper:  inf
PDF:    1 / (pi * (1 + x**2))

Warning

ToFUL will validate that the PDF integrates to 1 (it does), but all moment computations will fail to converge. The Convergence tab will show partial-sum with an uncertain flag for all orders. This is the correct mathematical result — the integrals are genuinely infinite.


Laplace Distribution

Parameters: \(\mu = 0\), \(b = 1\)

Lower:  -inf
Upper:  inf
PDF:    exp(-abs(x)) / 2

Known analytical values:

Mean      = 0
Variance  = 2b²         = 2
Skewness  = 0           (symmetric)
Excess kurtosis = 3     (heavier tails than Normal)

See also