|
Boost-Commit : |
From: john_at_[hidden]
Date: 2008-02-28 14:12:03
Author: johnmaddock
Date: 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
New Revision: 43430
URL: http://svn.boost.org/trac/boost/changeset/43430
Log:
Fix mode of the weibull distribution.
Add distribution new graphs as PNG and SVG, and change quickbook to reference them.
Update dist graph generator.
Added:
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/acosh.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/asinh.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/atanh.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/bernoulli_cdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/bernoulli_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/beta_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/binomial_pdf_1.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/binomial_pdf_2.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/cauchy_pdf1.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/cauchy_pdf1.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/cauchy_pdf2.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/cauchy_pdf2.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/cbrt.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/chi_squared_pdf.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/chi_squared_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/erf.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/erfc.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/expm1.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/exponential_pdf.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/exponential_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/extreme_value_pdf1.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/extreme_value_pdf1.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/extreme_value_pdf2.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/extreme_value_pdf2.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/fisher_f_pdf.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/fisher_f_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/gamma1_pdf.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/gamma1_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/gamma2_pdf.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/gamma2_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/legendre_p.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/log1p.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/lognormal_pdf1.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/lognormal_pdf1.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/lognormal_pdf2.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/lognormal_pdf2.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nc_beta_pdf.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nc_beta_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nc_f_pdf.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nc_f_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nc_t_pdf.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nc_t_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nccs_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/negative_binomial_pdf_1.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/negative_binomial_pdf_1.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/negative_binomial_pdf_2.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/negative_binomial_pdf_2.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/normal_pdf.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/normal_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/pareto_pdf1.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/pareto_pdf1.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/pareto_pdf2.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/pareto_pdf2.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/poisson_pdf_1.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/poisson_pdf_1.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/rayleigh_cdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/rayleigh_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/sinc_pi.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/sinhc_pi.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/sqrt1pm1.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/students_t_pdf.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/students_t_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/tgamma.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/tgamma_delta_ratio.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/triangular_cdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/triangular_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/uniform_cdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/uniform_pdf.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/weibull_pdf1.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/weibull_pdf1.svg (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/weibull_pdf2.png (contents, props changed)
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/weibull_pdf2.svg (contents, props changed)
Binary files modified:
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/bernoulli_cdf.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/bernoulli_pdf.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/beta.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/beta_pdf.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/binomial_pdf_1.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/binomial_pdf_2.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/digamma.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/erf_inv.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/erfc_inv.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/expint2.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/expint_i.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/gamma_p.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/gamma_q.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/ibeta.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/legendre_q.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/lgamma.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nccs_pdf.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/rayleigh_cdf.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/rayleigh_pdf.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/triangular_cdf.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/triangular_pdf.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/uniform_cdf.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/uniform_pdf.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/zeta1.png
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/zeta2.png
Text files modified:
sandbox/math_toolkit/boost/math/distributions/weibull.hpp | 2
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/bernoulli.qbk | 4
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/beta.qbk | 2
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/binomial.qbk | 4
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/cauchy.qbk | 4
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/chi_squared.qbk | 2
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/exponential.qbk | 2
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/extreme_value.qbk | 4
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/fisher.qbk | 2
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/gamma.qbk | 4
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/lognormal.qbk | 4
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_beta.qbk | 2
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_chi_squared.qbk | 2
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_f.qbk | 2
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_t.qbk | 2
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/negative_binomial.qbk | 4
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/normal.qbk | 2
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/pareto.qbk | 11 +
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/poisson.qbk | 2
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/rayleigh.qbk | 4
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/students_t.qbk | 2
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/triangular.qbk | 4
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/uniform.qbk | 4
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/weibull.qbk | 4
sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/dist_graphs.cpp | 241 ++++++++++++++++++++++++++++++++++-----
sandbox/math_toolkit/libs/math/doc/sf_and_dist/math.qbk | 9 +
26 files changed, 259 insertions(+), 70 deletions(-)
Modified: sandbox/math_toolkit/boost/math/distributions/weibull.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/weibull.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/weibull.hpp 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -286,6 +286,8 @@
{
return result;
}
+ if(shape <= 1)
+ return 0;
result = scale * pow((shape - 1) / shape, 1 / shape);
return result;
}
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/bernoulli.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/bernoulli.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/bernoulli.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -42,11 +42,11 @@
[@http://en.wikipedia.org/wiki/Probability_density_function probability density function pdf]
varies with the outcome of the single trial:
-[$../graphs/bernoulli_pdf.png]
+[graph bernoulli_pdf]
and the [@http://en.wikipedia.org/wiki/Cumulative_Distribution_Function Cumulative distribution function]
-[$../graphs/bernoulli_cdf.png]
+[graph bernoulli_cdf]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/beta.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/beta.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/beta.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -84,7 +84,7 @@
is dome-shaped, and might be approximated by a symmetrical triangular
distribution.
-[$../graphs/beta_dist.png]
+[graph beta_pdf]
If [alpha] = [beta] = 1, then it is a __space
[@http://en.wikipedia.org/wiki/Uniform_distribution_%28continuous%29 uniform distribution],
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/binomial.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/binomial.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/binomial.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -76,12 +76,12 @@
upon the distributions parameters, first we'll keep the success
fraction /p/ fixed at 0.5, and vary the sample size:
-[$../graphs/binomial_pdf_1.png]
+[graph binomial_pdf_1]
Alternatively, we can keep the sample size fixed at N=20 and
vary the success fraction /p/:
-[$../graphs/binomial_pdf_2.png]
+[graph binomial_pdf_2]
[discrete_quantile_warning Binomial]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/cauchy.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/cauchy.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/cauchy.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -44,12 +44,12 @@
The following graph shows how the distributions moves as the
location parameter changes:
-[$../graphs/cauchy1.png]
+[graph cauchy_pdf1]
While the following graph shows how the shape (scale) parameter alters
the distribution:
-[$../graphs/cauchy2.png]
+[graph cauchy_pdf2]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/chi_squared.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/chi_squared.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/chi_squared.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -49,7 +49,7 @@
freedom. The following graph illustrates how the distribution changes
for different values of [nu]:
-[$../graphs/chi_square.png]
+[graph chi_squared_pdf]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/exponential.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/exponential.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/exponential.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -33,7 +33,7 @@
The following graph shows how the distribution changes for different
values of the rate parameter lambda:
-[$../graphs/exponential_dist.png]
+[graph exponential_pdf]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/extreme_value.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/extreme_value.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/extreme_value.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -51,11 +51,11 @@
The following graph illustrates how the PDF varies with the location parameter:
-[$../graphs/extreme_val_dist.png]
+[graph extreme_value_pdf1]
And this graph illustrates how the PDF varies with the shape parameter:
-[$../graphs/extreme_val_dist2.png]
+[graph extreme_value_pdf2]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/fisher.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/fisher.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/fisher.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -41,7 +41,7 @@
The following graph illustrates how the PDF varies depending on the
two degrees of freedom parameters.
-[$../graphs/fisher_f.png]
+[graph fisher_f_pdf]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/gamma.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/gamma.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/gamma.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -61,9 +61,9 @@
The following two graphs illustrate how the PDF of the gamma distribution
varies as the parameters vary:
-[$../graphs/gamma_dist1.png]
+[graph gamma1_pdf]
-[$../graphs/gamma_dist2.png]
+[graph gamma2_pdf]
The [*Erlang Distribution] is the same as the Gamma, but with the shape parameter
an integer. It is often expressed using a /rate/ rather than a /scale/ as the
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/lognormal.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/lognormal.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/lognormal.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -43,11 +43,11 @@
variable remains \[0,+[infin]\] irrespective of the value of the
location parameter:
-[$../graphs/lognormal1.png]
+[graph lognormal_pdf1]
The next graph illustrates the effect of the scale parameter on the PDF:
-[$../graphs/lognormal2.png]
+[graph lognormal_pdf2]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_beta.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_beta.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_beta.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -54,7 +54,7 @@
The following graph illustrates how the distribution changes
for different values of [lambda]:
-[$../graphs/nc_beta_pdf.png]
+[graph nc_beta_pdf]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_chi_squared.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_chi_squared.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_chi_squared.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -66,7 +66,7 @@
The following graph illustrates how the distribution changes
for different values of [lambda]:
-[$../graphs/nccs_pdf.png]
+[graph nccs_pdf]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_f.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_f.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_f.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -51,7 +51,7 @@
The following graph illustrates how the distribution changes
for different values of [lambda]:
-[$../graphs/nc_f_pdf.png]
+[graph nc_f_pdf]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_t.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_t.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_t.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -47,7 +47,7 @@
The following graph illustrates how the distribution changes
for different values of [delta]:
-[$../graphs/nc_t_pdf.png]
+[graph nc_t_pdf]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/negative_binomial.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/negative_binomial.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/negative_binomial.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -72,12 +72,12 @@
The following graph illustrate how the PDF varies as the success fraction
/p/ changes:
-[$../graphs/neg_binomial_pdf1.png]
+[graph negative_binomial_pdf_1]
Alternatively, this graph shows how the shape of the PDF varies as
the number of successes changes:
-[$../graphs/neg_binomial_pdf2.png]
+[graph negative_binomial_pdf_2]
[h4 Related Distributions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/normal.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/normal.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/normal.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -40,7 +40,7 @@
The variation the PDF with its parameters is illustrated
in the following graph:
-[$../graphs/normal.png]
+[graph normal_pdf]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/pareto.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/pareto.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/pareto.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -37,11 +37,14 @@
often describes the larger compared to the smaller.
A classic example is that 80% of the wealth is owned by 20% of the population.
-The following graph illustrates how the PDF varies with the shape parameter [alpha]:
+The following graph illustrates how the PDF varies with the location parameter [beta]:
+
+[graph pareto_pdf1]
+
+And this graph illustrates how the PDF varies with the shape parameter [alpha]:
+
+[graph pareto_pdf2]
-[/$../graphs/paretoShape.png]
-[/ TODO produce a graph as png or svg]
-[@http://upload.wikimedia.org/wikipedia/commons/thumb/d/d9/Pareto_distributionPDF.png/325px-Pareto_distributionPDF.png Pareto pdf]
[h4 Related distributions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/poisson.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/poisson.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/poisson.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -41,7 +41,7 @@
The following graph illustrates how the PDF varies with the parameter [lambda]:
-[$../graphs/poisson.png]
+[graph poisson_pdf_1]
[discrete_quantile_warning Poisson]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/rayleigh.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/rayleigh.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/rayleigh.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -40,11 +40,11 @@
The following graph illustrates how the Probability density Function(pdf) varies with the shape parameter [sigma]:
-[$../graphs/rayleigh_pdf.png]
+[graph rayleigh_pdf]
and the Cumulative Distribution Function (cdf)
-[$../graphs/rayleigh_cdf.png]
+[graph rayleigh_cdf]
[h4 Related distributions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/students_t.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/students_t.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/students_t.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -55,7 +55,7 @@
distribution approaches the normal-distribution. The following graph
illustrates how the PDF varies with the degrees of freedom [nu]:
-[$../graphs/students_t.png]
+[graph students_t_pdf]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/triangular.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/triangular.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/triangular.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -72,11 +72,11 @@
[@http://en.wikipedia.org/wiki/Probability_density_function probability density function PDF]
varies with the various parameters:
-[$../graphs/triangular_pdf.png]
+[graph triangular_pdf]
and cumulative distribution function
-[$../graphs/triangular_cdf.png]
+[graph triangular_cdf]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/uniform.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/uniform.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/uniform.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -61,11 +61,11 @@
[@http://en.wikipedia.org/wiki/Probability_density_function probability density function PDF]
varies with the shape parameter:
-[$../graphs/uniform_pdf.png]
+[graph uniform_pdf]
Likewise for the CDF:
-[$../graphs/uniform_cdf.png]
+[graph uniform_cdf]
[h4 Member Functions]
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/weibull.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/weibull.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/weibull.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -45,11 +45,11 @@
The following graph illustrates how the PDF varies with the shape parameter [alpha]:
-[$../graphs/weibull.png]
+[graph weibull_pdf1]
While this graph illustrates how the PDF varies with the scale parameter [beta]:
-[$../graphs/weibull2.png]
+[graph weibull_pdf2]
[h4 Related distributions]
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/acosh.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/asinh.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/atanh.png
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/bernoulli_cdf.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/bernoulli_cdf.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/bernoulli_pdf.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/bernoulli_pdf.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/beta.png
==============================================================================
Binary files. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/beta_pdf.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/beta_pdf.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/binomial_pdf_1.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/binomial_pdf_1.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/binomial_pdf_2.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/binomial_pdf_2.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/cauchy_pdf1.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/cauchy_pdf1.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/cauchy_pdf2.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/cauchy_pdf2.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/cbrt.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/chi_squared_pdf.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/chi_squared_pdf.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/digamma.png
==============================================================================
Binary files. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/dist_graphs.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/dist_graphs.cpp (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/dist_graphs.cpp 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -10,6 +10,7 @@
# pragma warning (disable : 4512) // assignment operator could not be generated
//# pragma warning (disable : 4172) // returning address of local variable or temporary TODO find cause of these.
# pragma warning (disable : 4224) // nonstandard extension used : formal parameter 'function_ptr' was previously defined as a type
+# pragma warning (disable : 4127) // conditional expression is constant
#endif
#define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error
@@ -22,6 +23,23 @@
#include <map>
#include <string>
+template <class Dist>
+struct is_discrete_distribution
+ : public boost::mpl::false_{};
+
+template<class T, class P>
+struct is_discrete_distribution<boost::math::bernoulli_distribution<T,P> >
+ : public boost::mpl::true_{};
+template<class T, class P>
+struct is_discrete_distribution<boost::math::binomial_distribution<T,P> >
+ : public boost::mpl::true_{};
+template<class T, class P>
+struct is_discrete_distribution<boost::math::negative_binomial_distribution<T,P> >
+ : public boost::mpl::true_{};
+template<class T, class P>
+struct is_discrete_distribution<boost::math::poisson_distribution<T,P> >
+ : public boost::mpl::true_{};
+
template <class Dist>
struct value_finder
@@ -43,7 +61,8 @@
class distribution_plotter
{
public:
- distribution_plotter() : m_min_x(0), m_max_x(0), m_min_y(0), m_max_y(0) {}
+ distribution_plotter() : m_pdf(true), m_min_x(0), m_max_x(0), m_min_y(0), m_max_y(0) {}
+ distribution_plotter(bool pdf) : m_pdf(pdf), m_min_x(0), m_max_x(0), m_min_y(0), m_max_y(0) {}
void add(const Dist& d, const std::string& name)
{
@@ -68,9 +87,9 @@
{
mod = a;
}
- if(mod <= a)
+ if((mod <= a) && !is_discrete_distribution<Dist>::value)
{
- if(a)
+ if((a != 0) && (fabs(a) > 1e-2))
mod = a * (1 + 1e-2);
else
mod = 1e-2;
@@ -115,15 +134,18 @@
// it's not too close to one end of the graph:
// otherwise we may be shooting off to infinity.
//
- if(mod <= a + (b-a)/50)
+ if(!is_discrete_distribution<Dist>::value)
{
- mod = a + (b-a)/50;
- }
- if(mod >= b - (b-a)/50)
- {
- mod = b - (b-a)/50;
+ if(mod <= a + (b-a)/50)
+ {
+ mod = a + (b-a)/50;
+ }
+ if(mod >= b - (b-a)/50)
+ {
+ mod = b - (b-a)/50;
+ }
+ peek_y = pdf(d, mod);
}
- peek_y = pdf(d, mod);
//
// Now set our limits:
//
@@ -156,18 +178,32 @@
chartreuse
};
+ if(m_pdf == false)
+ {
+ m_min_y = 0;
+ m_max_y = 1;
+ }
+
svg_2d_plot plot;
plot.image_size(750, 400);
plot.coord_precision(4); // Avoids any visible steps.
plot.title_font_size(20);
plot.legend_title_font_size(15);
plot.title(title);
- plot.legend_on(true).title_on(true);
+ if((m_distributions.size() == 1) && (m_distributions.begin()->first == ""))
+ plot.legend_on(false);
+ else
+ plot.legend_on(true);
+ plot.title_on(true);
//plot.x_major_labels_on(true).y_major_labels_on(true);
- double x_delta = (m_max_x - m_min_x) / 10;
+ //double x_delta = (m_max_x - m_min_x) / 10;
double y_delta = (m_max_y - m_min_y) / 10;
- plot.x_range(m_min_x, m_max_x)
- .y_range(m_min_y, m_max_y + y_delta);
+ if(is_discrete_distribution<Dist>::value)
+ plot.x_range(m_min_x - 0.5, m_max_x + 0.5)
+ .y_range(m_min_y, m_max_y + y_delta);
+ else
+ plot.x_range(m_min_x, m_max_x)
+ .y_range(m_min_y, m_max_y + y_delta);
plot.x_label_on(true).x_label("Random Variable");
plot.y_label_on(true).y_label("Probability");
plot.plot_border_color(lightslategray)
@@ -181,6 +217,11 @@
double interval = std::pow(10.0, (int)l);
if(((m_max_x - m_min_x) / interval) > 10)
interval *= 5;
+ if(is_discrete_distribution<Dist>::value)
+ {
+ interval = interval > 1 ? std::floor(interval) : 1;
+ plot.x_num_minor_ticks(0);
+ }
plot.x_major_interval(interval);
l = std::floor(std::log10((m_max_y - m_min_y) / 10) + 0.5);
interval = std::pow(10.0, (int)l);
@@ -190,30 +231,78 @@
int color_index = 0;
- for(std::list<std::pair<std::string, Dist> >::const_iterator i = m_distributions.begin();
- i != m_distributions.end(); ++i)
+ if(!is_discrete_distribution<Dist>::value)
+ {
+ //
+ // Continuous distribution:
+ //
+ for(std::list<std::pair<std::string, Dist> >::const_iterator i = m_distributions.begin();
+ i != m_distributions.end(); ++i)
+ {
+ double x = m_min_x;
+ double interval = (m_max_x - m_min_x) / 200;
+ std::map<double, double> data;
+ while(x <= m_max_x)
+ {
+ data[x] = m_pdf ? pdf(i->second, x) : cdf(i->second, x);
+ x += interval;
+ }
+ plot.plot(data, i->first)
+ .line_on(true)
+ .line_color(colors[color_index])
+ .line_width(1.)
+ //.bezier_on(true) // Can't cope with badly behaved like uniform & triangular.
+ .shape(none);
+ ++color_index;
+ color_index = color_index % (sizeof(colors)/sizeof(colors[0]));
+ }
+ }
+ else
{
- double x = m_min_x;
- double interval = (m_max_x - m_min_x) / 200;
- std::map<double, double> data;
- while(x <= m_max_x)
+ //
+ // Discrete distribution:
+ //
+ double x_width = 0.75 / m_distributions.size();
+ double x_off = -0.5 * 0.75;
+ for(std::list<std::pair<std::string, Dist> >::const_iterator i = m_distributions.begin();
+ i != m_distributions.end(); ++i)
{
- data[x] = pdf(i->second, x);
- x += interval;
+ double x = ceil(m_min_x);
+ double interval = 1;
+ std::map<double, double> data;
+ while(x <= m_max_x)
+ {
+ double p;
+ try{
+ p = m_pdf ? pdf(i->second, x) : cdf(i->second, x);
+ }
+ catch(const std::domain_error&)
+ {
+ p = 0;
+ }
+ data[x + x_off] = 0;
+ data[x + x_off + 0.00001] = p;
+ data[x + x_off + x_width] = p;
+ data[x + x_off + x_width + 0.00001] = 0;
+ x += interval;
+ }
+ x_off += x_width;
+ svg_2d_plot_series& s = plot.plot(data, i->first);
+ s.line_on(true)
+ .line_color(colors[color_index])
+ .line_width(1.)
+ //.bezier_on(true) // Can't cope with badly behaved like uniform & triangular.
+ .shape(none);
+ s.line_style_.area_fill(colors[color_index]);
+ ++color_index;
+ color_index = color_index % (sizeof(colors)/sizeof(colors[0]));
}
- plot.plot(data, i->first)
- .line_on(true)
- .line_color(colors[color_index])
- .line_width(1.)
- //.bezier_on(true) // Can't cope with badly behaved like uniform & triangular.
- .shape(none);
- ++color_index;
- color_index = color_index % (sizeof(colors)/sizeof(colors[0]));
}
plot.write(file);
}
private:
+ bool m_pdf;
std::list<std::pair<std::string, Dist> > m_distributions;
double m_min_x, m_max_x, m_min_y, m_max_y;
};
@@ -273,6 +362,15 @@
nc_f_plotter.add(boost::math::non_central_f(10, 20, 100), "v1=10, v2=20, λ=100");
nc_f_plotter.plot("Non Central F PDF", "nc_f_pdf.svg");
+ distribution_plotter<boost::math::non_central_t>
+ nc_t_plotter;
+ nc_t_plotter.add(boost::math::non_central_t(10, -10), "v=10, δ=-10");
+ nc_t_plotter.add(boost::math::non_central_t(10, -5), "v=10, δ=-5");
+ nc_t_plotter.add(boost::math::non_central_t(10, 0), "v=10, δ=0");
+ nc_t_plotter.add(boost::math::non_central_t(10, 5), "v=10, δ=5");
+ nc_t_plotter.add(boost::math::non_central_t(10, 10), "v=10, δ=10");
+ nc_t_plotter.plot("Non Central T PDF", "nc_t_pdf.svg");
+
distribution_plotter<boost::math::beta_distribution<> >
beta_plotter;
beta_plotter.add(boost::math::beta_distribution<>(0.5, 0.5), "alpha=0.5, beta=0.5");
@@ -298,9 +396,10 @@
distribution_plotter<boost::math::chi_squared_distribution<> >
chi_squared_plotter;
- chi_squared_plotter.add(boost::math::chi_squared_distribution<>(1), "v=1");
+ //chi_squared_plotter.add(boost::math::chi_squared_distribution<>(1), "v=1");
chi_squared_plotter.add(boost::math::chi_squared_distribution<>(2), "v=2");
chi_squared_plotter.add(boost::math::chi_squared_distribution<>(5), "v=5");
+ chi_squared_plotter.add(boost::math::chi_squared_distribution<>(10), "v=10");
chi_squared_plotter.plot("Chi Squared Distribution PDF", "chi_squared_pdf.svg");
distribution_plotter<boost::math::exponential_distribution<> >
@@ -369,6 +468,15 @@
rayleigh_plotter.add(boost::math::rayleigh_distribution<>(10), "σ=10");
rayleigh_plotter.plot("Rayleigh Distribution PDF", "rayleigh_pdf.svg");
+ distribution_plotter<boost::math::rayleigh_distribution<> >
+ rayleigh_cdf_plotter(false);
+ rayleigh_cdf_plotter.add(boost::math::rayleigh_distribution<>(0.5), "σ=0.5");
+ rayleigh_cdf_plotter.add(boost::math::rayleigh_distribution<>(1), "σ=1");
+ rayleigh_cdf_plotter.add(boost::math::rayleigh_distribution<>(2), "σ=2");
+ rayleigh_cdf_plotter.add(boost::math::rayleigh_distribution<>(4), "σ=4");
+ rayleigh_cdf_plotter.add(boost::math::rayleigh_distribution<>(10), "σ=10");
+ rayleigh_cdf_plotter.plot("Rayleigh Distribution CDF", "rayleigh_cdf.svg");
+
distribution_plotter<boost::math::triangular_distribution<> >
triangular_plotter;
triangular_plotter.add(boost::math::triangular_distribution<>(-1,0,1), "{-1,0,1}");
@@ -378,6 +486,15 @@
triangular_plotter.add(boost::math::triangular_distribution<>(-2,0,3), "{-2,0,3}");
triangular_plotter.plot("Triangular Distribution PDF", "triangular_pdf.svg");
+ distribution_plotter<boost::math::triangular_distribution<> >
+ triangular_cdf_plotter(false);
+ triangular_cdf_plotter.add(boost::math::triangular_distribution<>(-1,0,1), "{-1,0,1}");
+ triangular_cdf_plotter.add(boost::math::triangular_distribution<>(0,1,1), "{0,1,1}");
+ triangular_cdf_plotter.add(boost::math::triangular_distribution<>(0,1,3), "{0,1,3}");
+ triangular_cdf_plotter.add(boost::math::triangular_distribution<>(0,0.5,1), "{0,0.5,1}");
+ triangular_cdf_plotter.add(boost::math::triangular_distribution<>(-2,0,3), "{-2,0,3}");
+ triangular_cdf_plotter.plot("Triangular Distribution CDF", "triangular_cdf.svg");
+
distribution_plotter<boost::math::students_t_distribution<> >
students_t_plotter;
students_t_plotter.add(boost::math::students_t_distribution<>(1), "v=1");
@@ -387,9 +504,10 @@
distribution_plotter<boost::math::weibull_distribution<> >
weibull_plotter;
- weibull_plotter.add(boost::math::weibull_distribution<>(0.2), "shape=0.2");
+ weibull_plotter.add(boost::math::weibull_distribution<>(0.75), "shape=0.75");
weibull_plotter.add(boost::math::weibull_distribution<>(1), "shape=1");
weibull_plotter.add(boost::math::weibull_distribution<>(5), "shape=5");
+ weibull_plotter.add(boost::math::weibull_distribution<>(10), "shape=10");
weibull_plotter.plot("Weibull Distribution PDF (scale=1)", "weibull_pdf1.svg");
distribution_plotter<boost::math::weibull_distribution<> >
@@ -397,7 +515,7 @@
weibull_plotter2.add(boost::math::weibull_distribution<>(3, 0.5), "scale=0.5");
weibull_plotter2.add(boost::math::weibull_distribution<>(3, 1), "scale=1");
weibull_plotter2.add(boost::math::weibull_distribution<>(3, 2), "scale=2");
- weibull_plotter2.plot("weibull Distribution PDF (shape=3)", "weibull_pdf2.svg");
+ weibull_plotter2.plot("Weibull Distribution PDF (shape=3)", "weibull_pdf2.svg");
distribution_plotter<boost::math::uniform_distribution<> >
uniform_plotter;
@@ -407,4 +525,61 @@
uniform_plotter.add(boost::math::uniform_distribution<>(-1, 1), "{-1,1}");
uniform_plotter.plot("Uniform Distribution PDF", "uniform_pdf.svg");
+ distribution_plotter<boost::math::uniform_distribution<> >
+ uniform_cdf_plotter(false);
+ uniform_cdf_plotter.add(boost::math::uniform_distribution<>(0, 1), "{0,1}");
+ uniform_cdf_plotter.add(boost::math::uniform_distribution<>(0, 3), "{0,3}");
+ uniform_cdf_plotter.add(boost::math::uniform_distribution<>(-2, 3), "{-2,3}");
+ uniform_cdf_plotter.add(boost::math::uniform_distribution<>(-1, 1), "{-1,1}");
+ uniform_cdf_plotter.plot("Uniform Distribution CDF", "uniform_cdf.svg");
+
+ distribution_plotter<boost::math::bernoulli_distribution<> >
+ bernoulli_plotter;
+ bernoulli_plotter.add(boost::math::bernoulli_distribution<>(0.25), "p=0.25");
+ bernoulli_plotter.add(boost::math::bernoulli_distribution<>(0.5), "p=0.5");
+ bernoulli_plotter.add(boost::math::bernoulli_distribution<>(0.75), "p=0.75");
+ bernoulli_plotter.plot("Bernoulli Distribution PDF", "bernoulli_pdf.svg");
+
+ distribution_plotter<boost::math::bernoulli_distribution<> >
+ bernoulli_cdf_plotter(false);
+ bernoulli_cdf_plotter.add(boost::math::bernoulli_distribution<>(0.25), "p=0.25");
+ bernoulli_cdf_plotter.add(boost::math::bernoulli_distribution<>(0.5), "p=0.5");
+ bernoulli_cdf_plotter.add(boost::math::bernoulli_distribution<>(0.75), "p=0.75");
+ bernoulli_cdf_plotter.plot("Bernoulli Distribution CDF", "bernoulli_cdf.svg");
+
+ distribution_plotter<boost::math::binomial_distribution<> >
+ binomial_plotter;
+ binomial_plotter.add(boost::math::binomial_distribution<>(5, 0.5), "n=5 p=0.5");
+ binomial_plotter.add(boost::math::binomial_distribution<>(20, 0.5), "n=20 p=0.5");
+ binomial_plotter.add(boost::math::binomial_distribution<>(50, 0.5), "n=50 p=0.5");
+ binomial_plotter.plot("Binomial Distribution PDF", "binomial_pdf_1.svg");
+
+ distribution_plotter<boost::math::binomial_distribution<> >
+ binomial_plotter2;
+ binomial_plotter2.add(boost::math::binomial_distribution<>(20, 0.1), "n=20 p=0.1");
+ binomial_plotter2.add(boost::math::binomial_distribution<>(20, 0.5), "n=20 p=0.5");
+ binomial_plotter2.add(boost::math::binomial_distribution<>(20, 0.9), "n=20 p=0.9");
+ binomial_plotter2.plot("Binomial Distribution PDF", "binomial_pdf_2.svg");
+
+ distribution_plotter<boost::math::negative_binomial_distribution<> >
+ negative_binomial_plotter;
+ negative_binomial_plotter.add(boost::math::negative_binomial_distribution<>(20, 0.25), "n=20 p=0.25");
+ negative_binomial_plotter.add(boost::math::negative_binomial_distribution<>(20, 0.5), "n=20 p=0.5");
+ negative_binomial_plotter.add(boost::math::negative_binomial_distribution<>(20, 0.75), "n=20 p=0.75");
+ negative_binomial_plotter.plot("Negative Binomial Distribution PDF", "negative_binomial_pdf_1.svg");
+
+ distribution_plotter<boost::math::negative_binomial_distribution<> >
+ negative_binomial_plotter2;
+ negative_binomial_plotter2.add(boost::math::negative_binomial_distribution<>(10, 0.5), "n=10 p=0.5");
+ negative_binomial_plotter2.add(boost::math::negative_binomial_distribution<>(20, 0.5), "n=40 p=0.5");
+ negative_binomial_plotter2.add(boost::math::negative_binomial_distribution<>(70, 0.5), "n=70 p=0.5");
+ negative_binomial_plotter2.plot("Negative Binomial Distribution PDF", "negative_binomial_pdf_2.svg");
+
+ distribution_plotter<boost::math::poisson_distribution<> >
+ poisson_plotter;
+ poisson_plotter.add(boost::math::poisson_distribution<>(5), "λ=1");
+ poisson_plotter.add(boost::math::poisson_distribution<>(10), "λ=10");
+ poisson_plotter.add(boost::math::poisson_distribution<>(20), "λ=50");
+ poisson_plotter.plot("Poisson Distribution PDF", "poisson_pdf_1.svg");
+
}
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/erf.png
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/erf_inv.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/erfc.png
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/erfc_inv.png
==============================================================================
Binary files. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/expint2.png
==============================================================================
Binary files. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/expint_i.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/expm1.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/exponential_pdf.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/exponential_pdf.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/extreme_value_pdf1.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/extreme_value_pdf1.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/extreme_value_pdf2.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/extreme_value_pdf2.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/fisher_f_pdf.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/fisher_f_pdf.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/gamma1_pdf.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/gamma1_pdf.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/gamma2_pdf.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/gamma2_pdf.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/gamma_p.png
==============================================================================
Binary files. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/gamma_q.png
==============================================================================
Binary files. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/ibeta.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/legendre_p.png
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/legendre_q.png
==============================================================================
Binary files. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/lgamma.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/log1p.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/lognormal_pdf1.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/lognormal_pdf1.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/lognormal_pdf2.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/lognormal_pdf2.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nc_beta_pdf.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nc_beta_pdf.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nc_f_pdf.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nc_f_pdf.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nc_t_pdf.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nc_t_pdf.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nccs_pdf.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/nccs_pdf.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/negative_binomial_pdf_1.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/negative_binomial_pdf_1.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/negative_binomial_pdf_2.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/negative_binomial_pdf_2.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/normal_pdf.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/normal_pdf.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/pareto_pdf1.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/pareto_pdf1.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/pareto_pdf2.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/pareto_pdf2.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/poisson_pdf_1.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/poisson_pdf_1.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/rayleigh_cdf.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/rayleigh_cdf.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/rayleigh_pdf.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/rayleigh_pdf.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/sinc_pi.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/sinhc_pi.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/sqrt1pm1.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/students_t_pdf.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/students_t_pdf.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/tgamma.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/tgamma_delta_ratio.png
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/triangular_cdf.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/triangular_cdf.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/triangular_pdf.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/triangular_pdf.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/uniform_cdf.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/uniform_cdf.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/uniform_pdf.png
==============================================================================
Binary files. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/uniform_pdf.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/weibull_pdf1.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/weibull_pdf1.svg
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/weibull_pdf2.png
==============================================================================
Binary file. No diff available.
Added: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/weibull_pdf2.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/zeta1.png
==============================================================================
Binary files. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/graphs/zeta2.png
==============================================================================
Binary files. No diff available.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/math.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/math.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/math.qbk 2008-02-28 14:12:00 EST (Thu, 28 Feb 2008)
@@ -22,6 +22,15 @@
</imageobject>
</inlinemediaobject>''']
+[template graph[name] '''<inlinemediaobject>
+<imageobject role="html">
+<imagedata align="center" fileref="../graphs/'''[name]'''.png"></imagedata>
+</imageobject>
+<imageobject role="print">
+<imagedata align="center" fileref="../graphs/'''[name]'''.svg"></imagedata>
+</imageobject>
+</inlinemediaobject>''']
+
[include html4_symbols.qbk] [/ just for testing]
[/include latin1_symbols.qbk] [/ just for testing]
[include common_overviews.qbk] [/ overviews that appear in more than one place!]
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