|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r66985 - in trunk: boost/math boost/math/distributions libs/math/test libs/math/test/compile_test
From: john_at_[hidden]
Date: 2010-12-03 11:23:58
Author: johnmaddock
Date: 2010-12-03 11:23:55 EST (Fri, 03 Dec 2010)
New Revision: 66985
URL: http://svn.boost.org/trac/boost/changeset/66985
Log:
Added concept checks for new distros, and fixed resulting errors.
Added mean and variance to non-central beta.
Text files modified:
trunk/boost/math/distributions.hpp | 1
trunk/boost/math/distributions/fwd.hpp | 14 ++++++
trunk/boost/math/distributions/geometric.hpp | 14 +++---
trunk/boost/math/distributions/inverse_gaussian.hpp | 4 +
trunk/boost/math/distributions/inverse_uniform.hpp | 2
trunk/boost/math/distributions/non_central_beta.hpp | 81 +++++++++++++++++++++++++++++++++------
trunk/libs/math/test/compile_test/dist_nc_beta_incl_test.cpp | 12 -----
trunk/libs/math/test/compile_test/instantiate.hpp | 57 ++++++++++++++++-----------
trunk/libs/math/test/test_nc_beta.cpp | 20 ++------
9 files changed, 134 insertions(+), 71 deletions(-)
Modified: trunk/boost/math/distributions.hpp
==============================================================================
--- trunk/boost/math/distributions.hpp (original)
+++ trunk/boost/math/distributions.hpp 2010-12-03 11:23:55 EST (Fri, 03 Dec 2010)
@@ -27,6 +27,7 @@
#include <boost/math/distributions/inverse_chi_squared.hpp>
#include <boost/math/distributions/inverse_gamma.hpp>
#include <boost/math/distributions/inverse_gaussian.hpp>
+#include <boost/math/distributions/inverse_uniform.hpp>
#include <boost/math/distributions/laplace.hpp>
#include <boost/math/distributions/logistic.hpp>
#include <boost/math/distributions/lognormal.hpp>
Modified: trunk/boost/math/distributions/fwd.hpp
==============================================================================
--- trunk/boost/math/distributions/fwd.hpp (original)
+++ trunk/boost/math/distributions/fwd.hpp 2010-12-03 11:23:55 EST (Fri, 03 Dec 2010)
@@ -41,6 +41,9 @@
class gamma_distribution;
template <class RealType, class Policy>
+class geometric_distribution;
+
+template <class RealType, class Policy>
class hypergeometric_distribution;
template <class RealType, class Policy>
@@ -50,6 +53,12 @@
class inverse_gamma_distribution;
template <class RealType, class Policy>
+class inverse_gaussian_distribution;
+
+template <class RealType, class Policy>
+class inverse_uniform_distribution;
+
+template <class RealType, class Policy>
class laplace_distribution;
template <class RealType, class Policy>
@@ -126,5 +135,10 @@
typedef boost::math::non_central_f_distribution<Type, Policy> non_central_f;\
typedef boost::math::non_central_t_distribution<Type, Policy> non_central_t;\
typedef boost::math::hypergeometric_distribution<Type, Policy> hypergeometric;\
+ typedef boost::math::inverse_uniform_distribution<Type, Policy> inverse_uniform;\
+ typedef boost::math::geometric_distribution<Type, Policy> geometric;\
+ typedef boost::math::inverse_chi_squared_distribution<Type, Policy> inverse_chi_squared;\
+ typedef boost::math::inverse_gamma_distribution<Type, Policy> inverse_gamma;\
+ typedef boost::math::inverse_gaussian_distribution<Type, Policy> inverse_gaussian;\
#endif // BOOST_MATH_DISTRIBUTIONS_FWD_HPP
Modified: trunk/boost/math/distributions/geometric.hpp
==============================================================================
--- trunk/boost/math/distributions/geometric.hpp (original)
+++ trunk/boost/math/distributions/geometric.hpp 2010-12-03 11:23:55 EST (Fri, 03 Dec 2010)
@@ -372,8 +372,8 @@
//RealType q = 1 - p; // Bad for small p
//RealType probability = 1 - std::pow(q, k+1);
- RealType z = log1p(-p) * (k+1);
- RealType probability = -expm1(z);
+ RealType z = boost::math::log1p(-p) * (k+1);
+ RealType probability = -boost::math::expm1(z);
return probability;
} // cdf Cumulative Distribution Function geometric.
@@ -381,7 +381,7 @@
template <class RealType, class Policy>
inline RealType cdf(const complemented2_type<geometric_distribution<RealType, Policy>, RealType>& c)
{ // Complemented Cumulative Distribution Function geometric.
-
+ BOOST_MATH_STD_USING
static const char* function = "boost::math::cdf(const geometric_distribution<%1%>&, %1%)";
// k argument may be integral, signed, or unsigned, or floating point.
// If necessary, it has already been promoted from an integral type.
@@ -398,7 +398,7 @@
{
return result;
}
- RealType z = log1p(-p) * (k+1);
+ RealType z = boost::math::log1p(-p) * (k+1);
RealType probability = exp(z);
return probability;
} // cdf Complemented Cumulative Distribution Function geometric.
@@ -448,7 +448,7 @@
}
// log(1-x) /log(1-success_fraction) -1; but use log1p in case success_fraction is small
- result = log1p(-x) / log1p(-success_fraction) -1;
+ result = boost::math::log1p(-x) / boost::math::log1p(-success_fraction) -1;
// Subtract a few epsilons here too?
// to make sure it doesn't slip over, so ceil would be one too many.
return result;
@@ -460,7 +460,7 @@
// Return the number of expected failures k for a given
// complement of the probability Q = 1 - P.
static const char* function = "boost::math::quantile(const geometric_distribution<%1%>&, %1%)";
-
+ BOOST_MATH_STD_USING
// Error checks:
RealType x = c.param;
const geometric_distribution<RealType, Policy>& dist = c.dist;
@@ -496,7 +496,7 @@
// unless #define BOOST_MATH_THROW_ON_OVERFLOW_ERROR
}
// log(x) /log(1-success_fraction) -1; but use log1p in case success_fraction is small
- result = log(x) / log1p(-success_fraction) -1;
+ result = log(x) / boost::math::log1p(-success_fraction) -1;
return result;
} // quantile complement
Modified: trunk/boost/math/distributions/inverse_gaussian.hpp
==============================================================================
--- trunk/boost/math/distributions/inverse_gaussian.hpp (original)
+++ trunk/boost/math/distributions/inverse_gaussian.hpp 2010-12-03 11:23:55 EST (Fri, 03 Dec 2010)
@@ -254,6 +254,7 @@
template <class RealType>
inline RealType guess_ig(RealType p, RealType mu = 1, RealType lambda = 1)
{ // guess at random variate value x for inverse gaussian quantile.
+ BOOST_MATH_STD_USING
using boost::math::policies::policy;
// Error type.
using boost::math::policies::overflow_error;
@@ -451,6 +452,7 @@
template <class RealType, class Policy>
inline RealType standard_deviation(const inverse_gaussian_distribution<RealType, Policy>& dist)
{
+ BOOST_MATH_STD_USING
RealType scale = dist.scale();
RealType mean = dist.mean();
RealType result = sqrt(mean * mean * mean / scale);
@@ -460,6 +462,7 @@
template <class RealType, class Policy>
inline RealType mode(const inverse_gaussian_distribution<RealType, Policy>& dist)
{
+ BOOST_MATH_STD_USING
RealType scale = dist.scale();
RealType mean = dist.mean();
RealType result = mean * (sqrt(1 + (9 * mean * mean)/(4 * scale * scale))
@@ -470,6 +473,7 @@
template <class RealType, class Policy>
inline RealType skewness(const inverse_gaussian_distribution<RealType, Policy>& dist)
{
+ BOOST_MATH_STD_USING
RealType scale = dist.scale();
RealType mean = dist.mean();
RealType result = 3 * sqrt(mean/scale);
Modified: trunk/boost/math/distributions/inverse_uniform.hpp
==============================================================================
--- trunk/boost/math/distributions/inverse_uniform.hpp (original)
+++ trunk/boost/math/distributions/inverse_uniform.hpp 2010-12-03 11:23:55 EST (Fri, 03 Dec 2010)
@@ -140,7 +140,7 @@
typedef inverse_uniform_distribution<double> inverse_uniform;
template <class RealType, class Policy>
- inline const std::pair<RealType, RealType> range(const inverse_uniform_distribution<RealType, Policy>& /* dist */)
+ inline const std::pair<RealType, RealType> range(const inverse_uniform_distribution<RealType, Policy>& dist)
{ // Range of permissible values for random variable x.
using boost::math::tools::max_value;
return std::pair<RealType, RealType>(dist.lower(), dist.upper()); // 0 to 1.
Modified: trunk/boost/math/distributions/non_central_beta.hpp
==============================================================================
--- trunk/boost/math/distributions/non_central_beta.hpp (original)
+++ trunk/boost/math/distributions/non_central_beta.hpp 2010-12-03 11:23:55 EST (Fri, 03 Dec 2010)
@@ -18,6 +18,7 @@
#include <boost/math/distributions/detail/common_error_handling.hpp> // error checks
#include <boost/math/special_functions/fpclassify.hpp> // isnan.
#include <boost/math/tools/roots.hpp> // for root finding.
+#include <boost/math/tools/series.hpp>
namespace boost
{
@@ -598,6 +599,46 @@
"function");
}
+ template <class T>
+ struct hypergeometric_2F2_sum
+ {
+ typedef T result_type;
+ hypergeometric_2F2_sum(T a1_, T a2_, T b1_, T b2_, T z_) : a1(a1_), a2(a2_), b1(b1_), b2(b2_), z(z_), term(1), k(0) {}
+ T operator()()
+ {
+ T result = term;
+ term *= a1 * a2 / (b1 * b2);
+ a1 += 1;
+ a2 += 1;
+ b1 += 1;
+ b2 += 1;
+ k += 1;
+ term /= k;
+ term *= z;
+ return result;
+ }
+ T a1, a2, b1, b2, z, term, k;
+ };
+
+ template <class T, class Policy>
+ T hypergeometric_2F2(T a1, T a2, T b1, T b2, T z, const Policy& pol)
+ {
+ typedef typename policies::evaluation<T, Policy>::type value_type;
+
+ const char* function = "boost::math::detail::hypergeometric_2F2<%1%>(%1%,%1%,%1%,%1%,%1%)";
+
+ hypergeometric_2F2_sum<value_type> s(a1, a2, b1, b2, z);
+ boost::uintmax_t max_iter = policies::get_max_series_iterations<Policy>();
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+ value_type zero = 0;
+ value_type result = boost::math::tools::sum_series(s, boost::math::policies::get_epsilon<value_type, Policy>(), max_iter, zero);
+#else
+ value_type result = boost::math::tools::sum_series(s, boost::math::policies::get_epsilon<value_type, Policy>(), max_iter);
+#endif
+ policies::check_series_iterations(function, max_iter, pol);
+ return policies::checked_narrowing_cast<T, Policy>(result, function);
+ }
+
} // namespace detail
template <class RealType = double, class Policy = policies::policy<> >
@@ -693,7 +734,6 @@
function);
}
-#if 1 // re-enable for C# app
//
// We don't have the necessary information to implement
// these at present. These are just disabled for now,
@@ -701,35 +741,50 @@
// later:
//
template <class RealType, class Policy>
- inline RealType mean(const non_central_beta_distribution<RealType, Policy>& /* dist */)
+ inline RealType mean(const non_central_beta_distribution<RealType, Policy>& dist)
{
- // TODO
- return 0; // NaN?
+ BOOST_MATH_STD_USING
+ RealType a = dist.alpha();
+ RealType b = dist.beta();
+ RealType d = dist.non_centrality();
+ RealType apb = a + b;
+ return exp(-d / 2) * a * detail::hypergeometric_2F2(1 + a, apb, a, 1 + apb, d / 2, Policy()) / apb;
} // mean
template <class RealType, class Policy>
- inline RealType variance(const non_central_beta_distribution<RealType, Policy>& /* dist */)
- { // variance.
- //const char* function = "boost::math::non_central_beta_distribution<%1%>::variance()";
- // TODO
- return 0;
+ inline RealType variance(const non_central_beta_distribution<RealType, Policy>& dist)
+ {
+ //
+ // Relative error of this function may be arbitarily large... absolute
+ // error will be small however... that's the best we can do for now.
+ //
+ BOOST_MATH_STD_USING
+ RealType a = dist.alpha();
+ RealType b = dist.beta();
+ RealType d = dist.non_centrality();
+ RealType apb = a + b;
+ RealType result = detail::hypergeometric_2F2(RealType(1 + a), apb, a, RealType(1 + apb), RealType(d / 2), Policy());
+ result *= result * -exp(-d) * a * a / (apb * apb);
+ result += exp(-d / 2) * a * (1 + a) * detail::hypergeometric_2F2(RealType(2 + a), apb, a, RealType(2 + apb), RealType(d / 2), Policy()) / (apb * (1 + apb));
+ return result;
}
+#if 0
// RealType standard_deviation(const non_central_beta_distribution<RealType, Policy>& dist)
// standard_deviation provided by derived accessors.
template <class RealType, class Policy>
- inline RealType skewness(const non_central_beta_distribution<RealType, Policy>& /* dist */)
+ inline RealType skewness(const non_central_beta_distribution<RealType, Policy>& dist)
{ // skewness = sqrt(l).
- //const char* function = "boost::math::non_central_beta_distribution<%1%>::skewness()";
+ const char* function = "boost::math::non_central_beta_distribution<%1%>::skewness()";
// TODO
return 0;
}
template <class RealType, class Policy>
- inline RealType kurtosis_excess(const non_central_beta_distribution<RealType, Policy>& /* dist */)
+ inline RealType kurtosis_excess(const non_central_beta_distribution<RealType, Policy>& dist)
{
- //const char* function = "boost::math::non_central_beta_distribution<%1%>::kurtosis_excess()";
+ const char* function = "boost::math::non_central_beta_distribution<%1%>::kurtosis_excess()";
// TODO
return 0;
} // kurtosis_excess
Modified: trunk/libs/math/test/compile_test/dist_nc_beta_incl_test.cpp
==============================================================================
--- trunk/libs/math/test/compile_test/dist_nc_beta_incl_test.cpp (original)
+++ trunk/libs/math/test/compile_test/dist_nc_beta_incl_test.cpp 2010-12-03 11:23:55 EST (Fri, 03 Dec 2010)
@@ -17,18 +17,6 @@
namespace boost{ namespace math{
template <class T, class Policy>
-T mean(const non_central_beta_distribution<T, Policy>&)
-{
- return 0;
-}
-
-template <class T, class Policy>
-T variance(const non_central_beta_distribution<T, Policy>&)
-{
- return 0;
-}
-
-template <class T, class Policy>
T skewness(const non_central_beta_distribution<T, Policy>&)
{
return 0;
Modified: trunk/libs/math/test/compile_test/instantiate.hpp
==============================================================================
--- trunk/libs/math/test/compile_test/instantiate.hpp (original)
+++ trunk/libs/math/test/compile_test/instantiate.hpp 2010-12-03 11:23:55 EST (Fri, 03 Dec 2010)
@@ -40,10 +40,6 @@
// check everything else:
//
template <class T, class Policy>
-inline T mean(const non_central_beta_distribution<T, Policy>&){ return 0; }
-template <class T, class Policy>
-inline T variance(const non_central_beta_distribution<T, Policy>&){ return 0; }
-template <class T, class Policy>
inline T skewness(const non_central_beta_distribution<T, Policy>&){ return 0; }
template <class T, class Policy>
inline T kurtosis_excess(const non_central_beta_distribution<T, Policy>&){ return 0; }
@@ -68,25 +64,28 @@
function_requires<DistributionConcept<extreme_value_distribution<RealType> > >();
function_requires<DistributionConcept<fisher_f_distribution<RealType> > >();
function_requires<DistributionConcept<gamma_distribution<RealType> > >();
- function_requires<DistributionConcept<inverse_gamma_distribution<RealType> > >();
+ function_requires<DistributionConcept<geometric_distribution<RealType> > >();
+ function_requires<DistributionConcept<hypergeometric_distribution<RealType> > >();
function_requires<DistributionConcept<inverse_chi_squared_distribution<RealType> > >();
+ function_requires<DistributionConcept<inverse_gamma_distribution<RealType> > >();
+ function_requires<DistributionConcept<inverse_gaussian_distribution<RealType> > >();
+ function_requires<DistributionConcept<inverse_uniform_distribution<RealType> > >();
function_requires<DistributionConcept<laplace_distribution<RealType> > >();
function_requires<DistributionConcept<logistic_distribution<RealType> > >();
function_requires<DistributionConcept<lognormal_distribution<RealType> > >();
function_requires<DistributionConcept<negative_binomial_distribution<RealType> > >();
+ function_requires<DistributionConcept<non_central_chi_squared_distribution<RealType> > >();
+ function_requires<DistributionConcept<non_central_beta_distribution<RealType> > >();
+ function_requires<DistributionConcept<non_central_f_distribution<RealType> > >();
+ function_requires<DistributionConcept<non_central_t_distribution<RealType> > >();
function_requires<DistributionConcept<normal_distribution<RealType> > >();
- function_requires<DistributionConcept<rayleigh_distribution<RealType> > >();
function_requires<DistributionConcept<pareto_distribution<RealType> > >();
function_requires<DistributionConcept<poisson_distribution<RealType> > >();
+ function_requires<DistributionConcept<rayleigh_distribution<RealType> > >();
function_requires<DistributionConcept<students_t_distribution<RealType> > >();
function_requires<DistributionConcept<triangular_distribution<RealType> > >();
function_requires<DistributionConcept<uniform_distribution<RealType> > >();
function_requires<DistributionConcept<weibull_distribution<RealType> > >();
- function_requires<DistributionConcept<non_central_chi_squared_distribution<RealType> > >();
- function_requires<DistributionConcept<non_central_beta_distribution<RealType> > >();
- function_requires<DistributionConcept<non_central_f_distribution<RealType> > >();
- function_requires<DistributionConcept<non_central_t_distribution<RealType> > >();
- function_requires<DistributionConcept<hypergeometric_distribution<RealType> > >();
#ifndef BOOST_MATH_INSTANTIATE_MINIMUM
function_requires<DistributionConcept<bernoulli_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<beta_distribution<RealType, test_policy> > >();
@@ -97,25 +96,28 @@
function_requires<DistributionConcept<extreme_value_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<fisher_f_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<gamma_distribution<RealType, test_policy> > >();
- function_requires<DistributionConcept<inverse_gamma_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<geometric_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<hypergeometric_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<inverse_chi_squared_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<inverse_gamma_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<inverse_gaussian_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<inverse_uniform_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<laplace_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<logistic_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<lognormal_distribution<RealType, test_policy> > >();
- function_requires<DistributionConcept<non_central_chi_squared_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<negative_binomial_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<non_central_chi_squared_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<non_central_beta_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<non_central_f_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<non_central_t_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<normal_distribution<RealType, test_policy> > >();
- function_requires<DistributionConcept<rayleigh_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<pareto_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<poisson_distribution<RealType, test_policy> > >();
+ function_requires<DistributionConcept<rayleigh_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<students_t_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<triangular_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<uniform_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<weibull_distribution<RealType, test_policy> > >();
- function_requires<DistributionConcept<non_central_chi_squared_distribution<RealType, test_policy> > >();
- function_requires<DistributionConcept<non_central_beta_distribution<RealType, test_policy> > >();
- function_requires<DistributionConcept<non_central_f_distribution<RealType, test_policy> > >();
- function_requires<DistributionConcept<non_central_t_distribution<RealType, test_policy> > >();
- function_requires<DistributionConcept<hypergeometric_distribution<RealType, test_policy> > >();
function_requires<DistributionConcept<dist_test::bernoulli > >();
function_requires<DistributionConcept<dist_test::beta > >();
@@ -126,21 +128,28 @@
function_requires<DistributionConcept<dist_test::extreme_value > >();
function_requires<DistributionConcept<dist_test::fisher_f > >();
function_requires<DistributionConcept<dist_test::gamma > >();
+ function_requires<DistributionConcept<dist_test::geometric > >();
+ function_requires<DistributionConcept<dist_test::hypergeometric > >();
+ function_requires<DistributionConcept<dist_test::inverse_chi_squared > >();
+ function_requires<DistributionConcept<dist_test::inverse_gamma > >();
+ function_requires<DistributionConcept<dist_test::inverse_gaussian > >();
+ function_requires<DistributionConcept<dist_test::inverse_uniform > >();
+ function_requires<DistributionConcept<dist_test::laplace > >();
function_requires<DistributionConcept<dist_test::logistic > >();
function_requires<DistributionConcept<dist_test::lognormal > >();
function_requires<DistributionConcept<dist_test::negative_binomial > >();
+ function_requires<DistributionConcept<dist_test::non_central_chi_squared > >();
+ function_requires<DistributionConcept<dist_test::non_central_beta > >();
+ function_requires<DistributionConcept<dist_test::non_central_f > >();
+ function_requires<DistributionConcept<dist_test::non_central_t > >();
function_requires<DistributionConcept<dist_test::normal > >();
- function_requires<DistributionConcept<dist_test::rayleigh > >();
function_requires<DistributionConcept<dist_test::pareto > >();
function_requires<DistributionConcept<dist_test::poisson > >();
+ function_requires<DistributionConcept<dist_test::rayleigh > >();
function_requires<DistributionConcept<dist_test::students_t > >();
function_requires<DistributionConcept<dist_test::triangular > >();
function_requires<DistributionConcept<dist_test::uniform > >();
function_requires<DistributionConcept<dist_test::weibull > >();
- function_requires<DistributionConcept<dist_test::non_central_chi_squared > >();
- function_requires<DistributionConcept<dist_test::non_central_beta > >();
- function_requires<DistributionConcept<dist_test::non_central_f > >();
- function_requires<DistributionConcept<dist_test::non_central_t > >();
function_requires<DistributionConcept<dist_test::hypergeometric > >();
#endif
int i;
Modified: trunk/libs/math/test/test_nc_beta.cpp
==============================================================================
--- trunk/libs/math/test/test_nc_beta.cpp (original)
+++ trunk/libs/math/test/test_nc_beta.cpp 2010-12-03 11:23:55 EST (Fri, 03 Dec 2010)
@@ -216,6 +216,7 @@
RealType tolerance = (std::max)(
boost::math::tools::epsilon<RealType>() * 100,
(RealType)1e-6) * 100;
+ RealType abs_tolerance = boost::math::tools::epsilon<RealType>() * 100;
cout << "Tolerance = " << tolerance << "%." << endl;
@@ -260,6 +261,11 @@
RealType(8.020935), // PDF
RealType(tolerance));
+ BOOST_MATH_STD_USING
+ boost::math::non_central_beta_distribution<RealType> dist(100, 3, 63);
+ BOOST_CHECK_CLOSE(mean(dist), 4.82280451915522329944315287538684030781836554279474240490936e13 * exp(-RealType(31.5)) * 100 / 103, tolerance);
+ // Variance only guarentees small absolute error:
+ BOOST_CHECK_SMALL(variance(dist) - static_cast<RealType>(4.85592267707818899235900237275021938334418424134218087127572e13 * exp(RealType(-31.5)) * 100 * 101 / (103 * 104) - 4.82280451915522329944315287538684030781836554279474240490936e13 * 4.82280451915522329944315287538684030781836554279474240490936e13 * exp(RealType(-63)) * 10000 / (103 * 103)), abs_tolerance);
} // template <class RealType>void test_spots(RealType)
template <class T>
@@ -414,20 +420,6 @@
{
BOOST_MATH_CONTROL_FP;
// Basic sanity-check spot values.
-
- using namespace boost::math;
- boost::math::non_central_beta_distribution<double> ncb(1, 2, 3);
-
- double a = ncb.alpha();
- double b = ncb.beta();
- double l = ncb.non_centrality();
- BOOST_CHECK_EQUAL(ncb.alpha(), 1);
- BOOST_CHECK_EQUAL(ncb.beta(), 2);
- BOOST_CHECK_EQUAL(ncb.non_centrality(), 3);
-
- BOOST_CHECK_EQUAL(mean(ncb), 0); // NaN?
- BOOST_CHECK_EQUAL(skewness(ncb), 0);
-
expected_results();
// (Parameter value, arbitrarily zero, only communicates the floating point type).
#ifdef TEST_FLOAT
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