Ticket #4515: math.diff
File math.diff, 5.0 KB (added by , 12 years ago) |
---|
-
libs/math/example/binomial_confidence_limits.cpp
56 56 // Confidence value: 57 57 cout << fixed << setprecision(3) << setw(10) << right << 100 * (1-alpha[i]); 58 58 // Calculate Clopper Pearson bounds: 59 double l = b inomial_distribution<>::find_lower_bound_on_p(trials, successes, alpha[i]/2);60 double u = b inomial_distribution<>::find_upper_bound_on_p(trials, successes, alpha[i]/2);59 double l = boost::math::binomial_distribution<>::find_lower_bound_on_p(trials, successes, alpha[i]/2); 60 double u = boost::math::binomial_distribution<>::find_upper_bound_on_p(trials, successes, alpha[i]/2); 61 61 // Print Clopper Pearson Limits: 62 62 cout << fixed << setprecision(5) << setw(15) << right << l; 63 63 cout << fixed << setprecision(5) << setw(15) << right << u; 64 64 // Calculate Jeffreys Prior Bounds: 65 l = b inomial_distribution<>::find_lower_bound_on_p(trials, successes, alpha[i]/2,binomial_distribution<>::jeffreys_prior_interval);66 u = b inomial_distribution<>::find_upper_bound_on_p(trials, successes, alpha[i]/2,binomial_distribution<>::jeffreys_prior_interval);65 l = boost::math::binomial_distribution<>::find_lower_bound_on_p(trials, successes, alpha[i]/2, boost::math::binomial_distribution<>::jeffreys_prior_interval); 66 u = boost::math::binomial_distribution<>::find_upper_bound_on_p(trials, successes, alpha[i]/2, boost::math::binomial_distribution<>::jeffreys_prior_interval); 67 67 // Print Jeffreys Prior Limits: 68 68 cout << fixed << setprecision(5) << setw(15) << right << l; 69 69 cout << fixed << setprecision(5) << setw(15) << right << u << std::endl; -
libs/math/example/binomial_sample_sizes.cpp
56 56 // Confidence value: 57 57 cout << fixed << setprecision(3) << setw(10) << right << 100 * (1-alpha[i]); 58 58 // calculate trials: 59 double t = b inomial_distribution<>::find_maximum_number_of_trials(successes, p, alpha[i]);59 double t = boost::math::binomial_distribution<>::find_maximum_number_of_trials(successes, p, alpha[i]); 60 60 t = floor(t); 61 61 // Print Trials: 62 62 cout << fixed << setprecision(0) << setw(15) << right << t << endl; -
libs/math/test/test_lognormal.cpp
246 246 // 247 247 // Error checks: 248 248 // 249 BOOST_CHECK_THROW( lognormal_distribution<RealType>(0, -1), std::domain_error);249 BOOST_CHECK_THROW(boost::math::lognormal_distribution<RealType>(0, -1), std::domain_error); 250 250 BOOST_CHECK_THROW(pdf(dist, -1), std::domain_error); 251 251 BOOST_CHECK_THROW(cdf(dist, -1), std::domain_error); 252 252 BOOST_CHECK_THROW(cdf(complement(dist, -1)), std::domain_error); -
libs/math/test/test_normal.cpp
261 261 kurtosis_excess(dist) 262 262 , static_cast<RealType>(0), tol2); 263 263 264 normal_distribution<RealType> norm01(0, 1); // Test default (0, 1)264 boost::math::normal_distribution<RealType> norm01(0, 1); // Test default (0, 1) 265 265 BOOST_CHECK_CLOSE( 266 266 mean(norm01), 267 267 static_cast<RealType>(0), 0); // Mean == zero 268 268 269 normal_distribution<RealType> defsd_norm01(0); // Test default (0, sd = 1)269 boost::math::normal_distribution<RealType> defsd_norm01(0); // Test default (0, sd = 1) 270 270 BOOST_CHECK_CLOSE( 271 271 mean(defsd_norm01), 272 272 static_cast<RealType>(0), 0); // Mean == zero 273 273 274 normal_distribution<RealType> def_norm01; // Test default (0, sd = 1)274 boost::math::normal_distribution<RealType> def_norm01; // Test default (0, sd = 1) 275 275 BOOST_CHECK_CLOSE( 276 276 mean(def_norm01), 277 277 static_cast<RealType>(0), 0); // Mean == zero -
libs/math/test/test_weibull.cpp
318 318 // 319 319 // Error checks: 320 320 // 321 BOOST_CHECK_THROW( weibull_distribution<RealType>(0, -1), std::domain_error);322 BOOST_CHECK_THROW( weibull_distribution<RealType>(-1, 1), std::domain_error);321 BOOST_CHECK_THROW(boost::math::weibull_distribution<RealType>(0, -1), std::domain_error); 322 BOOST_CHECK_THROW(boost::math::weibull_distribution<RealType>(-1, 1), std::domain_error); 323 323 BOOST_CHECK_THROW(pdf(dist, -1), std::domain_error); 324 324 BOOST_CHECK_THROW(cdf(dist, -1), std::domain_error); 325 325 BOOST_CHECK_THROW(cdf(complement(dist, -1)), std::domain_error);