From 18d03d57f7d3fc42ed07d684652e8d6f3cee6325 Mon Sep 17 00:00:00 2001 From: "Paul A. Bristow" Date: Mon, 17 Dec 2007 15:59:20 +0000 Subject: [PATCH] Changed support range to avoid a discontinuity at zero. [SVN r42125] --- doc/sf_and_dist/dist_tutorial.qbk | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/doc/sf_and_dist/dist_tutorial.qbk b/doc/sf_and_dist/dist_tutorial.qbk index c687b127e..8dcd07d2c 100644 --- a/doc/sf_and_dist/dist_tutorial.qbk +++ b/doc/sf_and_dist/dist_tutorial.qbk @@ -158,13 +158,32 @@ example, we would write: `pdf(binomial_distribution(n, p), k);` -The distribution (effectively the random variate) is said to be 'supported' over a range that is +The ranges of random variate values that are permitted and are supported can be +tested by using two functions `range` and `support`. + +The distribution (effectively the random variate) is said to be 'supported' +over a range that is [@http://en.wikipedia.org/wiki/Probability_distribution "the smallest closed set whose complement has probability zero"]. MathWorld uses the word 'defined' for this range. Non-mathematicians might say it means the 'interesting' smallest range of random variate x that has the cdf going from zero to unity. Outside are uninteresting zones where the pdf is zero, and the cdf zero or unity. + +For most distributions, with probability distribution functions one might describe +as 'well-behaved', we have decided that it is most useful for the supported range +to exclude random variate values like exact zero *if the end point is discontinuous*. +For example, the Weibull (scale 1, shape 1) distribution smoothly heads for unity +as the random variate x declines towards zero. +But at x = zero, the value of the pdf is suddenly exactly zero, by definition. +If you are plotting the PDF, or otherwise calculating, +zero is not the most useful value for the lower limit of supported, as we discovered. +So for this, and similar distributions, +we have decided it is most numerically useful to use +the closest value to zero, min_value, for the limit of the supported range. +(The `range` remains from zero, so you will still get `pdf(weibull, 0) == 0`). +(Exponential and gamma distributions have similarly discontinuous functions). + Mathematically, the functions may make sense with an (+ or -) infinite value, but except for a few special cases (in the Normal and Cauchy distributions) this implementation limits random variates to finite values from the `max` @@ -172,8 +191,6 @@ to `min` for the `RealType`. (See [link math_toolkit.backgrounders.implementation.handling_of_floating_point_infinity Handling of Floating-Point Infinity] for rationale). -The range of random variate values that is permitted and supported can be -tested by using two functions `range` and `support`. [note