2
0
mirror of https://github.com/boostorg/math.git synced 2026-02-26 16:52:27 +00:00

Added Jeffreys prior method to the binomial confidence limits.

Fixed a few typos in the neg binomial.


[SVN r3482]
This commit is contained in:
John Maddock
2006-11-30 10:47:26 +00:00
parent 30c5f9e950
commit ccfb864daf
7 changed files with 223 additions and 95 deletions

View File

@@ -100,6 +100,7 @@ void test_spot(
if(Q < P)
{
// Default method (Clopper Pearson)
BOOST_CHECK(
binomial_distribution<RealType>::estimate_lower_bound_on_p(
N, k, Q)
@@ -114,9 +115,25 @@ void test_spot(
binomial_distribution<RealType>::estimate_upper_bound_on_p(
N, k, Q))
);
// Bayes Method (Jeffreys Prior)
BOOST_CHECK(
binomial_distribution<RealType>::estimate_lower_bound_on_p(
N, k, Q, binomial_distribution<RealType>::jeffreys_prior_interval)
<=
binomial_distribution<RealType>::estimate_upper_bound_on_p(
N, k, Q, binomial_distribution<RealType>::jeffreys_prior_interval)
);
BOOST_CHECK((
binomial_distribution<RealType>::estimate_lower_bound_on_p(
N, k, Q, binomial_distribution<RealType>::jeffreys_prior_interval)
<= k/N) && (k/N <=
binomial_distribution<RealType>::estimate_upper_bound_on_p(
N, k, Q, binomial_distribution<RealType>::jeffreys_prior_interval))
);
}
else
{
// Default method (Clopper Pearson)
BOOST_CHECK(
binomial_distribution<RealType>::estimate_lower_bound_on_p(
N, k, P)
@@ -131,6 +148,21 @@ void test_spot(
binomial_distribution<RealType>::estimate_upper_bound_on_p(
N, k, P))
);
// Bayes Method (Jeffreys Prior)
BOOST_CHECK(
binomial_distribution<RealType>::estimate_lower_bound_on_p(
N, k, P, binomial_distribution<RealType>::jeffreys_prior_interval)
<=
binomial_distribution<RealType>::estimate_upper_bound_on_p(
N, k, P, binomial_distribution<RealType>::jeffreys_prior_interval)
);
BOOST_CHECK(
(binomial_distribution<RealType>::estimate_lower_bound_on_p(
N, k, P, binomial_distribution<RealType>::jeffreys_prior_interval)
<= k / N) && (k/N <=
binomial_distribution<RealType>::estimate_upper_bound_on_p(
N, k, P, binomial_distribution<RealType>::jeffreys_prior_interval))
);
}
}
//