|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80066 - trunk/boost/math/distributions
From: john_at_[hidden]
Date: 2012-08-17 08:21:57
Author: johnmaddock
Date: 2012-08-17 08:21:57 EDT (Fri, 17 Aug 2012)
New Revision: 80066
URL: http://svn.boost.org/trac/boost/changeset/80066
Log:
Add student's t approximations for large v.
Text files modified:
trunk/boost/math/distributions/non_central_t.hpp | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
Modified: trunk/boost/math/distributions/non_central_t.hpp
==============================================================================
--- trunk/boost/math/distributions/non_central_t.hpp (original)
+++ trunk/boost/math/distributions/non_central_t.hpp 2012-08-17 08:21:57 EDT (Fri, 17 Aug 2012)
@@ -214,6 +214,16 @@
delta = -delta;
invert = !invert;
}
+ if(fabs(delta / (4 * n)) < policies::get_epsilon<T, Policy>())
+ {
+ // Approximate with a Student's T centred on delta,
+ // the crossover point is based on eq 2.6 from
+ // "A Comparison of Approximations To Persentiles of the
+ // Noncentral t-Distribution". H. Sahai and M. M. Ojeda,
+ // Revista Investigacion Operacional Vol 21, No 2, 2000.
+ T result = cdf(students_t_distribution<T, Policy>(n), t - delta);
+ return invert ? 1 - result : result;
+ }
//
// x and y are the corresponding random
// variables for the noncentral beta distribution,
@@ -437,6 +447,15 @@
* sqrt(n / constants::pi<T>())
* exp(-delta * delta / 2) / 2;
}
+ if(fabs(delta / (4 * n)) < policies::get_epsilon<T, Policy>())
+ {
+ // Approximate with a Student's T centred on delta,
+ // the crossover point is based on eq 2.6 from
+ // "A Comparison of Approximations To Persentiles of the
+ // Noncentral t-Distribution". H. Sahai and M. M. Ojeda,
+ // Revista Investigacion Operacional Vol 21, No 2, 2000.
+ return pdf(students_t_distribution<T, Policy>(n), t - delta);
+ }
//
// x and y are the corresponding random
// variables for the noncentral beta distribution,
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