2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Improved docs and tests and graphs.

This commit is contained in:
pabristow
2014-11-27 16:44:42 +00:00
parent 04c43aba75
commit f9b2addcdc
20 changed files with 365 additions and 68 deletions

View File

@@ -19,6 +19,7 @@
public:
typedef RealType value_type;
typedef Policy policy_type;
// Constructor from two range parameters, x_min and x_max:
arcsine_distribution(RealType x_min, RealType x_max);
@@ -51,13 +52,11 @@ The [@http://en.wikipedia.org/wiki/Probability_density_function probability dens
for the [@http://en.wikipedia.org/wiki/arcsine_distribution arcsine distribution]
defined on the interval \[0,1\] is given by:
[sixemspace] f(x; x_min, x_max) = 1 / [pi] [sqrt]((x - x_min) (x_max - x))
[figspace] f(x; x_min, x_max) = 1 / [pi] [sqrt]((x - x_min) (x_max - x))
[figspace] [figspace] f(x; x_min, x_max) = 1 /([pi][sdot][sqrt]((x - x_min)[sdot](x_max - x))
For example, __WolframAlpha arcsine distribution, from input of
N[pDF[arcsinedistribution[0, 1], 0.5], 50]
N[PDF[arcsinedistribution[0, 1], 0.5], 50]
computes the PDF value
@@ -78,7 +77,7 @@ and some generalized examples with other ['x] ranges.
The Cumulative Distribution Function CDF is defined as
[sixemspace] F(x) = 2 / [pi] arcsin (sqrt((x-x_min)(x_max - x)))
[figspace] [figspace] F(x) = 2[sdot]arcsin([sqrt]((x-x_min)/(x_max - x))) / [pi]
[graph arcsine_cdf]
@@ -121,7 +120,7 @@ that are generic to all distributions are supported: __usual_accessors.
The formulae for calculating these are shown in the table below, and at
[@http://mathworld.wolfram.com/arcsineDistribution.html Wolfram Mathworld].
[note There are always [*two] values for the mode, at ['x_min] and at ['x_max], default 0 and 1,
[note There are always [*two] values for the [*mode], at ['x_min] and at ['x_max], default 0 and 1,
so instead we raise the exception __domain_error.
At these extrema, the PDFs are infinite, and the CDFs zero or unity.]
@@ -151,14 +150,14 @@ and the PDF can be calculated thus:
[arcsine_snip_2]
From the plot of PDF, it is clear that ['x] = 1/2 is the [*minimum] of the curve,
From the plot of PDF, it is clear that ['x] = [frac12] is the [*minimum] of the curve,
so this is the [*least likely] scenario.
(This is highly counter-intuitive, considering that fair tosses must [*eventually] become equal.
It turns out that ['eventually] is not just very long, but infinite).
It turns out that ['eventually] is not just very long, but [*infinite]!).
The [*most likely] scenarios are towards the extrema where ['x] = 0 or ['x] = 1.
If fraction of time is on the left is a 1/4,
If fraction of time on the left is a [frac14],
it is only slightly more likely because the curve is quite flat bottomed.
[arcsine_snip_3]
@@ -173,7 +172,7 @@ We can easily compute this setting ['x] = 5./100 = 0.05
Similarly, we can compute from a fraction of 0.05 /2 = 0.025
(halved because we are considering both winners and losers)
corresponding to 1 - 0.025 or 97.5% of the gamblers, (walkers, particles) on the [*same side] of the origin
corresponding to 1 - 0.025 or 97.5% of the gamblers, (walkers, particles...) on the [*same side] of the origin
[arcsine_snip_5]
@@ -197,7 +196,7 @@ and gamblers continue to provide proof.
[*Moral]: if you in a losing patch, leave the game.
(Because the odds to recover to a good patch are poor).
[*Corollary]: Quit while you are ahead!
[*Corollary]: Quit while you are ahead?
A working example is at [@../../example/arcsine_example.cpp arcsine_example.cpp]
including sample output .
@@ -217,7 +216,7 @@ For example, for a standard [0, 1] arcsine distribution ['as], the pdf is symmet
so that one would expect `pdf(as, 0.01) == pdf(as, 0.99)`. But as ['x] nears unity, there is increasing
[@http://en.wikipedia.org/wiki/Loss_of_significance loss of significance].
To counteract this, the complement versions of CDF and quantile
are implemented with alternative expressions using ['cos[super -1]] instead of ['asin[super -1]].
are implemented with alternative expressions using ['cos[super -1]] instead of ['sin[super -1]].
Users should see __why_complements for guidance on when to avoid loss of accuracy by using complements.
[h4 Testing]
@@ -233,7 +232,7 @@ In the following table ['a] and ['b] are the parameters ['x_min][space] and ['x_
[table
[[Function][Implementation Notes]]
[[support] [x [isin] \[x_min, x_max\], default x [isin] \[0, 1\] ]]
[[support] [x [isin] \[a, b\], default x [isin] \[0, 1\] ]]
[[pdf] [f(x; a, b) = 1/([pi][sdot][sqrt](x - a)[sdot](b - x))]]
[[cdf] [F(x) = 2/[pi][sdot]sin[super-1]([sqrt](x - a) / (b - a) ) ]]
[[cdf of complement] [2/([pi][sdot]cos[super-1]([sqrt](x - a) / (b - a)))]]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

@@ -55,7 +55,7 @@ xmlns ="http://www.w3.org/2000/svg"
<text x="42.9" y="199.5" text-anchor="middle" transform = "rotate(-90 42.9 199.5 )" font-size="14" font-family="Lucida Sans Unicode">Probability</text></g>
<g id="xLabel">
<text x="302.4" y="376.7" text-anchor="middle" font-size="14" font-family="Lucida Sans Unicode">Random Variable x</text></g>
<g id="plotLines" stroke-width="2"><g clip-path="url(#plot_window)" stroke="rgb(0,0,139)" stroke-width="1"><path d="M84.2,341 L85.65,330.6 L87.11,326.3 L88.56,323 L90.02,320.2 L91.47,317.7 L92.93,315.4 L94.38,313.4 L95.84,311.4 L97.29,309.6 L98.75,307.9 L100.2,306.3 L101.7,304.7 L103.1,303.2 L104.6,301.8 L106,300.4 L107.5,299 L108.9,297.7 L110.4,296.4 L111.8,295.2 L113.3,293.9 L114.7,292.8 L116.2,291.6 L117.7,290.5 L119.1,289.3 L120.6,288.2 L122,287.2 L123.5,286.1 L124.9,285.1 L126.4,284 L127.8,283 L129.3,282 L130.7,281.1 L132.2,280.1 L133.7,279.1 L135.1,278.2 L136.6,277.3 L138,276.4 L139.5,275.4 L140.9,274.5 L142.4,273.7 L143.8,272.8 L145.3,271.9 L146.7,271 L148.2,270.2 L149.7,269.3 L151.1,268.5 L152.6,267.7 L154,266.9 L155.5,266 L156.9,265.2 L158.4,264.4 L159.8,263.6 L161.3,262.8 L162.7,262.1 L164.2,261.3 L165.7,260.5 L167.1,259.7 L168.6,259 L170,258.2 L171.5,257.5 L172.9,256.7 L174.4,256 L175.8,255.2 L177.3,254.5 L178.7,253.8 L180.2,253 L181.7,252.3 L183.1,251.6 L184.6,250.9 L186,250.2 L187.5,249.5 L188.9,248.8 L190.4,248.1 L191.8,247.4 L193.3,246.7 L194.7,246 L196.2,245.3 L197.7,244.6 L199.1,243.9 L200.6,243.2 L202,242.6 L203.5,241.9 L204.9,241.2 L206.4,240.5 L207.8,239.9 L209.3,239.2 L210.7,238.5 L212.2,237.9 L213.7,237.2 L215.1,236.6 L216.6,235.9 L218,235.3 L219.5,234.6 L220.9,234 L222.4,233.3 L223.8,232.7 L225.3,232 L226.7,231.4 L228.2,230.8 L229.7,230.1 L231.1,229.5 L232.6,228.8 L234,228.2 L235.5,227.6 L236.9,226.9 L238.4,226.3 L239.8,225.7 L241.3,225.1 L242.7,224.4 L244.2,223.8 L245.7,223.2 L247.1,222.6 L248.6,222 L250,221.3 L251.5,220.7 L252.9,220.1 L254.4,219.5 L255.8,218.9 L257.3,218.3 L258.7,217.6 L260.2,217 L261.7,216.4 L263.1,215.8 L264.6,215.2 L266,214.6 L267.5,214 L268.9,213.4 L270.4,212.8 L271.8,212.2 L273.3,211.5 L274.7,210.9 L276.2,210.3 L277.7,209.7 L279.1,209.1 L280.6,208.5 L282,207.9 L283.5,207.3 L284.9,206.7 L286.4,206.1 L287.8,205.5 L289.3,204.9 L290.7,204.3 L292.2,203.7 L293.7,203.1 L295.1,202.5 L296.6,201.9 L298,201.3 L299.5,200.7 L300.9,200.1 L302.4,199.5 L303.8,198.9 L305.3,198.3 L306.7,197.7 L308.2,197.1 L309.7,196.5 L311.1,195.9 L312.6,195.3 L314,194.7 L315.5,194.1 L316.9,193.5 L318.4,192.9 L319.8,192.3 L321.3,191.7 L322.7,191.1 L324.2,190.5 L325.7,189.9 L327.1,189.3 L328.6,188.7 L330,188.1 L331.5,187.5 L332.9,186.8 L334.4,186.2 L335.8,185.6 L337.3,185 L338.7,184.4 L340.2,183.8 L341.7,183.2 L343.1,182.6 L344.6,182 L346,181.4 L347.5,180.7 L348.9,180.1 L350.4,179.5 L351.8,178.9 L353.3,178.3 L354.7,177.7 L356.2,177 L357.7,176.4 L359.1,175.8 L360.6,175.2 L362,174.6 L363.5,173.9 L364.9,173.3 L366.4,172.7 L367.8,172.1 L369.3,171.4 L370.7,170.8 L372.2,170.2 L373.7,169.5 L375.1,168.9 L376.6,168.2 L378,167.6 L379.5,167 L380.9,166.3 L382.4,165.7 L383.8,165 L385.3,164.4 L386.7,163.7 L388.2,163.1 L389.7,162.4 L391.1,161.8 L392.6,161.1 L394,160.5 L395.5,159.8 L396.9,159.1 L398.4,158.5 L399.8,157.8 L401.3,157.1 L402.7,156.4 L404.2,155.8 L405.7,155.1 L407.1,154.4 L408.6,153.7 L410,153 L411.5,152.3 L412.9,151.6 L414.4,150.9 L415.8,150.2 L417.3,149.5 L418.7,148.8 L420.2,148.1 L421.7,147.4 L423.1,146.7 L424.6,146 L426,145.2 L427.5,144.5 L428.9,143.8 L430.4,143 L431.8,142.3 L433.3,141.5 L434.7,140.8 L436.2,140 L437.7,139.3 L439.1,138.5 L440.6,137.7 L442,136.9 L443.5,136.2 L444.9,135.4 L446.4,134.6 L447.8,133.8 L449.3,133 L450.7,132.1 L452.2,131.3 L453.7,130.5 L455.1,129.7 L456.6,128.8 L458,128 L459.5,127.1 L460.9,126.2 L462.4,125.3 L463.8,124.5 L465.3,123.6 L466.7,122.6 L468.2,121.7 L469.7,120.8 L471.1,119.9 L472.6,118.9 L474,117.9 L475.5,117 L476.9,116 L478.4,115 L479.8,113.9 L481.3,112.9 L482.7,111.8 L484.2,110.8 L485.7,109.7 L487.1,108.5 L488.6,107.4 L490,106.2 L491.5,105.1 L492.9,103.8 L494.4,102.6 L495.8,101.3 L497.3,99.99 L498.7,98.63 L500.2,97.23 L501.7,95.78 L503.1,94.28 L504.6,92.71 L506,91.08 L507.5,89.36 L508.9,87.55 L510.4,85.63 L511.8,83.56 L513.3,81.32 L514.7,78.85 L516.2,76.05 L517.7,72.73 L519.1,68.41 L520.6,58 " fill="none"/></g>
<g id="plotLines" stroke-width="2"><g clip-path="url(#plot_window)" stroke="rgb(0,0,139)" stroke-width="1"><path d="M84.2,341 L85.65,330.6 L87.11,326.3 L88.56,323 L90.02,320.2 L91.47,317.7 L92.93,315.4 L94.38,313.4 L95.84,311.4 L97.29,309.6 L98.75,307.9 L100.2,306.3 L101.7,304.7 L103.1,303.2 L104.6,301.8 L106,300.4 L107.5,299 L108.9,297.7 L110.4,296.4 L111.8,295.2 L113.3,293.9 L114.7,292.8 L116.2,291.6 L117.7,290.5 L119.1,289.3 L120.6,288.2 L122,287.2 L123.5,286.1 L124.9,285.1 L126.4,284 L127.8,283 L129.3,282 L130.7,281.1 L132.2,280.1 L133.7,279.1 L135.1,278.2 L136.6,277.3 L138,276.4 L139.5,275.4 L140.9,274.5 L142.4,273.7 L143.8,272.8 L145.3,271.9 L146.7,271 L148.2,270.2 L149.7,269.3 L151.1,268.5 L152.6,267.7 L154,266.9 L155.5,266 L156.9,265.2 L158.4,264.4 L159.8,263.6 L161.3,262.8 L162.7,262.1 L164.2,261.3 L165.7,260.5 L167.1,259.7 L168.6,259 L170,258.2 L171.5,257.5 L172.9,256.7 L174.4,256 L175.8,255.2 L177.3,254.5 L178.7,253.8 L180.2,253 L181.7,252.3 L183.1,251.6 L184.6,250.9 L186,250.2 L187.5,249.5 L188.9,248.8 L190.4,248.1 L191.8,247.4 L193.3,246.7 L194.7,246 L196.2,245.3 L197.7,244.6 L199.1,243.9 L200.6,243.2 L202,242.6 L203.5,241.9 L204.9,241.2 L206.4,240.5 L207.8,239.9 L209.3,239.2 L210.7,238.5 L212.2,237.9 L213.7,237.2 L215.1,236.6 L216.6,235.9 L218,235.3 L219.5,234.6 L220.9,234 L222.4,233.3 L223.8,232.7 L225.3,232 L226.7,231.4 L228.2,230.8 L229.7,230.1 L231.1,229.5 L232.6,228.8 L234,228.2 L235.5,227.6 L236.9,226.9 L238.4,226.3 L239.8,225.7 L241.3,225.1 L242.7,224.4 L244.2,223.8 L245.7,223.2 L247.1,222.6 L248.6,222 L250,221.3 L251.5,220.7 L252.9,220.1 L254.4,219.5 L255.8,218.9 L257.3,218.3 L258.7,217.6 L260.2,217 L261.7,216.4 L263.1,215.8 L264.6,215.2 L266,214.6 L267.5,214 L268.9,213.4 L270.4,212.8 L271.8,212.2 L273.3,211.5 L274.7,210.9 L276.2,210.3 L277.7,209.7 L279.1,209.1 L280.6,208.5 L282,207.9 L283.5,207.3 L284.9,206.7 L286.4,206.1 L287.8,205.5 L289.3,204.9 L290.7,204.3 L292.2,203.7 L293.7,203.1 L295.1,202.5 L296.6,201.9 L298,201.3 L299.5,200.7 L300.9,200.1 L302.4,199.5 L303.8,198.9 L305.3,198.3 L306.7,197.7 L308.2,197.1 L309.7,196.5 L311.1,195.9 L312.6,195.3 L314,194.7 L315.5,194.1 L316.9,193.5 L318.4,192.9 L319.8,192.3 L321.3,191.7 L322.7,191.1 L324.2,190.5 L325.7,189.9 L327.1,189.3 L328.6,188.7 L330,188.1 L331.5,187.5 L332.9,186.8 L334.4,186.2 L335.8,185.6 L337.3,185 L338.7,184.4 L340.2,183.8 L341.7,183.2 L343.1,182.6 L344.6,182 L346,181.4 L347.5,180.7 L348.9,180.1 L350.4,179.5 L351.8,178.9 L353.3,178.3 L354.7,177.7 L356.2,177 L357.7,176.4 L359.1,175.8 L360.6,175.2 L362,174.6 L363.5,173.9 L364.9,173.3 L366.4,172.7 L367.8,172.1 L369.3,171.4 L370.7,170.8 L372.2,170.2 L373.7,169.5 L375.1,168.9 L376.6,168.2 L378,167.6 L379.5,167 L380.9,166.3 L382.4,165.7 L383.8,165 L385.3,164.4 L386.7,163.7 L388.2,163.1 L389.7,162.4 L391.1,161.8 L392.6,161.1 L394,160.5 L395.5,159.8 L396.9,159.1 L398.4,158.5 L399.8,157.8 L401.3,157.1 L402.7,156.4 L404.2,155.8 L405.7,155.1 L407.1,154.4 L408.6,153.7 L410,153 L411.5,152.3 L412.9,151.6 L414.4,150.9 L415.8,150.2 L417.3,149.5 L418.7,148.8 L420.2,148.1 L421.7,147.4 L423.1,146.7 L424.6,146 L426,145.2 L427.5,144.5 L428.9,143.8 L430.4,143 L431.8,142.3 L433.3,141.5 L434.7,140.8 L436.2,140 L437.7,139.3 L439.1,138.5 L440.6,137.7 L442,136.9 L443.5,136.2 L444.9,135.4 L446.4,134.6 L447.8,133.8 L449.3,133 L450.7,132.1 L452.2,131.3 L453.7,130.5 L455.1,129.7 L456.6,128.8 L458,128 L459.5,127.1 L460.9,126.2 L462.4,125.3 L463.8,124.5 L465.3,123.6 L466.7,122.6 L468.2,121.7 L469.7,120.8 L471.1,119.9 L472.6,118.9 L474,117.9 L475.5,117 L476.9,116 L478.4,115 L479.8,113.9 L481.3,112.9 L482.7,111.8 L484.2,110.8 L485.7,109.7 L487.1,108.5 L488.6,107.4 L490,106.2 L491.5,105.1 L492.9,103.8 L494.4,102.6 L495.8,101.3 L497.3,99.99 L498.7,98.63 L500.2,97.23 L501.7,95.78 L503.1,94.28 L504.6,92.71 L506,91.08 L507.5,89.36 L508.9,87.55 L510.4,85.63 L511.8,83.56 L513.3,81.32 L514.7,78.85 L516.2,76.05 L517.7,72.73 L519.1,68.41 L520.6,58 L520.6,58 " fill="none"/></g>
</g>
<g id="plotPoints" clip-path="url(#plot_window)"></g>
<g id="legendBackground" stroke="rgb(119,136,153)" fill="rgb(255,255,255)" stroke-width="1"><rect x="534.6" y="58" width="189.4" height="45"/><rect x="534.6" y="58" width="189.4" height="45"/></g>

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

@@ -50,11 +50,11 @@ xmlns ="http://www.w3.org/2000/svg"
<text x="42.9" y="199.5" text-anchor="middle" transform = "rotate(-90 42.9 199.5 )" font-size="14" font-family="Lucida Sans Unicode">Probability</text></g>
<g id="xLabel">
<text x="298.5" y="376.7" text-anchor="middle" font-size="14" font-family="Lucida Sans Unicode">Random Variable x</text></g>
<g id="plotLines" stroke-width="2"><g clip-path="url(#plot_window)" stroke="rgb(0,0,139)" stroke-width="1"><path d="M169.9,341 L171.3,317.7 L172.8,307.9 L174.2,300.4 L175.6,293.9 L177,288.2 L178.5,283 L179.9,278.2 L181.3,273.7 L182.8,269.3 L184.2,265.2 L185.6,261.3 L187,257.5 L188.5,253.8 L189.9,250.2 L191.3,246.7 L192.8,243.2 L194.2,239.9 L195.6,236.6 L197,233.3 L198.5,230.1 L199.9,226.9 L201.3,223.8 L202.8,220.7 L204.2,217.6 L205.6,214.6 L207,211.5 L208.5,208.5 L209.9,205.5 L211.3,202.5 L212.8,199.5 L214.2,196.5 L215.6,193.5 L217,190.5 L218.5,187.5 L219.9,184.4 L221.3,181.4 L222.8,178.3 L224.2,175.2 L225.6,172.1 L227,168.9 L228.5,165.7 L229.9,162.4 L231.3,159.1 L232.8,155.8 L234.2,152.3 L235.6,148.8 L237,145.2 L238.5,141.5 L239.9,137.7 L241.3,133.8 L242.8,129.7 L244.2,125.3 L245.6,120.8 L247,116 L248.5,110.8 L249.9,105.1 L251.3,98.63 L252.8,91.08 L254.2,81.32 " fill="none"/></g>
<g clip-path="url(#plot_window)" stroke="rgb(139,0,0)" stroke-width="1"><path d="M85.63,324.5 L87.06,317.7 L88.49,312.4 L89.91,307.9 L91.34,304 L92.77,300.4 L94.2,297.1 L95.63,293.9 L97.06,291 L98.48,288.2 L99.91,285.6 L101.3,283 L102.8,280.6 L104.2,278.2 L105.6,275.9 L107.1,273.7 L108.5,271.5 L109.9,269.3 L111.3,267.3 L112.8,265.2 L114.2,263.2 L115.6,261.3 L117.1,259.4 L118.5,257.5 L119.9,255.6 L121.3,253.8 L122.8,252 L124.2,250.2 L125.6,248.4 L127.1,246.7 L128.5,244.9 L129.9,243.2 L131.3,241.5 L132.8,239.9 L134.2,238.2 L135.6,236.6 L137.1,234.9 L138.5,233.3 L139.9,231.7 L141.3,230.1 L142.8,228.5 L144.2,226.9 L145.6,225.4 L147,223.8 L148.5,222.3 L149.9,220.7 L151.3,219.2 L152.8,217.6 L154.2,216.1 L155.6,214.6 L157,213.1 L158.5,211.5 L159.9,210 L161.3,208.5 L162.8,207 L164.2,205.5 L165.6,204 L167,202.5 L168.5,201 L169.9,199.5 L171.3,198 L172.8,196.5 L174.2,195 L175.6,193.5 L177,192 L178.5,190.5 L179.9,189 L181.3,187.5 L182.8,185.9 L184.2,184.4 L185.6,182.9 L187,181.4 L188.5,179.8 L189.9,178.3 L191.3,176.7 L192.8,175.2 L194.2,173.6 L195.6,172.1 L197,170.5 L198.5,168.9 L199.9,167.3 L201.3,165.7 L202.8,164.1 L204.2,162.4 L205.6,160.8 L207,159.1 L208.5,157.5 L209.9,155.8 L211.3,154.1 L212.8,152.3 L214.2,150.6 L215.6,148.8 L217,147 L218.5,145.2 L219.9,143.4 L221.3,141.5 L222.8,139.6 L224.2,137.7 L225.6,135.8 L227,133.8 L228.5,131.7 L229.9,129.7 L231.3,127.5 L232.8,125.3 L234.2,123.1 L235.6,120.8 L237,118.4 L238.5,116 L239.9,113.4 L241.3,110.8 L242.8,108 L244.2,105.1 L245.6,101.9 L247,98.63 L248.5,95.04 L249.9,91.08 L251.3,86.61 L252.8,81.32 L254.2,74.47 " fill="none"/></g>
<g clip-path="url(#plot_window)" stroke="rgb(0,100,0)" stroke-width="1"><path d="M85.63,327.6 L87.06,322 L88.49,317.7 L89.91,314 L91.34,310.8 L92.77,307.9 L94.2,305.2 L95.63,302.7 L97.06,300.4 L98.48,298.1 L99.91,296 L101.3,293.9 L102.8,292 L104.2,290.1 L105.6,288.2 L107.1,286.5 L108.5,284.7 L109.9,283 L111.3,281.4 L112.8,279.8 L114.2,278.2 L115.6,276.7 L117.1,275.1 L118.5,273.7 L119.9,272.2 L121.3,270.8 L122.8,269.3 L124.2,268 L125.6,266.6 L127.1,265.2 L128.5,263.9 L129.9,262.6 L131.3,261.3 L132.8,260 L134.2,258.7 L135.6,257.5 L137.1,256.2 L138.5,255 L139.9,253.8 L141.3,252.6 L142.8,251.4 L144.2,250.2 L145.6,249 L147,247.8 L148.5,246.7 L149.9,245.5 L151.3,244.4 L152.8,243.2 L154.2,242.1 L155.6,241 L157,239.9 L158.5,238.8 L159.9,237.7 L161.3,236.6 L162.8,235.5 L164.2,234.4 L165.6,233.3 L167,232.2 L168.5,231.2 L169.9,230.1 L171.3,229.1 L172.8,228 L174.2,226.9 L175.6,225.9 L177,224.9 L178.5,223.8 L179.9,222.8 L181.3,221.7 L182.8,220.7 L184.2,219.7 L185.6,218.7 L187,217.6 L188.5,216.6 L189.9,215.6 L191.3,214.6 L192.8,213.6 L194.2,212.6 L195.6,211.5 L197,210.5 L198.5,209.5 L199.9,208.5 L201.3,207.5 L202.8,206.5 L204.2,205.5 L205.6,204.5 L207,203.5 L208.5,202.5 L209.9,201.5 L211.3,200.5 L212.8,199.5 L214.2,198.5 L215.6,197.5 L217,196.5 L218.5,195.5 L219.9,194.5 L221.3,193.5 L222.8,192.5 L224.2,191.5 L225.6,190.5 L227,189.5 L228.5,188.5 L229.9,187.5 L231.3,186.4 L232.8,185.4 L234.2,184.4 L235.6,183.4 L237,182.4 L238.5,181.4 L239.9,180.3 L241.3,179.3 L242.8,178.3 L244.2,177.3 L245.6,176.2 L247,175.2 L248.5,174.1 L249.9,173.1 L251.3,172.1 L252.8,171 L254.2,169.9 L255.6,168.9 L257,167.8 L258.5,166.8 L259.9,165.7 L261.3,164.6 L262.8,163.5 L264.2,162.4 L265.6,161.3 L267,160.2 L268.5,159.1 L269.9,158 L271.3,156.9 L272.7,155.8 L274.2,154.6 L275.6,153.5 L277,152.3 L278.5,151.2 L279.9,150 L281.3,148.8 L282.7,147.6 L284.2,146.4 L285.6,145.2 L287,144 L288.5,142.8 L289.9,141.5 L291.3,140.3 L292.7,139 L294.2,137.7 L295.6,136.4 L297,135.1 L298.5,133.8 L299.9,132.4 L301.3,131 L302.7,129.7 L304.2,128.2 L305.6,126.8 L307,125.3 L308.5,123.9 L309.9,122.3 L311.3,120.8 L312.7,119.2 L314.2,117.6 L315.6,116 L317,114.3 L318.5,112.5 L319.9,110.8 L321.3,108.9 L322.7,107 L324.2,105.1 L325.6,103 L327,100.9 L328.5,98.63 L329.9,96.27 L331.3,93.76 L332.7,91.08 L334.2,88.17 L335.6,84.96 L337,81.32 L338.5,77.03 L339.9,71.44 L341.3,58 " fill="none"/></g>
<g clip-path="url(#plot_window)" stroke="rgb(255,140,0)" stroke-width="1"><path d="M85.63,330.6 L87.06,326.3 L88.49,323 L89.91,320.2 L91.34,317.7 L92.77,315.4 L94.2,313.4 L95.63,311.4 L97.06,309.6 L98.48,307.9 L99.91,306.3 L101.3,304.7 L102.8,303.2 L104.2,301.8 L105.6,300.4 L107.1,299 L108.5,297.7 L109.9,296.4 L111.3,295.2 L112.8,293.9 L114.2,292.8 L115.6,291.6 L117.1,290.5 L118.5,289.3 L119.9,288.2 L121.3,287.2 L122.8,286.1 L124.2,285.1 L125.6,284 L127.1,283 L128.5,282 L129.9,281.1 L131.3,280.1 L132.8,279.1 L134.2,278.2 L135.6,277.3 L137.1,276.4 L138.5,275.4 L139.9,274.5 L141.3,273.7 L142.8,272.8 L144.2,271.9 L145.6,271 L147,270.2 L148.5,269.3 L149.9,268.5 L151.3,267.7 L152.8,266.9 L154.2,266 L155.6,265.2 L157,264.4 L158.5,263.6 L159.9,262.8 L161.3,262.1 L162.8,261.3 L164.2,260.5 L165.6,259.7 L167,259 L168.5,258.2 L169.9,257.5 L171.3,256.7 L172.8,256 L174.2,255.2 L175.6,254.5 L177,253.8 L178.5,253 L179.9,252.3 L181.3,251.6 L182.8,250.9 L184.2,250.2 L185.6,249.5 L187,248.8 L188.5,248.1 L189.9,247.4 L191.3,246.7 L192.8,246 L194.2,245.3 L195.6,244.6 L197,243.9 L198.5,243.2 L199.9,242.6 L201.3,241.9 L202.8,241.2 L204.2,240.5 L205.6,239.9 L207,239.2 L208.5,238.5 L209.9,237.9 L211.3,237.2 L212.8,236.6 L214.2,235.9 L215.6,235.3 L217,234.6 L218.5,234 L219.9,233.3 L221.3,232.7 L222.8,232 L224.2,231.4 L225.6,230.8 L227,230.1 L228.5,229.5 L229.9,228.8 L231.3,228.2 L232.8,227.6 L234.2,226.9 L235.6,226.3 L237,225.7 L238.5,225.1 L239.9,224.4 L241.3,223.8 L242.8,223.2 L244.2,222.6 L245.6,222 L247,221.3 L248.5,220.7 L249.9,220.1 L251.3,219.5 L252.8,218.9 L254.2,218.3 L255.6,217.6 L257,217 L258.5,216.4 L259.9,215.8 L261.3,215.2 L262.8,214.6 L264.2,214 L265.6,213.4 L267,212.8 L268.5,212.2 L269.9,211.5 L271.3,210.9 L272.7,210.3 L274.2,209.7 L275.6,209.1 L277,208.5 L278.5,207.9 L279.9,207.3 L281.3,206.7 L282.7,206.1 L284.2,205.5 L285.6,204.9 L287,204.3 L288.5,203.7 L289.9,203.1 L291.3,202.5 L292.7,201.9 L294.2,201.3 L295.6,200.7 L297,200.1 L298.5,199.5 L299.9,198.9 L301.3,198.3 L302.7,197.7 L304.2,197.1 L305.6,196.5 L307,195.9 L308.5,195.3 L309.9,194.7 L311.3,194.1 L312.7,193.5 L314.2,192.9 L315.6,192.3 L317,191.7 L318.5,191.1 L319.9,190.5 L321.3,189.9 L322.7,189.3 L324.2,188.7 L325.6,188.1 L327,187.5 L328.5,186.8 L329.9,186.2 L331.3,185.6 L332.7,185 L334.2,184.4 L335.6,183.8 L337,183.2 L338.5,182.6 L339.9,182 L341.3,181.4 L342.7,180.7 L344.2,180.1 L345.6,179.5 L347,178.9 L348.5,178.3 L349.9,177.7 L351.3,177 L352.7,176.4 L354.2,175.8 L355.6,175.2 L357,174.6 L358.5,173.9 L359.9,173.3 L361.3,172.7 L362.7,172.1 L364.2,171.4 L365.6,170.8 L367,170.2 L368.5,169.5 L369.9,168.9 L371.3,168.2 L372.7,167.6 L374.2,167 L375.6,166.3 L377,165.7 L378.5,165 L379.9,164.4 L381.3,163.7 L382.7,163.1 L384.2,162.4 L385.6,161.8 L387,161.1 L388.4,160.5 L389.9,159.8 L391.3,159.1 L392.7,158.5 L394.2,157.8 L395.6,157.1 L397,156.4 L398.4,155.8 L399.9,155.1 L401.3,154.4 L402.7,153.7 L404.2,153 L405.6,152.3 L407,151.6 L408.4,150.9 L409.9,150.2 L411.3,149.5 L412.7,148.8 L414.2,148.1 L415.6,147.4 L417,146.7 L418.4,146 L419.9,145.2 L421.3,144.5 L422.7,143.8 L424.2,143 L425.6,142.3 L427,141.5 L428.4,140.8 L429.9,140 L431.3,139.3 L432.7,138.5 L434.2,137.7 L435.6,136.9 L437,136.2 L438.4,135.4 L439.9,134.6 L441.3,133.8 L442.7,133 L444.2,132.1 L445.6,131.3 L447,130.5 L448.4,129.7 L449.9,128.8 L451.3,128 L452.7,127.1 L454.2,126.2 L455.6,125.3 L457,124.5 L458.4,123.6 L459.9,122.6 L461.3,121.7 L462.7,120.8 L464.2,119.9 L465.6,118.9 L467,117.9 L468.4,117 L469.9,116 L471.3,115 L472.7,113.9 L474.2,112.9 L475.6,111.8 L477,110.8 L478.4,109.7 L479.9,108.5 L481.3,107.4 L482.7,106.2 L484.2,105.1 L485.6,103.8 L487,102.6 L488.4,101.3 L489.9,99.99 L491.3,98.63 L492.7,97.23 L494.2,95.78 L495.6,94.28 L497,92.71 L498.4,91.08 L499.9,89.36 L501.3,87.55 L502.7,85.63 L504.1,83.56 L505.6,81.32 L507,78.85 L508.4,76.05 L509.9,72.73 L511.3,68.41 L512.7,58 " fill="none"/></g>
<g clip-path="url(#plot_window)" stroke="rgb(127,255,0)" stroke-width="1"><path d="M342.7,324.5 L344.2,317.7 L345.6,312.4 L347,307.9 L348.5,304 L349.9,300.4 L351.3,297.1 L352.7,293.9 L354.2,291 L355.6,288.2 L357,285.6 L358.5,283 L359.9,280.6 L361.3,278.2 L362.7,275.9 L364.2,273.7 L365.6,271.5 L367,269.3 L368.5,267.3 L369.9,265.2 L371.3,263.2 L372.7,261.3 L374.2,259.4 L375.6,257.5 L377,255.6 L378.5,253.8 L379.9,252 L381.3,250.2 L382.7,248.4 L384.2,246.7 L385.6,244.9 L387,243.2 L388.4,241.5 L389.9,239.9 L391.3,238.2 L392.7,236.6 L394.2,234.9 L395.6,233.3 L397,231.7 L398.4,230.1 L399.9,228.5 L401.3,226.9 L402.7,225.4 L404.2,223.8 L405.6,222.3 L407,220.7 L408.4,219.2 L409.9,217.6 L411.3,216.1 L412.7,214.6 L414.2,213.1 L415.6,211.5 L417,210 L418.4,208.5 L419.9,207 L421.3,205.5 L422.7,204 L424.2,202.5 L425.6,201 L427,199.5 L428.4,198 L429.9,196.5 L431.3,195 L432.7,193.5 L434.2,192 L435.6,190.5 L437,189 L438.4,187.5 L439.9,185.9 L441.3,184.4 L442.7,182.9 L444.2,181.4 L445.6,179.8 L447,178.3 L448.4,176.7 L449.9,175.2 L451.3,173.6 L452.7,172.1 L454.2,170.5 L455.6,168.9 L457,167.3 L458.4,165.7 L459.9,164.1 L461.3,162.4 L462.7,160.8 L464.2,159.1 L465.6,157.5 L467,155.8 L468.4,154.1 L469.9,152.3 L471.3,150.6 L472.7,148.8 L474.2,147 L475.6,145.2 L477,143.4 L478.4,141.5 L479.9,139.6 L481.3,137.7 L482.7,135.8 L484.2,133.8 L485.6,131.7 L487,129.7 L488.4,127.5 L489.9,125.3 L491.3,123.1 L492.7,120.8 L494.2,118.4 L495.6,116 L497,113.4 L498.4,110.8 L499.9,108 L501.3,105.1 L502.7,101.9 L504.1,98.63 L505.6,95.04 L507,91.08 L508.4,86.61 L509.9,81.32 L511.3,74.47 L512.7,58 " fill="none"/></g>
<g id="plotLines" stroke-width="2"><g clip-path="url(#plot_window)" stroke="rgb(0,0,139)" stroke-width="1"><path d="M169.9,341 L169.9,341 L171.3,317.7 L172.8,307.9 L174.2,300.4 L175.6,293.9 L177,288.2 L178.5,283 L179.9,278.2 L181.3,273.7 L182.8,269.3 L184.2,265.2 L185.6,261.3 L187,257.5 L188.5,253.8 L189.9,250.2 L191.3,246.7 L192.8,243.2 L194.2,239.9 L195.6,236.6 L197,233.3 L198.5,230.1 L199.9,226.9 L201.3,223.8 L202.8,220.7 L204.2,217.6 L205.6,214.6 L207,211.5 L208.5,208.5 L209.9,205.5 L211.3,202.5 L212.8,199.5 L214.2,196.5 L215.6,193.5 L217,190.5 L218.5,187.5 L219.9,184.4 L221.3,181.4 L222.8,178.3 L224.2,175.2 L225.6,172.1 L227,168.9 L228.5,165.7 L229.9,162.4 L231.3,159.1 L232.8,155.8 L234.2,152.3 L235.6,148.8 L237,145.2 L238.5,141.5 L239.9,137.7 L241.3,133.8 L242.8,129.7 L244.2,125.3 L245.6,120.8 L247,116 L248.5,110.8 L249.9,105.1 L251.3,98.63 L252.8,91.08 L254.2,81.32 L255.6,58 " fill="none"/></g>
<g clip-path="url(#plot_window)" stroke="rgb(139,0,0)" stroke-width="1"><path d="M85.63,324.5 L87.06,317.7 L88.49,312.4 L89.91,307.9 L91.34,304 L92.77,300.4 L94.2,297.1 L95.63,293.9 L97.06,291 L98.48,288.2 L99.91,285.6 L101.3,283 L102.8,280.6 L104.2,278.2 L105.6,275.9 L107.1,273.7 L108.5,271.5 L109.9,269.3 L111.3,267.3 L112.8,265.2 L114.2,263.2 L115.6,261.3 L117.1,259.4 L118.5,257.5 L119.9,255.6 L121.3,253.8 L122.8,252 L124.2,250.2 L125.6,248.4 L127.1,246.7 L128.5,244.9 L129.9,243.2 L131.3,241.5 L132.8,239.9 L134.2,238.2 L135.6,236.6 L137.1,234.9 L138.5,233.3 L139.9,231.7 L141.3,230.1 L142.8,228.5 L144.2,226.9 L145.6,225.4 L147,223.8 L148.5,222.3 L149.9,220.7 L151.3,219.2 L152.8,217.6 L154.2,216.1 L155.6,214.6 L157,213.1 L158.5,211.5 L159.9,210 L161.3,208.5 L162.8,207 L164.2,205.5 L165.6,204 L167,202.5 L168.5,201 L169.9,199.5 L171.3,198 L172.8,196.5 L174.2,195 L175.6,193.5 L177,192 L178.5,190.5 L179.9,189 L181.3,187.5 L182.8,185.9 L184.2,184.4 L185.6,182.9 L187,181.4 L188.5,179.8 L189.9,178.3 L191.3,176.7 L192.8,175.2 L194.2,173.6 L195.6,172.1 L197,170.5 L198.5,168.9 L199.9,167.3 L201.3,165.7 L202.8,164.1 L204.2,162.4 L205.6,160.8 L207,159.1 L208.5,157.5 L209.9,155.8 L211.3,154.1 L212.8,152.3 L214.2,150.6 L215.6,148.8 L217,147 L218.5,145.2 L219.9,143.4 L221.3,141.5 L222.8,139.6 L224.2,137.7 L225.6,135.8 L227,133.8 L228.5,131.7 L229.9,129.7 L231.3,127.5 L232.8,125.3 L234.2,123.1 L235.6,120.8 L237,118.4 L238.5,116 L239.9,113.4 L241.3,110.8 L242.8,108 L244.2,105.1 L245.6,101.9 L247,98.63 L248.5,95.04 L249.9,91.08 L251.3,86.61 L252.8,81.32 L254.2,74.47 L255.6,58 " fill="none"/></g>
<g clip-path="url(#plot_window)" stroke="rgb(0,100,0)" stroke-width="1"><path d="M85.63,327.6 L87.06,322 L88.49,317.7 L89.91,314 L91.34,310.8 L92.77,307.9 L94.2,305.2 L95.63,302.7 L97.06,300.4 L98.48,298.1 L99.91,296 L101.3,293.9 L102.8,292 L104.2,290.1 L105.6,288.2 L107.1,286.5 L108.5,284.7 L109.9,283 L111.3,281.4 L112.8,279.8 L114.2,278.2 L115.6,276.7 L117.1,275.1 L118.5,273.7 L119.9,272.2 L121.3,270.8 L122.8,269.3 L124.2,268 L125.6,266.6 L127.1,265.2 L128.5,263.9 L129.9,262.6 L131.3,261.3 L132.8,260 L134.2,258.7 L135.6,257.5 L137.1,256.2 L138.5,255 L139.9,253.8 L141.3,252.6 L142.8,251.4 L144.2,250.2 L145.6,249 L147,247.8 L148.5,246.7 L149.9,245.5 L151.3,244.4 L152.8,243.2 L154.2,242.1 L155.6,241 L157,239.9 L158.5,238.8 L159.9,237.7 L161.3,236.6 L162.8,235.5 L164.2,234.4 L165.6,233.3 L167,232.2 L168.5,231.2 L169.9,230.1 L171.3,229.1 L172.8,228 L174.2,226.9 L175.6,225.9 L177,224.9 L178.5,223.8 L179.9,222.8 L181.3,221.7 L182.8,220.7 L184.2,219.7 L185.6,218.7 L187,217.6 L188.5,216.6 L189.9,215.6 L191.3,214.6 L192.8,213.6 L194.2,212.6 L195.6,211.5 L197,210.5 L198.5,209.5 L199.9,208.5 L201.3,207.5 L202.8,206.5 L204.2,205.5 L205.6,204.5 L207,203.5 L208.5,202.5 L209.9,201.5 L211.3,200.5 L212.8,199.5 L214.2,198.5 L215.6,197.5 L217,196.5 L218.5,195.5 L219.9,194.5 L221.3,193.5 L222.8,192.5 L224.2,191.5 L225.6,190.5 L227,189.5 L228.5,188.5 L229.9,187.5 L231.3,186.4 L232.8,185.4 L234.2,184.4 L235.6,183.4 L237,182.4 L238.5,181.4 L239.9,180.3 L241.3,179.3 L242.8,178.3 L244.2,177.3 L245.6,176.2 L247,175.2 L248.5,174.1 L249.9,173.1 L251.3,172.1 L252.8,171 L254.2,169.9 L255.6,168.9 L257,167.8 L258.5,166.8 L259.9,165.7 L261.3,164.6 L262.8,163.5 L264.2,162.4 L265.6,161.3 L267,160.2 L268.5,159.1 L269.9,158 L271.3,156.9 L272.7,155.8 L274.2,154.6 L275.6,153.5 L277,152.3 L278.5,151.2 L279.9,150 L281.3,148.8 L282.7,147.6 L284.2,146.4 L285.6,145.2 L287,144 L288.5,142.8 L289.9,141.5 L291.3,140.3 L292.7,139 L294.2,137.7 L295.6,136.4 L297,135.1 L298.5,133.8 L299.9,132.4 L301.3,131 L302.7,129.7 L304.2,128.2 L305.6,126.8 L307,125.3 L308.5,123.9 L309.9,122.3 L311.3,120.8 L312.7,119.2 L314.2,117.6 L315.6,116 L317,114.3 L318.5,112.5 L319.9,110.8 L321.3,108.9 L322.7,107 L324.2,105.1 L325.6,103 L327,100.9 L328.5,98.63 L329.9,96.27 L331.3,93.76 L332.7,91.08 L334.2,88.17 L335.6,84.96 L337,81.32 L338.5,77.03 L339.9,71.44 L341.3,58 L341.3,58 " fill="none"/></g>
<g clip-path="url(#plot_window)" stroke="rgb(255,140,0)" stroke-width="1"><path d="M85.63,330.6 L87.06,326.3 L88.49,323 L89.91,320.2 L91.34,317.7 L92.77,315.4 L94.2,313.4 L95.63,311.4 L97.06,309.6 L98.48,307.9 L99.91,306.3 L101.3,304.7 L102.8,303.2 L104.2,301.8 L105.6,300.4 L107.1,299 L108.5,297.7 L109.9,296.4 L111.3,295.2 L112.8,293.9 L114.2,292.8 L115.6,291.6 L117.1,290.5 L118.5,289.3 L119.9,288.2 L121.3,287.2 L122.8,286.1 L124.2,285.1 L125.6,284 L127.1,283 L128.5,282 L129.9,281.1 L131.3,280.1 L132.8,279.1 L134.2,278.2 L135.6,277.3 L137.1,276.4 L138.5,275.4 L139.9,274.5 L141.3,273.7 L142.8,272.8 L144.2,271.9 L145.6,271 L147,270.2 L148.5,269.3 L149.9,268.5 L151.3,267.7 L152.8,266.9 L154.2,266 L155.6,265.2 L157,264.4 L158.5,263.6 L159.9,262.8 L161.3,262.1 L162.8,261.3 L164.2,260.5 L165.6,259.7 L167,259 L168.5,258.2 L169.9,257.5 L171.3,256.7 L172.8,256 L174.2,255.2 L175.6,254.5 L177,253.8 L178.5,253 L179.9,252.3 L181.3,251.6 L182.8,250.9 L184.2,250.2 L185.6,249.5 L187,248.8 L188.5,248.1 L189.9,247.4 L191.3,246.7 L192.8,246 L194.2,245.3 L195.6,244.6 L197,243.9 L198.5,243.2 L199.9,242.6 L201.3,241.9 L202.8,241.2 L204.2,240.5 L205.6,239.9 L207,239.2 L208.5,238.5 L209.9,237.9 L211.3,237.2 L212.8,236.6 L214.2,235.9 L215.6,235.3 L217,234.6 L218.5,234 L219.9,233.3 L221.3,232.7 L222.8,232 L224.2,231.4 L225.6,230.8 L227,230.1 L228.5,229.5 L229.9,228.8 L231.3,228.2 L232.8,227.6 L234.2,226.9 L235.6,226.3 L237,225.7 L238.5,225.1 L239.9,224.4 L241.3,223.8 L242.8,223.2 L244.2,222.6 L245.6,222 L247,221.3 L248.5,220.7 L249.9,220.1 L251.3,219.5 L252.8,218.9 L254.2,218.3 L255.6,217.6 L257,217 L258.5,216.4 L259.9,215.8 L261.3,215.2 L262.8,214.6 L264.2,214 L265.6,213.4 L267,212.8 L268.5,212.2 L269.9,211.5 L271.3,210.9 L272.7,210.3 L274.2,209.7 L275.6,209.1 L277,208.5 L278.5,207.9 L279.9,207.3 L281.3,206.7 L282.7,206.1 L284.2,205.5 L285.6,204.9 L287,204.3 L288.5,203.7 L289.9,203.1 L291.3,202.5 L292.7,201.9 L294.2,201.3 L295.6,200.7 L297,200.1 L298.5,199.5 L299.9,198.9 L301.3,198.3 L302.7,197.7 L304.2,197.1 L305.6,196.5 L307,195.9 L308.5,195.3 L309.9,194.7 L311.3,194.1 L312.7,193.5 L314.2,192.9 L315.6,192.3 L317,191.7 L318.5,191.1 L319.9,190.5 L321.3,189.9 L322.7,189.3 L324.2,188.7 L325.6,188.1 L327,187.5 L328.5,186.8 L329.9,186.2 L331.3,185.6 L332.7,185 L334.2,184.4 L335.6,183.8 L337,183.2 L338.5,182.6 L339.9,182 L341.3,181.4 L342.7,180.7 L344.2,180.1 L345.6,179.5 L347,178.9 L348.5,178.3 L349.9,177.7 L351.3,177 L352.7,176.4 L354.2,175.8 L355.6,175.2 L357,174.6 L358.5,173.9 L359.9,173.3 L361.3,172.7 L362.7,172.1 L364.2,171.4 L365.6,170.8 L367,170.2 L368.5,169.5 L369.9,168.9 L371.3,168.2 L372.7,167.6 L374.2,167 L375.6,166.3 L377,165.7 L378.5,165 L379.9,164.4 L381.3,163.7 L382.7,163.1 L384.2,162.4 L385.6,161.8 L387,161.1 L388.4,160.5 L389.9,159.8 L391.3,159.1 L392.7,158.5 L394.2,157.8 L395.6,157.1 L397,156.4 L398.4,155.8 L399.9,155.1 L401.3,154.4 L402.7,153.7 L404.2,153 L405.6,152.3 L407,151.6 L408.4,150.9 L409.9,150.2 L411.3,149.5 L412.7,148.8 L414.2,148.1 L415.6,147.4 L417,146.7 L418.4,146 L419.9,145.2 L421.3,144.5 L422.7,143.8 L424.2,143 L425.6,142.3 L427,141.5 L428.4,140.8 L429.9,140 L431.3,139.3 L432.7,138.5 L434.2,137.7 L435.6,136.9 L437,136.2 L438.4,135.4 L439.9,134.6 L441.3,133.8 L442.7,133 L444.2,132.1 L445.6,131.3 L447,130.5 L448.4,129.7 L449.9,128.8 L451.3,128 L452.7,127.1 L454.2,126.2 L455.6,125.3 L457,124.5 L458.4,123.6 L459.9,122.6 L461.3,121.7 L462.7,120.8 L464.2,119.9 L465.6,118.9 L467,117.9 L468.4,117 L469.9,116 L471.3,115 L472.7,113.9 L474.2,112.9 L475.6,111.8 L477,110.8 L478.4,109.7 L479.9,108.5 L481.3,107.4 L482.7,106.2 L484.2,105.1 L485.6,103.8 L487,102.6 L488.4,101.3 L489.9,99.99 L491.3,98.63 L492.7,97.23 L494.2,95.78 L495.6,94.28 L497,92.71 L498.4,91.08 L499.9,89.36 L501.3,87.55 L502.7,85.63 L504.1,83.56 L505.6,81.32 L507,78.85 L508.4,76.05 L509.9,72.73 L511.3,68.41 L512.7,58 L512.7,58 " fill="none"/></g>
<g clip-path="url(#plot_window)" stroke="rgb(127,255,0)" stroke-width="1"><path d="M341.3,341 L342.7,324.5 L344.2,317.7 L345.6,312.4 L347,307.9 L348.5,304 L349.9,300.4 L351.3,297.1 L352.7,293.9 L354.2,291 L355.6,288.2 L357,285.6 L358.5,283 L359.9,280.6 L361.3,278.2 L362.7,275.9 L364.2,273.7 L365.6,271.5 L367,269.3 L368.5,267.3 L369.9,265.2 L371.3,263.2 L372.7,261.3 L374.2,259.4 L375.6,257.5 L377,255.6 L378.5,253.8 L379.9,252 L381.3,250.2 L382.7,248.4 L384.2,246.7 L385.6,244.9 L387,243.2 L388.4,241.5 L389.9,239.9 L391.3,238.2 L392.7,236.6 L394.2,234.9 L395.6,233.3 L397,231.7 L398.4,230.1 L399.9,228.5 L401.3,226.9 L402.7,225.4 L404.2,223.8 L405.6,222.3 L407,220.7 L408.4,219.2 L409.9,217.6 L411.3,216.1 L412.7,214.6 L414.2,213.1 L415.6,211.5 L417,210 L418.4,208.5 L419.9,207 L421.3,205.5 L422.7,204 L424.2,202.5 L425.6,201 L427,199.5 L428.4,198 L429.9,196.5 L431.3,195 L432.7,193.5 L434.2,192 L435.6,190.5 L437,189 L438.4,187.5 L439.9,185.9 L441.3,184.4 L442.7,182.9 L444.2,181.4 L445.6,179.8 L447,178.3 L448.4,176.7 L449.9,175.2 L451.3,173.6 L452.7,172.1 L454.2,170.5 L455.6,168.9 L457,167.3 L458.4,165.7 L459.9,164.1 L461.3,162.4 L462.7,160.8 L464.2,159.1 L465.6,157.5 L467,155.8 L468.4,154.1 L469.9,152.3 L471.3,150.6 L472.7,148.8 L474.2,147 L475.6,145.2 L477,143.4 L478.4,141.5 L479.9,139.6 L481.3,137.7 L482.7,135.8 L484.2,133.8 L485.6,131.7 L487,129.7 L488.4,127.5 L489.9,125.3 L491.3,123.1 L492.7,120.8 L494.2,118.4 L495.6,116 L497,113.4 L498.4,110.8 L499.9,108 L501.3,105.1 L502.7,101.9 L504.1,98.63 L505.6,95.04 L507,91.08 L508.4,86.61 L509.9,81.32 L511.3,74.47 L512.7,58 L512.7,58 " fill="none"/></g>
</g>
<g id="plotPoints" clip-path="url(#plot_window)"></g>
<g id="legendBackground" stroke="rgb(119,136,153)" fill="rgb(255,255,255)" stroke-width="1"><rect x="526.7" y="58" width="197.3" height="165"/><rect x="526.7" y="58" width="197.3" height="165"/></g>

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

@@ -52,7 +52,7 @@ xmlns ="http://www.w3.org/2000/svg"
<g clip-path="url(#plot_window)" stroke="rgb(127,255,0)" stroke-width="1"><path d="M342.7,142.9 L344.2,200.3 L345.6,225.6 L347,240.7 L348.5,250.9 L349.9,258.4 L351.3,264.2 L352.7,268.8 L354.2,272.6 L355.6,275.8 L357,278.6 L358.5,281 L359.9,283.1 L361.3,284.9 L362.7,286.5 L364.2,288 L365.6,289.4 L367,290.6 L368.5,291.7 L369.9,292.7 L371.3,293.6 L372.7,294.5 L374.2,295.2 L375.6,296 L377,296.7 L378.5,297.3 L379.9,297.9 L381.3,298.4 L382.7,298.9 L384.2,299.4 L385.6,299.9 L387,300.3 L388.4,300.7 L389.9,301 L391.3,301.4 L392.7,301.7 L394.2,302 L395.6,302.3 L397,302.5 L398.4,302.8 L399.9,303 L401.3,303.2 L402.7,303.4 L404.2,303.6 L405.6,303.8 L407,304 L408.4,304.1 L409.9,304.2 L411.3,304.4 L412.7,304.5 L414.2,304.6 L415.6,304.7 L417,304.7 L418.4,304.8 L419.9,304.9 L421.3,304.9 L422.7,304.9 L424.2,305 L425.6,305 L427,305 L428.4,305 L429.9,305 L431.3,304.9 L432.7,304.9 L434.2,304.9 L435.6,304.8 L437,304.7 L438.4,304.7 L439.9,304.6 L441.3,304.5 L442.7,304.4 L444.2,304.2 L445.6,304.1 L447,304 L448.4,303.8 L449.9,303.6 L451.3,303.4 L452.7,303.2 L454.2,303 L455.6,302.8 L457,302.5 L458.4,302.3 L459.9,302 L461.3,301.7 L462.7,301.4 L464.2,301 L465.6,300.7 L467,300.3 L468.4,299.9 L469.9,299.4 L471.3,298.9 L472.7,298.4 L474.2,297.9 L475.6,297.3 L477,296.7 L478.4,296 L479.9,295.2 L481.3,294.5 L482.7,293.6 L484.2,292.7 L485.6,291.7 L487,290.6 L488.4,289.4 L489.9,288 L491.3,286.5 L492.7,284.9 L494.2,283.1 L495.6,281 L497,278.6 L498.4,275.8 L499.9,272.6 L501.3,268.8 L502.7,264.2 L504.1,258.4 L505.6,250.9 L507,240.7 L508.4,225.6 L509.9,200.3 L511.3,142.9 " fill="none"/></g>
</g>
<g id="plotPoints" clip-path="url(#plot_window)"></g>
<g id="limitPoints" stroke="rgb(119,136,153)" fill="rgb(250,235,215)"><polygon points=" 507.7,48 517.7,48 512.7,58"/><polygon points=" 79.2,48 89.2,48 84.2,58"/><polygon points=" 507.7,48 517.7,48 512.7,58"/><polygon points=" 79.2,48 89.2,48 84.2,58"/><polygon points=" 507.7,48 517.7,48 512.7,58"/><polygon points=" 79.2,48 89.2,48 84.2,58"/><polygon points=" 507.7,48 517.7,48 512.7,58"/><polygon points=" 507.7,48 517.7,48 512.7,58"/></g>
<g id="limitPoints" stroke="rgb(119,136,153)" fill="rgb(250,235,215)"><polygon points=" 164.9,48 174.9,48 169.9,58"/><polygon points=" 250.6,48 260.6,48 255.6,58"/><polygon points=" 79.2,48 89.2,48 84.2,58"/><polygon points=" 250.6,48 260.6,48 255.6,58"/><polygon points=" 79.2,48 89.2,48 84.2,58"/><polygon points=" 336.3,48 346.3,48 341.3,58"/><polygon points=" 79.2,48 89.2,48 84.2,58"/><polygon points=" 507.7,48 517.7,48 512.7,58"/><polygon points=" 336.3,48 346.3,48 341.3,58"/><polygon points=" 507.7,48 517.7,48 512.7,58"/></g>
<g id="legendBackground" stroke="rgb(119,136,153)" fill="rgb(255,255,255)" stroke-width="1"><rect x="526.7" y="58" width="197.3" height="165"/><rect x="526.7" y="58" width="197.3" height="165"/></g>
<g id="legendPoints"><g stroke="rgb(0,0,139)" fill="rgb(255,255,255)" stroke-width="1"><line x1="541.7" y1="88" x2="556.7" y2="88"/></g>
<g stroke="rgb(139,0,0)" fill="rgb(255,255,255)" stroke-width="1"><line x1="541.7" y1="118" x2="556.7" y2="118"/></g>

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -101,7 +101,7 @@ public:
double margin = 1e-2; // Margin of 1% (say) to get lowest off the 'end stop'.
if((a != 0) && (fabs(a) > margin))
{
mod = a * (1 + (a > 0) ? margin : -margin));
mod = a * (1 + ((a > 0) ? margin : -margin));
}
else
{ // Case of mod near zero?

View File

@@ -111,7 +111,7 @@ This manual is also available in <a href="http://sourceforge.net/projects/boost/
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: October 20, 2014 at 13:16:35 GMT</small></p></td>
<td align="left"><p><small>Last revised: November 27, 2014 at 14:58:32 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>

View File

@@ -24,7 +24,7 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id1540283"></a>Function Index</h2></div></div></div>
<a name="id1550233"></a>Function Index</h2></div></div></div>
<p><a class="link" href="s01.html#idx_id_0">A</a> <a class="link" href="s01.html#idx_id_1">B</a> <a class="link" href="s01.html#idx_id_2">C</a> <a class="link" href="s01.html#idx_id_3">D</a> <a class="link" href="s01.html#idx_id_4">E</a> <a class="link" href="s01.html#idx_id_5">F</a> <a class="link" href="s01.html#idx_id_6">G</a> <a class="link" href="s01.html#idx_id_7">H</a> <a class="link" href="s01.html#idx_id_8">I</a> <a class="link" href="s01.html#idx_id_9">J</a> <a class="link" href="s01.html#idx_id_10">K</a> <a class="link" href="s01.html#idx_id_11">L</a> <a class="link" href="s01.html#idx_id_12">M</a> <a class="link" href="s01.html#idx_id_13">N</a> <a class="link" href="s01.html#idx_id_14">O</a> <a class="link" href="s01.html#idx_id_15">P</a> <a class="link" href="s01.html#idx_id_16">Q</a> <a class="link" href="s01.html#idx_id_17">R</a> <a class="link" href="s01.html#idx_id_18">S</a> <a class="link" href="s01.html#idx_id_19">T</a> <a class="link" href="s01.html#idx_id_20">U</a> <a class="link" href="s01.html#idx_id_21">V</a> <a class="link" href="s01.html#idx_id_23">Z</a></p>
<div class="variablelist"><dl class="variablelist">
<dt>

View File

@@ -24,7 +24,7 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id1558149"></a>Class Index</h2></div></div></div>
<a name="id1570794"></a>Class Index</h2></div></div></div>
<p><a class="link" href="s02.html#idx_id_24">A</a> <a class="link" href="s02.html#idx_id_25">B</a> <a class="link" href="s02.html#idx_id_26">C</a> <a class="link" href="s02.html#idx_id_27">D</a> <a class="link" href="s02.html#idx_id_28">E</a> <a class="link" href="s02.html#idx_id_29">F</a> <a class="link" href="s02.html#idx_id_30">G</a> <a class="link" href="s02.html#idx_id_31">H</a> <a class="link" href="s02.html#idx_id_32">I</a> <a class="link" href="s02.html#idx_id_35">L</a> <a class="link" href="s02.html#idx_id_36">M</a> <a class="link" href="s02.html#idx_id_37">N</a> <a class="link" href="s02.html#idx_id_38">O</a> <a class="link" href="s02.html#idx_id_39">P</a> <a class="link" href="s02.html#idx_id_40">Q</a> <a class="link" href="s02.html#idx_id_41">R</a> <a class="link" href="s02.html#idx_id_42">S</a> <a class="link" href="s02.html#idx_id_43">T</a> <a class="link" href="s02.html#idx_id_44">U</a> <a class="link" href="s02.html#idx_id_46">W</a></p>
<div class="variablelist"><dl class="variablelist">
<dt>

View File

@@ -24,7 +24,7 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id1559245"></a>Typedef Index</h2></div></div></div>
<a name="id1572386"></a>Typedef Index</h2></div></div></div>
<p><a class="link" href="s03.html#idx_id_48">A</a> <a class="link" href="s03.html#idx_id_49">B</a> <a class="link" href="s03.html#idx_id_50">C</a> <a class="link" href="s03.html#idx_id_51">D</a> <a class="link" href="s03.html#idx_id_52">E</a> <a class="link" href="s03.html#idx_id_53">F</a> <a class="link" href="s03.html#idx_id_54">G</a> <a class="link" href="s03.html#idx_id_55">H</a> <a class="link" href="s03.html#idx_id_56">I</a> <a class="link" href="s03.html#idx_id_59">L</a> <a class="link" href="s03.html#idx_id_61">N</a> <a class="link" href="s03.html#idx_id_62">O</a> <a class="link" href="s03.html#idx_id_63">P</a> <a class="link" href="s03.html#idx_id_65">R</a> <a class="link" href="s03.html#idx_id_66">S</a> <a class="link" href="s03.html#idx_id_67">T</a> <a class="link" href="s03.html#idx_id_68">U</a> <a class="link" href="s03.html#idx_id_69">V</a> <a class="link" href="s03.html#idx_id_70">W</a></p>
<div class="variablelist"><dl class="variablelist">
<dt>

View File

@@ -24,7 +24,7 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id1563369"></a>Macro Index</h2></div></div></div>
<a name="id1576499"></a>Macro Index</h2></div></div></div>
<p><a class="link" href="s04.html#idx_id_73">B</a> <a class="link" href="s04.html#idx_id_77">F</a></p>
<div class="variablelist"><dl class="variablelist">
<dt>

View File

@@ -23,7 +23,7 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id1566631"></a>Index</h2></div></div></div>
<a name="id1577831"></a>Index</h2></div></div></div>
<p><a class="link" href="s05.html#idx_id_96">A</a> <a class="link" href="s05.html#idx_id_97">B</a> <a class="link" href="s05.html#idx_id_98">C</a> <a class="link" href="s05.html#idx_id_99">D</a> <a class="link" href="s05.html#idx_id_100">E</a> <a class="link" href="s05.html#idx_id_101">F</a> <a class="link" href="s05.html#idx_id_102">G</a> <a class="link" href="s05.html#idx_id_103">H</a> <a class="link" href="s05.html#idx_id_104">I</a> <a class="link" href="s05.html#idx_id_105">J</a> <a class="link" href="s05.html#idx_id_106">K</a> <a class="link" href="s05.html#idx_id_107">L</a> <a class="link" href="s05.html#idx_id_108">M</a> <a class="link" href="s05.html#idx_id_109">N</a> <a class="link" href="s05.html#idx_id_110">O</a> <a class="link" href="s05.html#idx_id_111">P</a> <a class="link" href="s05.html#idx_id_112">Q</a> <a class="link" href="s05.html#idx_id_113">R</a> <a class="link" href="s05.html#idx_id_114">S</a> <a class="link" href="s05.html#idx_id_115">T</a> <a class="link" href="s05.html#idx_id_116">U</a> <a class="link" href="s05.html#idx_id_117">V</a> <a class="link" href="s05.html#idx_id_118">W</a> <a class="link" href="s05.html#idx_id_119">Z</a></p>
<div class="variablelist"><dl class="variablelist">
<dt>

View File

@@ -27,7 +27,7 @@
<a name="math_toolkit.conventions"></a><a class="link" href="conventions.html" title="Document Conventions">Document Conventions</a>
</h2></div></div></div>
<p>
<a class="indexterm" name="id898684"></a>
<a class="indexterm" name="id908244"></a>
</p>
<p>
This documentation aims to use of the following naming and formatting conventions.

View File

@@ -27,7 +27,7 @@
<a name="math_toolkit.navigation"></a><a class="link" href="navigation.html" title="Navigation">Navigation</a>
</h2></div></div></div>
<p>
<a class="indexterm" name="id898599"></a>
<a class="indexterm" name="id908135"></a>
</p>
<p>
Boost.Math documentation is provided in both HTML and PDF formats.

View File

@@ -710,7 +710,20 @@
/cygdrive/c/progra~1/Inkscape/inkscape -d 120 -e $(cygpath -a -w $(basename $file .svg).png) $(cygpath -a -w $file);
done</pre>
<p>
Currently Inkscape seems to generate the better looking png's.
Using BASH
</p>
<pre class="programlisting"># Convert single SVG to PNG file.
# /c/progra~1/Inkscape/inkscape -d 120 -e a.png a.svg
</pre>
<p>
or to convert All files in folder SVG to PNG.
</p>
<pre class="programlisting">for file in *.svg; do
/c/progra~1/Inkscape/inkscape -d 120 -e $(basename $file .svg).png $file
done
</pre>
<p>
Currently Inkscape seems to generate the better looking PNGs.
</p>
<p>
The PDF is generated into \pdf\math.pdf using a command from a shell or command

View File

@@ -90,11 +90,10 @@ namespace boost
function,
msg.c_str(), x_max, pol);
// "x_max argument is %1%, but must be > x_min !", x_max, pol);
// "x_max argument is %1%, but must be > x_min %2!", x_max, x_min, pol); would be better. TODO?
// "x_max argument is %1%, but must be > x_min %2!", x_max, x_min, pol); would be better.
// But would require replication of all helpers functions in /policies/error_handling.hpp for two values,
// as well as two value versions of raise_error, raise_domain_error and do_format ...
// so use slightly hacky lexical_cast to string instead.
return false;
}
return true;
@@ -208,22 +207,44 @@ namespace boost
inline const std::pair<RealType, RealType> support(const arcsine_distribution<RealType, Policy>& dist)
{ // Range of supported values for random variable x.
// This is range where cdf rises from 0 to 1, and outside it, the pdf is zero.
return std::pair<RealType, RealType>(static_cast<RealType>(dist.x_min()), static_cast<RealType>(dist.x_max()));
}
template <class RealType, class Policy>
inline RealType mean(const arcsine_distribution<RealType, Policy>& dist)
{ // Mean of arcsine distribution .
return (dist.x_min() + dist.x_max()) / 2;
RealType result;
RealType x_min = dist.x_min();
RealType x_max = dist.x_max();
if (false == arcsine_detail::check_dist(
"boost::math::mean(arcsine_distribution<%1%> const&, %1% )",
x_min,
x_max,
&result, Policy())
)
{
return result;
}
return (x_min + x_max) / 2;
} // mean
template <class RealType, class Policy>
inline RealType variance(const arcsine_distribution<RealType, Policy>& dist)
{ // Variance of standard arcsine distribution = (1-0)/8 = 0.125.
RealType a = dist.x_min();
RealType b = dist.x_max();
return (b - a) * (b - a) / 8;
RealType result;
RealType x_min = dist.x_min();
RealType x_max = dist.x_max();
if (false == arcsine_detail::check_dist(
"boost::math::variance(arcsine_distribution<%1%> const&, %1% )",
x_min,
x_max,
&result, Policy())
)
{
return result;
}
return (x_max - x_min) * (x_max - x_min) / 8;
} // variance
template <class RealType, class Policy>
@@ -240,25 +261,77 @@ namespace boost
template <class RealType, class Policy>
inline RealType median(const arcsine_distribution<RealType, Policy>& dist)
{ // Median of arcsine distribution (a + b) / 2 == mean.
return (dist.x_min() + dist.x_max()) / 2;
RealType x_min = dist.x_min();
RealType x_max = dist.x_max();
RealType result;
if (false == arcsine_detail::check_dist(
"boost::math::median(arcsine_distribution<%1%> const&, %1% )",
x_min,
x_max,
&result, Policy())
)
{
return result;
}
return (x_min + x_max) / 2;
}
template <class RealType, class Policy>
inline RealType skewness(const arcsine_distribution<RealType, Policy>& /* dist */)
inline RealType skewness(const arcsine_distribution<RealType, Policy>& dist)
{
RealType result;
RealType x_min = dist.x_min();
RealType x_max = dist.x_max();
if (false == arcsine_detail::check_dist(
"boost::math::skewness(arcsine_distribution<%1%> const&, %1% )",
x_min,
x_max,
&result, Policy())
)
{
return result;
}
return 0;
} // skewness
template <class RealType, class Policy>
inline RealType kurtosis_excess(const arcsine_distribution<RealType, Policy>& /* dist */)
inline RealType kurtosis_excess(const arcsine_distribution<RealType, Policy>& dist)
{
RealType result = -3;
RealType result;
RealType x_min = dist.x_min();
RealType x_max = dist.x_max();
if (false == arcsine_detail::check_dist(
"boost::math::kurtosis_excess(arcsine_distribution<%1%> const&, %1% )",
x_min,
x_max,
&result, Policy())
)
{
return result;
}
result = -3;
return result / 2;
} // kurtosis_excess
template <class RealType, class Policy>
inline RealType kurtosis(const arcsine_distribution<RealType, Policy>& dist)
{
RealType result;
RealType x_min = dist.x_min();
RealType x_max = dist.x_max();
if (false == arcsine_detail::check_dist(
"boost::math::kurtosis(arcsine_distribution<%1%> const&, %1% )",
x_min,
x_max,
&result, Policy())
)
{
return result;
}
return 3 + kurtosis_excess(dist);
} // kurtosis
@@ -275,7 +348,7 @@ namespace boost
RealType x = xx;
// Argument checks:
RealType result = 0;
RealType result = 0;
if (false == arcsine_detail::check_dist_and_x(
function,
lo, hi, x,

View File

@@ -41,35 +41,183 @@ using std::endl;
#include <limits>
using std::numeric_limits;
template <class RealType>
void test_ignore_policy(RealType)
{
// Check on returns when errors are ignored.
if ((typeid(RealType) != typeid(boost::math::concepts::real_concept))
&& std::numeric_limits<RealType>::has_infinity
&& std::numeric_limits<RealType>::has_quiet_NaN
)
{ // Ordinary floats only.
using namespace boost::math;
// RealType inf = std::numeric_limits<RealType>::infinity();
RealType nan = std::numeric_limits<RealType>::quiet_NaN();
using boost::math::policies::policy;
// Types of error whose action can be altered by policies:.
//using boost::math::policies::evaluation_error;
//using boost::math::policies::domain_error;
//using boost::math::policies::overflow_error;
//using boost::math::policies::underflow_error;
//using boost::math::policies::domain_error;
//using boost::math::policies::pole_error;
//// Actions on error (in enum error_policy_type):
//using boost::math::policies::errno_on_error;
//using boost::math::policies::ignore_error;
//using boost::math::policies::throw_on_error;
//using boost::math::policies::denorm_error;
//using boost::math::policies::pole_error;
//using boost::math::policies::user_error;
typedef policy<
boost::math::policies::domain_error<boost::math::policies::ignore_error>,
boost::math::policies::overflow_error<boost::math::policies::ignore_error>,
boost::math::policies::underflow_error<boost::math::policies::ignore_error>,
boost::math::policies::denorm_error<boost::math::policies::ignore_error>,
boost::math::policies::pole_error<boost::math::policies::ignore_error>,
boost::math::policies::evaluation_error<boost::math::policies::ignore_error>
> ignore_all_policy;
typedef arcsine_distribution<RealType, ignore_all_policy> ignore_error_arcsine;
// Only test NaN and infinity if type has these features (realconcept returns zero).
// Integers are always converted to RealType,
// others requires static cast to RealType from long double.
if (std::numeric_limits<RealType>::has_quiet_NaN)
{
// PDF
if (std::numeric_limits<RealType>::has_infinity)
{
// pdf(ignore_error_arcsine(0, 1), std::numeric_limits<RealType>::infinity());
// std::cout << "arcsine(-1,+1) ignore error pdf (infinity) " << pdf(ignore_error_arcsine(-1, +1), std::numeric_limits<RealType>::infinity()) << std::endl;
// arcsine(-1,+1) ignore error pdf (infinity) 1.#QNAN
}
BOOST_CHECK((boost::math::isnan)(pdf(ignore_error_arcsine(0, 1), std::numeric_limits<RealType>::infinity()))); // x == infinity
BOOST_CHECK((boost::math::isnan)(pdf(ignore_error_arcsine(-1, 1), std::numeric_limits<RealType>::infinity()))); // x == infinity
BOOST_CHECK((boost::math::isnan)(pdf(ignore_error_arcsine(0, 1), static_cast <RealType>(-2)))); // x < xmin
BOOST_CHECK((boost::math::isnan)(pdf(ignore_error_arcsine(-1, 1), static_cast <RealType>(-2)))); // x < xmin
BOOST_CHECK((boost::math::isnan)(pdf(ignore_error_arcsine(0, 1), static_cast <RealType>(+2)))); // x > x_max
BOOST_CHECK((boost::math::isnan)(pdf(ignore_error_arcsine(-1, 1), static_cast <RealType>(+2)))); // x > x_max
// Mean
BOOST_CHECK((boost::math::isnan)(mean(ignore_error_arcsine(-nan, 0))));
BOOST_CHECK((boost::math::isnan)(mean(ignore_error_arcsine(+nan, 0))));
if (std::numeric_limits<RealType>::has_infinity)
{
BOOST_CHECK((boost::math::isnan)(mean(ignore_error_arcsine(-std::numeric_limits<RealType>::infinity(), 0))));
// std::cout << "arcsine(-inf,+1) mean " << mean(ignore_error_arcsine(-std::numeric_limits<RealType>::infinity())) << std::endl;
BOOST_CHECK((boost::math::isnan)(mean(ignore_error_arcsine(std::numeric_limits<RealType>::infinity(), 0))));
}
// Check error message is correct.
try
{
typedef arcsine_distribution<RealType> signal_error_arcsine;
//std::cout << mean(signal_error_arcsine(-std::numeric_limits<RealType>::infinity())) << std::endl;
// Error in function boost::math::arcsine_distribution<float>::arcsine_distribution: x_min argument is -1.#INF, but must be finite !
}
catch (std::exception ex)
{
std::cout << ex.what() << std::endl;
}
// NaN constructors.
BOOST_CHECK((boost::math::isnan)(mean(ignore_error_arcsine(2, nan))));
BOOST_CHECK((boost::math::isnan)(mean(ignore_error_arcsine(nan, nan))));
BOOST_CHECK((boost::math::isnan)(mean(ignore_error_arcsine(nan, 2))));
// Variance
BOOST_CHECK((boost::math::isnan)(variance(ignore_error_arcsine(nan, 0))));
BOOST_CHECK((boost::math::isnan)(variance(ignore_error_arcsine(1, nan))));
BOOST_CHECK((boost::math::isnan)(variance(ignore_error_arcsine(2, nan))));
BOOST_CHECK((boost::math::isnan)(variance(ignore_error_arcsine(0, 0))));
BOOST_CHECK((boost::math::isnan)(variance(ignore_error_arcsine(1, 0))));
BOOST_CHECK((boost::math::isnan)(variance(ignore_error_arcsine(static_cast<RealType>(1.7L), 0))));
BOOST_CHECK((boost::math::isnan)(variance(ignore_error_arcsine(2, 0))));
// Skewness
BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_arcsine(nan, 0))));
BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_arcsine(-1, nan))));
BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_arcsine(0, 0))));
BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_arcsine(1, 0))));
BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_arcsine(2, 0))));
BOOST_CHECK((boost::math::isnan)(skewness(ignore_error_arcsine(3, 0))));
// Kurtosis
BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_arcsine(nan, 0))));
BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_arcsine(-1, nan))));
BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_arcsine(0, 0))));
BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_arcsine(1, 0))));
BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_arcsine(2, 0))));
BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_arcsine(static_cast<RealType>(2.0001L), 0))));
BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_arcsine(3, 0))));
BOOST_CHECK((boost::math::isnan)(kurtosis(ignore_error_arcsine(4, 0))));
// Kurtosis excess
BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_arcsine(nan, 0))));
BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_arcsine(-1, nan))));
BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_arcsine(0, 0))));
BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_arcsine(1, 0))));
BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_arcsine(2, 0))));
BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_arcsine(static_cast<RealType>(2.0001L), 0))));
BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_arcsine(3, 0))));
BOOST_CHECK((boost::math::isnan)(kurtosis_excess(ignore_error_arcsine(4, 0))));
} // has_quiet_NaN
//
BOOST_CHECK(boost::math::isfinite(mean(ignore_error_arcsine(0, std::numeric_limits<RealType>::epsilon()))));
// Checks on error messages.
try
{
typedef arcsine_distribution<RealType> signal_error_arcsine;
// std::cout << "mean(ignore_error_arcsine(0, std::numeric_limits<RealType>::epsilon())) == " << std::endl;
// std::cout << mean(ignore_error_arcsine(0, std::numeric_limits<RealType>::epsilon())) << std::endl; // 5.96046e-008
//std::cout << "mean(ignore_error_arcsine(0, 0)) == " << std::endl;
//std::cout << mean(ignore_error_arcsine(0, 0)) << std::endl; // 1.#QNAN
}
catch (std::exception ex)
{
std::cout << ex.what() << std::endl;
}
check_support<arcsine_distribution<RealType> >(arcsine_distribution<RealType>(0, 1));
} // ordinary floats.
} // template <class RealType> void test_ignore_policy(RealType)
template <class RealType>
RealType informax()
{
{ //! \return Infinity else max_value.
return ((std::numeric_limits<RealType>::has_infinity) ?
std::numeric_limits<RealType>::infinity() : boost::math::tools::max_value<RealType>());
}
/*
template <class RealType>
void test_spot(
RealType a, // alpha a
RealType b, // arcsine b
RealType a, // alpha a or lo or x_min
RealType b, // arcsine b or hi or x_maz
RealType x, // Probability
RealType P, // CDF of arcsine(a, b)
RealType Q, // Complement of CDF
RealType Q, // Complement of CDF of arcsine (a, b)
RealType tol) // Test tolerance.
{
boost::math::arcsine_distribution<RealType> arcsine(a, b);
BOOST_CHECK_CLOSE_FRACTION(cdf(aarcsine, x), P, tol);
boost::math::arcsine_distribution<RealType> anarcsine(a, b);
BOOST_CHECK_CLOSE_FRACTION(cdf(anarcsine, x), P, tol);
if ((P < 0.99) && (Q < 0.99))
{ // We can only check this if P is not too close to 1,
{ // We can only check this if P is not too close to 1,
// so that we can guarantee that Q is free of error,
// (and similarly for Q)
BOOST_CHECK_CLOSE_FRACTION(
cdf(complement(aarcsine, x)), Q, tol);
// (and similarly for Q).
BOOST_CHECK_CLOSE_FRACTION(cdf(complement(anarcsine, x)), Q, tol);
if (x != 0)
{
BOOST_CHECK_CLOSE_FRACTION(
quantile(aarcsine, P), x, tol);
quantile(anarcsine, P), x, tol);
}
else
{
@@ -79,24 +227,23 @@ void test_spot(
{
// Limit where this is checked: if exponent range is very large we may
// run out of iterations in our root finding algorithm.
BOOST_CHECK(quantile(aarcsine, P) < boost::math::tools::epsilon<RealType>() * 10);
BOOST_CHECK(quantile(anarcsine, P) < boost::math::tools::epsilon<RealType>() * 10);
}
} // if k
if (x != 0)
{
BOOST_CHECK_CLOSE_FRACTION(quantile(complement(aarcsine, Q)), x, tol);
BOOST_CHECK_CLOSE_FRACTION(quantile(complement(anarcsine, Q)), x, tol);
}
else
{ // Just check quantile is very small:
if ((std::numeric_limits<RealType>::max_exponent <= std::numeric_limits<double>::max_exponent) && (boost::is_floating_point<RealType>::value))
{ // Limit where this is checked: if exponent range is very large we may
// run out of iterations in our root finding algorithm.
BOOST_CHECK(quantile(complement(aarcsine, Q)) < boost::math::tools::epsilon<RealType>() * 10);
BOOST_CHECK(quantile(complement(anarcsine, Q)) < boost::math::tools::epsilon<RealType>() * 10);
}
} // if x
}
} // template <class RealType> void test_spot
*/
template <class RealType> // Any floating-point type RealType.
void test_spots(RealType)
@@ -133,8 +280,25 @@ void test_spots(RealType)
// 0.63661977236758134307553505349005744813783858296183
arcsine_distribution<RealType> arcsine_01; // (Our) Standard arcsine.
// Member functions.
BOOST_CHECK_EQUAL(arcsine_01.x_min(), 0);
BOOST_CHECK_EQUAL(arcsine_01.x_max(), 1);
// Derived functions.
BOOST_CHECK_EQUAL(mean(arcsine_01), 0.5); // 1 / (1 + 1) = 1/2 exactly.
BOOST_CHECK_EQUAL(median(arcsine_01), 0.5); // 1 / (1 + 1) = 1/2 exactly.
BOOST_CHECK_EQUAL(variance(arcsine_01), 0.125); // 1/8 = 0.125
BOOST_CHECK_CLOSE_FRACTION(standard_deviation(arcsine_01), one_div_root_two<double>() / 2, tolerance); // 1/ sqrt(s) = 0.35355339059327379
BOOST_CHECK_EQUAL(skewness(arcsine_01), 0); //
BOOST_CHECK_EQUAL(kurtosis_excess(arcsine_01), -1.5); // 3/2
BOOST_CHECK_EQUAL(support(arcsine_01).first, 0); //
BOOST_CHECK_EQUAL(range(arcsine_01).first, 0); //
BOOST_CHECK_THROW(mode(arcsine_01), std::domain_error); // Two modes at x_min and x_max, so throw instead.
// PDF
// N[PDF[arcsinedistribution[0, 1], 0.25], 50]
// N[PDF[arcsinedistribution[0, 1], 0.75], 50]
// 0.73510519389572273268176866441729258852984864048885
BOOST_CHECK_CLOSE_FRACTION(pdf(arcsine_01, 0.000001), static_cast<RealType>(318.31004533885312973989414360099118178698415543136L), tolerance);
BOOST_CHECK_CLOSE_FRACTION(pdf(arcsine_01, 0.000005), static_cast<RealType>(142.35286456604168061345817902422241622116338936911L), tolerance);
@@ -179,14 +343,12 @@ void test_spots(RealType)
// Quantile.
// Check 1st, 2nd and 3rd quartiles.
// N[PDF[arcsinedistribution[0, 1], 0.25], 50]
// 0.73510519389572273268176866441729258852984864048885
BOOST_CHECK_CLOSE_FRACTION(quantile(arcsine_01, static_cast<RealType>(0.25L)), static_cast<RealType>(0.14644660940672624L), tolerance);
BOOST_CHECK_CLOSE_FRACTION(quantile(arcsine_01, static_cast<RealType>(0.5L)), 0.5, 2 * tolerance); // probability = 0.5, x = 0.5
BOOST_CHECK_CLOSE_FRACTION(quantile(arcsine_01, static_cast<RealType>(0.75L)), static_cast<RealType>(0.85355339059327373L), tolerance);
// N[CDF[arcsinedistribution[0, 1], 0.05], 50] == 0.14356629312870627075094188477505571882161519989741
BOOST_CHECK_CLOSE_FRACTION(quantile(arcsine_01, static_cast<RealType>(0.14356629312870627075094188477505571882161519989741L)), 0.05, tolerance);
@@ -232,6 +394,30 @@ void test_spots(RealType)
BOOST_CHECK_SMALL(quantile(as_m11, static_cast<RealType>(0.5L)), 2 * tolerance); // p = 0.5, x = 0
BOOST_CHECK_CLOSE_FRACTION(quantile(as_m11, static_cast<RealType>(2) / 3), +static_cast<RealType>(0.5L), 4 * tolerance); // p = 2/3, x = +0.5
// Loop back tests.
test_spot(
static_cast<RealType>(0), // lo or a
static_cast<RealType>(1), // hi or b
static_cast<RealType>(0.05), // Random variate x
static_cast<RealType>(0.14356629312870627075094188477505571882161519989741L), // Probability of result (CDF of arcsine), P
static_cast<RealType>(0.85643370687129372924905811522494428117838480010259L), // Complement of CDF Q = 1 - P
tolerance); // Test tolerance.
test_spot(
static_cast<RealType>(0), // lo or a
static_cast<RealType>(1), // hi or b
static_cast<RealType>(0.95), // Random variate x
static_cast<RealType>(0.85643370687129372924905811522494428117838480010259L), // Probability of result (CDF of arcsine), P
static_cast<RealType>(0.14356629312870627075094188477505571882161519989741L), // Complement of CDF Q = 1 - P
tolerance * 4); // Test tolerance (slightly inceased compared to x < 0.5 above).
test_spot(
static_cast<RealType>(0), // lo or a
static_cast<RealType>(1), // hi or b
static_cast<RealType>(static_cast<RealType>(0.5L)), // Random variate x
static_cast<RealType>(static_cast<RealType>(0.5L)), // Probability of result (CDF of arcsine), P
static_cast<RealType>(static_cast<RealType>(0.5L)), // Complement of CDF Q = 1 - P
tolerance * 4); // Test tolerance.
// Arcsine(-2, -1) xmin = -2, x_max = -1 - Asymmetric both negative.
arcsine_distribution<RealType> as_m2m1(-2, -1);
@@ -265,6 +451,7 @@ void test_spots(RealType)
BOOST_CHECK_THROW(mode(arcsine_distribution<RealType>(static_cast<RealType>(0), static_cast<RealType>(1))), std::domain_error);
// mode is undefined, and must throw domain_error!
BOOST_CHECK_THROW( // For various bad arguments.
pdf(
arcsine_distribution<RealType>(static_cast<RealType>(+1), static_cast<RealType>(-1)), // min_x > max_x
@@ -293,8 +480,8 @@ void test_spots(RealType)
// Checks on things that are errors.
// Construction with 'bad' parameters.
BOOST_CHECK_THROW(arcsine_distribution<RealType>(+1, -1), std::domain_error);
BOOST_CHECK_THROW(arcsine_distribution<RealType>(+1, 0), std::domain_error);
BOOST_CHECK_THROW(arcsine_distribution<RealType>(+1, -1), std::domain_error); // max < min.
BOOST_CHECK_THROW(arcsine_distribution<RealType>(+1, 0), std::domain_error); // max < min.
arcsine_distribution<> dist;
BOOST_CHECK_THROW(pdf(dist, -1), std::domain_error);
@@ -351,13 +538,16 @@ void test_spots(RealType)
// Error handling checks:
check_out_of_range<boost::math::arcsine_distribution<RealType> >(-1, +1); // (All) valid constructor parameter values.
// and range and non-finite.
test_ignore_policy(static_cast<RealType>(0));
} // template <class RealType>void test_spots(RealType)
BOOST_AUTO_TEST_CASE(test_main)
{
BOOST_MATH_CONTROL_FP;
// Check that can generate arcsine distribution using one convenience methods:
// Check that can generate arcsine distribution using convenience method:
using boost::math::arcsine;
arcsine_distribution<> arcsine_01; // Using default RealType double.
@@ -365,6 +555,7 @@ void test_spots(RealType)
arcsine as; // Using typedef for default standard arcsine.
//
BOOST_CHECK_EQUAL(as.x_min(), 0); //
BOOST_CHECK_EQUAL(as.x_max(), 1);
BOOST_CHECK_EQUAL(mean(as), 0.5); // 1 / (1 + 1) = 1/2 exactly.
@@ -376,9 +567,8 @@ void test_spots(RealType)
BOOST_CHECK_EQUAL(support(as).first, 0); //
BOOST_CHECK_EQUAL(range(as).first, 0); //
BOOST_CHECK_THROW(mode(as), std::domain_error); // Two modes at x_min and x_max, so throw instead.
// BOOST_CHECK_THROW(arcsine_distribution<double>(+1, -1), std::domain_error); // min > max
// (Parameter value, arbitrarily zero, only communicates the floating point type).
// (Parameter value, arbitrarily zero, only communicates the floating point type).
test_spots(0.0F); // Test float.
test_spots(0.0); // Test double.
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
@@ -392,8 +582,20 @@ void test_spots(RealType)
/*
Microsoft Visual Studio Professional 2013
Version 12.0.30110.00 Update 1
1> Description: Autorun "J:\Cpp\MathToolkit\test\Math_test\Debug\test_arcsine.exe"
1> Running 1 test case...
1> Platform: Win32
1> Compiler: Microsoft Visual C++ version 12.0 ???? MSVC says 2013
1> STL : Dinkumware standard library version 610
1> Boost : 1.56.0
Sample Output is:
1> Description: Autorun "J:\Cpp\MathToolkit\test\Math_test\Debug\test_arcsine.exe"
1> Running 1 test case...
1> Platform: Win32
1> Compiler: Microsoft Visual C++ version 12.0
@@ -406,7 +608,17 @@ void test_spots(RealType)
1>
1> *** No errors detected
GCC 4.9.1
Running 1 test case...
tolerance = 2.38419e-007
tolerance = 4.44089e-016
tolerance = 4.44089e-016
tolerance = 4.44089e-016
*** No errors detected
RUN SUCCESSFUL (total time: 141ms)
*/