X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libs%2Fmath%2Fexample%2Ffind_mean_and_sd_normal.cpp;h=b3153c846bbd332cdeeef8489125b9260266f19f;hb=08c1e93fa36a49f49325a07fe91ff92c964c2b6c;hp=9a09c7a8c3af427c03bbe9d727f9f80f1bda86d8;hpb=bb4dd8289b351fae6b55e303f189127a394a1edd;p=platform%2Fupstream%2Fboost.git diff --git a/libs/math/example/find_mean_and_sd_normal.cpp b/libs/math/example/find_mean_and_sd_normal.cpp index 9a09c7a..b3153c8 100644 --- a/libs/math/example/find_mean_and_sd_normal.cpp +++ b/libs/math/example/find_mean_and_sd_normal.cpp @@ -116,8 +116,8 @@ cout << "Setting the packer to " << nominal_mean << " will mean that " // Setting the packer to 3.06449 will mean that fraction of packs >= 2.9 is 0.95 /*` -This calculation is generalized as the free function called -[link math_toolkit.dist.dist_ref.dist_algorithms find_location]. +This calculation is generalized as the free function called `find_location`, +see __algorithms. To use this we will need to */ @@ -205,9 +205,9 @@ are not too wide, typically about + and - 10% for hundreds of observations. For other applications, where it is more difficult or expensive to make many observations, the confidence intervals are depressingly wide. -See [link math_toolkit.dist.stat_tut.weg.cs_eg.chi_sq_intervals Confidence Intervals on the standard deviation] +See [link math_toolkit.stat_tut.weg.cs_eg.chi_sq_intervals Confidence Intervals on the standard deviation] for a worked example -[@../../../example/chi_square_std_dev_test.cpp chi_square_std_dev_test.cpp] +[@../../example/chi_square_std_dev_test.cpp chi_square_std_dev_test.cpp] of estimating these intervals. @@ -261,8 +261,7 @@ cout <<"Fraction of packs >= " << minimum_weight << " with a mean of " << mean /*` Now we are getting really close, but to do the job properly, we might need to use root finding method, for example the tools provided, -and used elsewhere, in the Math Toolkit, see -[link math_toolkit.toolkit.internals1.roots2 Root Finding Without Derivatives]. +and used elsewhere, in the Math Toolkit, see __root_finding_without_derivatives But in this (normal) distribution case, we can and should be even smarter and make a direct calculation. @@ -278,7 +277,7 @@ ensuring that 0.95 (95%) of packs are above the minimum weight. Rearranging, we can directly calculate the required standard deviation: */ -normal N01; // standard normal distribution with meamn zero and unit standard deviation. +normal N01; // standard normal distribution with mean zero and unit standard deviation. p = 0.05; double qp = quantile(N01, p); double sd95 = (minimum_weight - mean) / qp; @@ -328,7 +327,7 @@ cout << "find_scale(minimum_weight, under_fraction, packs.mean()); " << // find_scale(minimum_weight, under_fraction, packs.mean()); 0.0607957 /*`But notice that using '1 - over_fraction' - will lead to a -[link why_complements loss of accuracy, especially if over_fraction was close to unity.] +loss of accuracy, especially if over_fraction was close to unity. (See __why_complements). In this (very common) case, we should instead use the __complements, giving the most accurate result. */