geometric.hpp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. // boost\math\distributions\geometric.hpp
  2. // Copyright John Maddock 2010.
  3. // Copyright Paul A. Bristow 2010.
  4. // Use, modification and distribution are subject to the
  5. // Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt
  7. // or copy at http://www.boost.org/LICENSE_1_0.txt)
  8. // geometric distribution is a discrete probability distribution.
  9. // It expresses the probability distribution of the number (k) of
  10. // events, occurrences, failures or arrivals before the first success.
  11. // supported on the set {0, 1, 2, 3...}
  12. // Note that the set includes zero (unlike some definitions that start at one).
  13. // The random variate k is the number of events, occurrences or arrivals.
  14. // k argument may be integral, signed, or unsigned, or floating point.
  15. // If necessary, it has already been promoted from an integral type.
  16. // Note that the geometric distribution
  17. // (like others including the binomial, geometric & Bernoulli)
  18. // is strictly defined as a discrete function:
  19. // only integral values of k are envisaged.
  20. // However because the method of calculation uses a continuous gamma function,
  21. // it is convenient to treat it as if a continuous function,
  22. // and permit non-integral values of k.
  23. // To enforce the strict mathematical model, users should use floor or ceil functions
  24. // on k outside this function to ensure that k is integral.
  25. // See http://en.wikipedia.org/wiki/geometric_distribution
  26. // http://documents.wolfram.com/v5/Add-onsLinks/StandardPackages/Statistics/DiscreteDistributions.html
  27. // http://mathworld.wolfram.com/GeometricDistribution.html
  28. #ifndef BOOST_MATH_SPECIAL_GEOMETRIC_HPP
  29. #define BOOST_MATH_SPECIAL_GEOMETRIC_HPP
  30. #include <boost/math/distributions/fwd.hpp>
  31. #include <boost/math/special_functions/beta.hpp> // for ibeta(a, b, x) == Ix(a, b).
  32. #include <boost/math/distributions/complement.hpp> // complement.
  33. #include <boost/math/distributions/detail/common_error_handling.hpp> // error checks domain_error & logic_error.
  34. #include <boost/math/special_functions/fpclassify.hpp> // isnan.
  35. #include <boost/math/tools/roots.hpp> // for root finding.
  36. #include <boost/math/distributions/detail/inv_discrete_quantile.hpp>
  37. #include <boost/math/special_functions/log1p.hpp>
  38. #include <limits> // using std::numeric_limits;
  39. #include <utility>
  40. #include <cmath>
  41. #if defined (BOOST_MSVC)
  42. # pragma warning(push)
  43. // This believed not now necessary, so commented out.
  44. //# pragma warning(disable: 4702) // unreachable code.
  45. // in domain_error_imp in error_handling.
  46. #endif
  47. namespace boost
  48. {
  49. namespace math
  50. {
  51. namespace geometric_detail
  52. {
  53. // Common error checking routines for geometric distribution function:
  54. template <class RealType, class Policy>
  55. inline bool check_success_fraction(const char* function, const RealType& p, RealType* result, const Policy& pol)
  56. {
  57. if( !(boost::math::isfinite)(p) || (p < 0) || (p > 1) )
  58. {
  59. *result = policies::raise_domain_error<RealType>(
  60. function,
  61. "Success fraction argument is %1%, but must be >= 0 and <= 1 !", p, pol);
  62. return false;
  63. }
  64. return true;
  65. }
  66. template <class RealType, class Policy>
  67. inline bool check_dist(const char* function, const RealType& p, RealType* result, const Policy& pol)
  68. {
  69. return check_success_fraction(function, p, result, pol);
  70. }
  71. template <class RealType, class Policy>
  72. inline bool check_dist_and_k(const char* function, const RealType& p, RealType k, RealType* result, const Policy& pol)
  73. {
  74. if(check_dist(function, p, result, pol) == false)
  75. {
  76. return false;
  77. }
  78. if( !(boost::math::isfinite)(k) || (k < 0) )
  79. { // Check k failures.
  80. *result = policies::raise_domain_error<RealType>(
  81. function,
  82. "Number of failures argument is %1%, but must be >= 0 !", k, pol);
  83. return false;
  84. }
  85. return true;
  86. } // Check_dist_and_k
  87. template <class RealType, class Policy>
  88. inline bool check_dist_and_prob(const char* function, RealType p, RealType prob, RealType* result, const Policy& pol)
  89. {
  90. if((check_dist(function, p, result, pol) && detail::check_probability(function, prob, result, pol)) == false)
  91. {
  92. return false;
  93. }
  94. return true;
  95. } // check_dist_and_prob
  96. } // namespace geometric_detail
  97. template <class RealType = double, class Policy = policies::policy<> >
  98. class geometric_distribution
  99. {
  100. public:
  101. typedef RealType value_type;
  102. typedef Policy policy_type;
  103. geometric_distribution(RealType p) : m_p(p)
  104. { // Constructor stores success_fraction p.
  105. RealType result;
  106. geometric_detail::check_dist(
  107. "geometric_distribution<%1%>::geometric_distribution",
  108. m_p, // Check success_fraction 0 <= p <= 1.
  109. &result, Policy());
  110. } // geometric_distribution constructor.
  111. // Private data getter class member functions.
  112. RealType success_fraction() const
  113. { // Probability of success as fraction in range 0 to 1.
  114. return m_p;
  115. }
  116. RealType successes() const
  117. { // Total number of successes r = 1 (for compatibility with negative binomial?).
  118. return 1;
  119. }
  120. // Parameter estimation.
  121. // (These are copies of negative_binomial distribution with successes = 1).
  122. static RealType find_lower_bound_on_p(
  123. RealType trials,
  124. RealType alpha) // alpha 0.05 equivalent to 95% for one-sided test.
  125. {
  126. static const char* function = "boost::math::geometric<%1%>::find_lower_bound_on_p";
  127. RealType result = 0; // of error checks.
  128. RealType successes = 1;
  129. RealType failures = trials - successes;
  130. if(false == detail::check_probability(function, alpha, &result, Policy())
  131. && geometric_detail::check_dist_and_k(
  132. function, RealType(0), failures, &result, Policy()))
  133. {
  134. return result;
  135. }
  136. // Use complement ibeta_inv function for lower bound.
  137. // This is adapted from the corresponding binomial formula
  138. // here: http://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm
  139. // This is a Clopper-Pearson interval, and may be overly conservative,
  140. // see also "A Simple Improved Inferential Method for Some
  141. // Discrete Distributions" Yong CAI and K. KRISHNAMOORTHY
  142. // http://www.ucs.louisiana.edu/~kxk4695/Discrete_new.pdf
  143. //
  144. return ibeta_inv(successes, failures + 1, alpha, static_cast<RealType*>(nullptr), Policy());
  145. } // find_lower_bound_on_p
  146. static RealType find_upper_bound_on_p(
  147. RealType trials,
  148. RealType alpha) // alpha 0.05 equivalent to 95% for one-sided test.
  149. {
  150. static const char* function = "boost::math::geometric<%1%>::find_upper_bound_on_p";
  151. RealType result = 0; // of error checks.
  152. RealType successes = 1;
  153. RealType failures = trials - successes;
  154. if(false == geometric_detail::check_dist_and_k(
  155. function, RealType(0), failures, &result, Policy())
  156. && detail::check_probability(function, alpha, &result, Policy()))
  157. {
  158. return result;
  159. }
  160. if(failures == 0)
  161. {
  162. return 1;
  163. }// Use complement ibetac_inv function for upper bound.
  164. // Note adjusted failures value: *not* failures+1 as usual.
  165. // This is adapted from the corresponding binomial formula
  166. // here: http://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm
  167. // This is a Clopper-Pearson interval, and may be overly conservative,
  168. // see also "A Simple Improved Inferential Method for Some
  169. // Discrete Distributions" Yong CAI and K. Krishnamoorthy
  170. // http://www.ucs.louisiana.edu/~kxk4695/Discrete_new.pdf
  171. //
  172. return ibetac_inv(successes, failures, alpha, static_cast<RealType*>(nullptr), Policy());
  173. } // find_upper_bound_on_p
  174. // Estimate number of trials :
  175. // "How many trials do I need to be P% sure of seeing k or fewer failures?"
  176. static RealType find_minimum_number_of_trials(
  177. RealType k, // number of failures (k >= 0).
  178. RealType p, // success fraction 0 <= p <= 1.
  179. RealType alpha) // risk level threshold 0 <= alpha <= 1.
  180. {
  181. static const char* function = "boost::math::geometric<%1%>::find_minimum_number_of_trials";
  182. // Error checks:
  183. RealType result = 0;
  184. if(false == geometric_detail::check_dist_and_k(
  185. function, p, k, &result, Policy())
  186. && detail::check_probability(function, alpha, &result, Policy()))
  187. {
  188. return result;
  189. }
  190. result = ibeta_inva(k + 1, p, alpha, Policy()); // returns n - k
  191. return result + k;
  192. } // RealType find_number_of_failures
  193. static RealType find_maximum_number_of_trials(
  194. RealType k, // number of failures (k >= 0).
  195. RealType p, // success fraction 0 <= p <= 1.
  196. RealType alpha) // risk level threshold 0 <= alpha <= 1.
  197. {
  198. static const char* function = "boost::math::geometric<%1%>::find_maximum_number_of_trials";
  199. // Error checks:
  200. RealType result = 0;
  201. if(false == geometric_detail::check_dist_and_k(
  202. function, p, k, &result, Policy())
  203. && detail::check_probability(function, alpha, &result, Policy()))
  204. {
  205. return result;
  206. }
  207. result = ibetac_inva(k + 1, p, alpha, Policy()); // returns n - k
  208. return result + k;
  209. } // RealType find_number_of_trials complemented
  210. private:
  211. //RealType m_r; // successes fixed at unity.
  212. RealType m_p; // success_fraction
  213. }; // template <class RealType, class Policy> class geometric_distribution
  214. typedef geometric_distribution<double> geometric; // Reserved name of type double.
  215. #ifdef __cpp_deduction_guides
  216. template <class RealType>
  217. geometric_distribution(RealType)->geometric_distribution<typename boost::math::tools::promote_args<RealType>::type>;
  218. #endif
  219. template <class RealType, class Policy>
  220. inline const std::pair<RealType, RealType> range(const geometric_distribution<RealType, Policy>& /* dist */)
  221. { // Range of permissible values for random variable k.
  222. using boost::math::tools::max_value;
  223. return std::pair<RealType, RealType>(static_cast<RealType>(0), max_value<RealType>()); // max_integer?
  224. }
  225. template <class RealType, class Policy>
  226. inline const std::pair<RealType, RealType> support(const geometric_distribution<RealType, Policy>& /* dist */)
  227. { // Range of supported values for random variable k.
  228. // This is range where cdf rises from 0 to 1, and outside it, the pdf is zero.
  229. using boost::math::tools::max_value;
  230. return std::pair<RealType, RealType>(static_cast<RealType>(0), max_value<RealType>()); // max_integer?
  231. }
  232. template <class RealType, class Policy>
  233. inline RealType mean(const geometric_distribution<RealType, Policy>& dist)
  234. { // Mean of geometric distribution = (1-p)/p.
  235. return (1 - dist.success_fraction() ) / dist.success_fraction();
  236. } // mean
  237. // median implemented via quantile(half) in derived accessors.
  238. template <class RealType, class Policy>
  239. inline RealType mode(const geometric_distribution<RealType, Policy>&)
  240. { // Mode of geometric distribution = zero.
  241. BOOST_MATH_STD_USING // ADL of std functions.
  242. return 0;
  243. } // mode
  244. template <class RealType, class Policy>
  245. inline RealType variance(const geometric_distribution<RealType, Policy>& dist)
  246. { // Variance of Binomial distribution = (1-p) / p^2.
  247. return (1 - dist.success_fraction())
  248. / (dist.success_fraction() * dist.success_fraction());
  249. } // variance
  250. template <class RealType, class Policy>
  251. inline RealType skewness(const geometric_distribution<RealType, Policy>& dist)
  252. { // skewness of geometric distribution = 2-p / (sqrt(r(1-p))
  253. BOOST_MATH_STD_USING // ADL of std functions.
  254. RealType p = dist.success_fraction();
  255. return (2 - p) / sqrt(1 - p);
  256. } // skewness
  257. template <class RealType, class Policy>
  258. inline RealType kurtosis(const geometric_distribution<RealType, Policy>& dist)
  259. { // kurtosis of geometric distribution
  260. // http://en.wikipedia.org/wiki/geometric is kurtosis_excess so add 3
  261. RealType p = dist.success_fraction();
  262. return 3 + (p*p - 6*p + 6) / (1 - p);
  263. } // kurtosis
  264. template <class RealType, class Policy>
  265. inline RealType kurtosis_excess(const geometric_distribution<RealType, Policy>& dist)
  266. { // kurtosis excess of geometric distribution
  267. // http://mathworld.wolfram.com/Kurtosis.html table of kurtosis_excess
  268. RealType p = dist.success_fraction();
  269. return (p*p - 6*p + 6) / (1 - p);
  270. } // kurtosis_excess
  271. // RealType standard_deviation(const geometric_distribution<RealType, Policy>& dist)
  272. // standard_deviation provided by derived accessors.
  273. // RealType hazard(const geometric_distribution<RealType, Policy>& dist)
  274. // hazard of geometric distribution provided by derived accessors.
  275. // RealType chf(const geometric_distribution<RealType, Policy>& dist)
  276. // chf of geometric distribution provided by derived accessors.
  277. template <class RealType, class Policy>
  278. inline RealType pdf(const geometric_distribution<RealType, Policy>& dist, const RealType& k)
  279. { // Probability Density/Mass Function.
  280. BOOST_FPU_EXCEPTION_GUARD
  281. BOOST_MATH_STD_USING // For ADL of math functions.
  282. static const char* function = "boost::math::pdf(const geometric_distribution<%1%>&, %1%)";
  283. RealType p = dist.success_fraction();
  284. RealType result = 0;
  285. if(false == geometric_detail::check_dist_and_k(
  286. function,
  287. p,
  288. k,
  289. &result, Policy()))
  290. {
  291. return result;
  292. }
  293. if (k == 0)
  294. {
  295. return p; // success_fraction
  296. }
  297. RealType q = 1 - p; // Inaccurate for small p?
  298. // So try to avoid inaccuracy for large or small p.
  299. // but has little effect > last significant bit.
  300. //cout << "p * pow(q, k) " << result << endl; // seems best whatever p
  301. //cout << "exp(p * k * log1p(-p)) " << p * exp(k * log1p(-p)) << endl;
  302. //if (p < 0.5)
  303. //{
  304. // result = p * pow(q, k);
  305. //}
  306. //else
  307. //{
  308. // result = p * exp(k * log1p(-p));
  309. //}
  310. result = p * pow(q, k);
  311. return result;
  312. } // geometric_pdf
  313. template <class RealType, class Policy>
  314. inline RealType cdf(const geometric_distribution<RealType, Policy>& dist, const RealType& k)
  315. { // Cumulative Distribution Function of geometric.
  316. static const char* function = "boost::math::cdf(const geometric_distribution<%1%>&, %1%)";
  317. // k argument may be integral, signed, or unsigned, or floating point.
  318. // If necessary, it has already been promoted from an integral type.
  319. RealType p = dist.success_fraction();
  320. // Error check:
  321. RealType result = 0;
  322. if(false == geometric_detail::check_dist_and_k(
  323. function,
  324. p,
  325. k,
  326. &result, Policy()))
  327. {
  328. return result;
  329. }
  330. if(k == 0)
  331. {
  332. return p; // success_fraction
  333. }
  334. //RealType q = 1 - p; // Bad for small p
  335. //RealType probability = 1 - std::pow(q, k+1);
  336. RealType z = boost::math::log1p(-p, Policy()) * (k + 1);
  337. RealType probability = -boost::math::expm1(z, Policy());
  338. return probability;
  339. } // cdf Cumulative Distribution Function geometric.
  340. template <class RealType, class Policy>
  341. inline RealType logcdf(const geometric_distribution<RealType, Policy>& dist, const RealType& k)
  342. { // Cumulative Distribution Function of geometric.
  343. using std::pow;
  344. using std::log;
  345. using std::exp;
  346. static const char* function = "boost::math::logcdf(const geometric_distribution<%1%>&, %1%)";
  347. // k argument may be integral, signed, or unsigned, or floating point.
  348. // If necessary, it has already been promoted from an integral type.
  349. RealType p = dist.success_fraction();
  350. // Error check:
  351. RealType result = 0;
  352. if(false == geometric_detail::check_dist_and_k(
  353. function,
  354. p,
  355. k,
  356. &result, Policy()))
  357. {
  358. return -std::numeric_limits<RealType>::infinity();
  359. }
  360. if(k == 0)
  361. {
  362. return log(p); // success_fraction
  363. }
  364. //RealType q = 1 - p; // Bad for small p
  365. //RealType probability = 1 - std::pow(q, k+1);
  366. RealType z = boost::math::log1p(-p, Policy()) * (k + 1);
  367. return log1p(-exp(z), Policy());
  368. } // logcdf Cumulative Distribution Function geometric.
  369. template <class RealType, class Policy>
  370. inline RealType cdf(const complemented2_type<geometric_distribution<RealType, Policy>, RealType>& c)
  371. { // Complemented Cumulative Distribution Function geometric.
  372. BOOST_MATH_STD_USING
  373. static const char* function = "boost::math::cdf(const geometric_distribution<%1%>&, %1%)";
  374. // k argument may be integral, signed, or unsigned, or floating point.
  375. // If necessary, it has already been promoted from an integral type.
  376. RealType const& k = c.param;
  377. geometric_distribution<RealType, Policy> const& dist = c.dist;
  378. RealType p = dist.success_fraction();
  379. // Error check:
  380. RealType result = 0;
  381. if(false == geometric_detail::check_dist_and_k(
  382. function,
  383. p,
  384. k,
  385. &result, Policy()))
  386. {
  387. return result;
  388. }
  389. RealType z = boost::math::log1p(-p, Policy()) * (k+1);
  390. RealType probability = exp(z);
  391. return probability;
  392. } // cdf Complemented Cumulative Distribution Function geometric.
  393. template <class RealType, class Policy>
  394. inline RealType logcdf(const complemented2_type<geometric_distribution<RealType, Policy>, RealType>& c)
  395. { // Complemented Cumulative Distribution Function geometric.
  396. BOOST_MATH_STD_USING
  397. static const char* function = "boost::math::logcdf(const geometric_distribution<%1%>&, %1%)";
  398. // k argument may be integral, signed, or unsigned, or floating point.
  399. // If necessary, it has already been promoted from an integral type.
  400. RealType const& k = c.param;
  401. geometric_distribution<RealType, Policy> const& dist = c.dist;
  402. RealType p = dist.success_fraction();
  403. // Error check:
  404. RealType result = 0;
  405. if(false == geometric_detail::check_dist_and_k(
  406. function,
  407. p,
  408. k,
  409. &result, Policy()))
  410. {
  411. return -std::numeric_limits<RealType>::infinity();
  412. }
  413. return boost::math::log1p(-p, Policy()) * (k+1);
  414. } // logcdf Complemented Cumulative Distribution Function geometric.
  415. template <class RealType, class Policy>
  416. inline RealType quantile(const geometric_distribution<RealType, Policy>& dist, const RealType& x)
  417. { // Quantile, percentile/100 or Percent Point geometric function.
  418. // Return the number of expected failures k for a given probability p.
  419. // Inverse cumulative Distribution Function or Quantile (percentile / 100) of geometric Probability.
  420. // k argument may be integral, signed, or unsigned, or floating point.
  421. static const char* function = "boost::math::quantile(const geometric_distribution<%1%>&, %1%)";
  422. BOOST_MATH_STD_USING // ADL of std functions.
  423. RealType success_fraction = dist.success_fraction();
  424. // Check dist and x.
  425. RealType result = 0;
  426. if(false == geometric_detail::check_dist_and_prob
  427. (function, success_fraction, x, &result, Policy()))
  428. {
  429. return result;
  430. }
  431. // Special cases.
  432. if (x == 1)
  433. { // Would need +infinity failures for total confidence.
  434. result = policies::raise_overflow_error<RealType>(
  435. function,
  436. "Probability argument is 1, which implies infinite failures !", Policy());
  437. return result;
  438. // usually means return +std::numeric_limits<RealType>::infinity();
  439. // unless #define BOOST_MATH_THROW_ON_OVERFLOW_ERROR
  440. }
  441. if (x == 0)
  442. { // No failures are expected if P = 0.
  443. return 0; // Total trials will be just dist.successes.
  444. }
  445. // if (P <= pow(dist.success_fraction(), 1))
  446. if (x <= success_fraction)
  447. { // p <= pdf(dist, 0) == cdf(dist, 0)
  448. return 0;
  449. }
  450. if (x == 1)
  451. {
  452. return 0;
  453. }
  454. // log(1-x) /log(1-success_fraction) -1; but use log1p in case success_fraction is small
  455. result = boost::math::log1p(-x, Policy()) / boost::math::log1p(-success_fraction, Policy()) - 1;
  456. // Subtract a few epsilons here too?
  457. // to make sure it doesn't slip over, so ceil would be one too many.
  458. return result;
  459. } // RealType quantile(const geometric_distribution dist, p)
  460. template <class RealType, class Policy>
  461. inline RealType quantile(const complemented2_type<geometric_distribution<RealType, Policy>, RealType>& c)
  462. { // Quantile or Percent Point Binomial function.
  463. // Return the number of expected failures k for a given
  464. // complement of the probability Q = 1 - P.
  465. static const char* function = "boost::math::quantile(const geometric_distribution<%1%>&, %1%)";
  466. BOOST_MATH_STD_USING
  467. // Error checks:
  468. RealType x = c.param;
  469. const geometric_distribution<RealType, Policy>& dist = c.dist;
  470. RealType success_fraction = dist.success_fraction();
  471. RealType result = 0;
  472. if(false == geometric_detail::check_dist_and_prob(
  473. function,
  474. success_fraction,
  475. x,
  476. &result, Policy()))
  477. {
  478. return result;
  479. }
  480. // Special cases:
  481. if(x == 1)
  482. { // There may actually be no answer to this question,
  483. // since the probability of zero failures may be non-zero,
  484. return 0; // but zero is the best we can do:
  485. }
  486. if (-x <= boost::math::powm1(dist.success_fraction(), dist.successes(), Policy()))
  487. { // q <= cdf(complement(dist, 0)) == pdf(dist, 0)
  488. return 0; //
  489. }
  490. if(x == 0)
  491. { // Probability 1 - Q == 1 so infinite failures to achieve certainty.
  492. // Would need +infinity failures for total confidence.
  493. result = policies::raise_overflow_error<RealType>(
  494. function,
  495. "Probability argument complement is 0, which implies infinite failures !", Policy());
  496. return result;
  497. // usually means return +std::numeric_limits<RealType>::infinity();
  498. // unless #define BOOST_MATH_THROW_ON_OVERFLOW_ERROR
  499. }
  500. // log(x) /log(1-success_fraction) -1; but use log1p in case success_fraction is small
  501. result = log(x) / boost::math::log1p(-success_fraction, Policy()) - 1;
  502. return result;
  503. } // quantile complement
  504. } // namespace math
  505. } // namespace boost
  506. // This include must be at the end, *after* the accessors
  507. // for this distribution have been defined, in order to
  508. // keep compilers that support two-phase lookup happy.
  509. #include <boost/math/distributions/detail/derived_accessors.hpp>
  510. #if defined (BOOST_MSVC)
  511. # pragma warning(pop)
  512. #endif
  513. #endif // BOOST_MATH_SPECIAL_GEOMETRIC_HPP