Boost logo

Boost-Commit :

From: pbristow_at_[hidden]
Date: 2007-12-17 10:59:21


Author: pbristow
Date: 2007-12-17 10:59:20 EST (Mon, 17 Dec 2007)
New Revision: 42125
URL: http://svn.boost.org/trac/boost/changeset/42125

Log:
Changed support range to avoid a discontinuity at zero.
Text files modified:
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/dist_tutorial.qbk | 23 ++++++++++++++++++++---
   1 files changed, 20 insertions(+), 3 deletions(-)

Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/dist_tutorial.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/dist_tutorial.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/dist_tutorial.qbk 2007-12-17 10:59:20 EST (Mon, 17 Dec 2007)
@@ -158,13 +158,32 @@
 
 `pdf(binomial_distribution<RealType>(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 @@
 (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
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk