|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r79844 - trunk/libs/math/doc/sf_and_dist/distributions
From: pbristow_at_[hidden]
Date: 2012-08-02 05:24:32
Author: pbristow
Date: 2012-08-02 05:24:31 EDT (Thu, 02 Aug 2012)
New Revision: 79844
URL: http://svn.boost.org/trac/boost/changeset/79844
Log:
Changed back to always returning NaN for moments k <= v and Added Trac #7177
Text files modified:
trunk/libs/math/doc/sf_and_dist/distributions/students_t.qbk | 25 +++++++++++++++++--------
1 files changed, 17 insertions(+), 8 deletions(-)
Modified: trunk/libs/math/doc/sf_and_dist/distributions/students_t.qbk
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/distributions/students_t.qbk (original)
+++ trunk/libs/math/doc/sf_and_dist/distributions/students_t.qbk 2012-08-02 05:24:31 EDT (Thu, 02 Aug 2012)
@@ -35,7 +35,8 @@
A statistical distribution published by William Gosset in 1908.
His employer, Guinness Breweries, required him to publish under a
-pseudonym, so he chose "Student". Given N independent measurements, let
+pseudonym (possibly to hide that they were using statistics),
+so he chose "Student". Given N independent measurements, let
[equation students_t_dist]
@@ -152,18 +153,26 @@
The quantities /x/ and /y/ are both returned by __ibeta_inv
without the subtraction implied above.]]
[[quantile from the complement][Using the relation: t = -quantile(q)]]
-[[mean][0]]
-[[variance][v \/ (v - 2)]]
[[mode][0]]
-[[skewness][0]]
-[[kurtosis][3 * (v - 2) \/ (v - 4)]]
-[[kurtosis excess][6 \/ (df - 4)]]
+[[mean][0]]
+[[variance][if (v > 2) v \/ (v - 2) else NaN]]
+[[skewness][if (v > 3) 0 else NaN ]]
+[[kurtosis][if (v > 4) 3 * (v - 2) \/ (v - 4) else NaN]]
+[[kurtosis excess][if (v > 4) 6 \/ (df - 4) else NaN]]
]
-[endsect][/section:students_t_dist Students t]
+If the moment index k is less than v, then the moment is undefined.
+Evaluating the moment will throw a 'domain_error' unless ignored by a policy,
+when it will return 'std::numeric_limits<>::quiet_NaN();'
+
+(For simplicity, we have not implemented the return of infinity in some cases
+as suggested by [@http://en.wikipedia.org/wiki/Student%27s_t-distribution Wikipedia Student's t].
+See also [@https://svn.boost.org/trac/boost/ticket/7177].)
+
+[endsect] [/section:students_t_dist Students t]
[/ students_t.qbk
- Copyright 2006 John Maddock and Paul A. Bristow.
+ Copyright 2006, 2012 John Maddock and Paul A. Bristow.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
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