]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <html> |
2 | <head> | |
3 | <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> | |
4 | <title>Incomplete Beta Functions</title> | |
5 | <link rel="stylesheet" href="../../math.css" type="text/css"> | |
6 | <meta name="generator" content="DocBook XSL Stylesheets V1.77.1"> | |
7 | <link rel="home" href="../../index.html" title="Math Toolkit 2.5.1"> | |
8 | <link rel="up" href="../sf_beta.html" title="Beta Functions"> | |
9 | <link rel="prev" href="beta_function.html" title="Beta"> | |
10 | <link rel="next" href="ibeta_inv_function.html" title="The Incomplete Beta Function Inverses"> | |
11 | </head> | |
12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> | |
13 | <table cellpadding="2" width="100%"><tr> | |
14 | <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> | |
15 | <td align="center"><a href="../../../../../../index.html">Home</a></td> | |
16 | <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> | |
17 | <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> | |
18 | <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> | |
19 | <td align="center"><a href="../../../../../../more/index.htm">More</a></td> | |
20 | </tr></table> | |
21 | <hr> | |
22 | <div class="spirit-nav"> | |
23 | <a accesskey="p" href="beta_function.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../sf_beta.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="ibeta_inv_function.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
24 | </div> | |
25 | <div class="section"> | |
26 | <div class="titlepage"><div><div><h3 class="title"> | |
27 | <a name="math_toolkit.sf_beta.ibeta_function"></a><a class="link" href="ibeta_function.html" title="Incomplete Beta Functions">Incomplete Beta | |
28 | Functions</a> | |
29 | </h3></div></div></div> | |
30 | <h5> | |
31 | <a name="math_toolkit.sf_beta.ibeta_function.h0"></a> | |
32 | <span class="phrase"><a name="math_toolkit.sf_beta.ibeta_function.synopsis"></a></span><a class="link" href="ibeta_function.html#math_toolkit.sf_beta.ibeta_function.synopsis">Synopsis</a> | |
33 | </h5> | |
34 | <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">special_functions</span><span class="special">/</span><span class="identifier">beta</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> | |
35 | </pre> | |
36 | <pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">math</span><span class="special">{</span> | |
37 | ||
38 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">></span> | |
39 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ibeta</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">);</span> | |
40 | ||
41 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span> | |
42 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ibeta</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span> | |
43 | ||
44 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">></span> | |
45 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ibetac</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">);</span> | |
46 | ||
47 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span> | |
48 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ibetac</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span> | |
49 | ||
50 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">></span> | |
51 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">beta</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">);</span> | |
52 | ||
53 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span> | |
54 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">beta</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span> | |
55 | ||
56 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">></span> | |
57 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">betac</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">);</span> | |
58 | ||
59 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span> | |
60 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">betac</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span> | |
61 | ||
62 | <span class="special">}}</span> <span class="comment">// namespaces</span> | |
63 | </pre> | |
64 | <h5> | |
65 | <a name="math_toolkit.sf_beta.ibeta_function.h1"></a> | |
66 | <span class="phrase"><a name="math_toolkit.sf_beta.ibeta_function.description"></a></span><a class="link" href="ibeta_function.html#math_toolkit.sf_beta.ibeta_function.description">Description</a> | |
67 | </h5> | |
68 | <p> | |
69 | There are four <a href="http://en.wikipedia.org/wiki/Incomplete_beta_function" target="_top">incomplete | |
70 | beta functions</a> : two are normalised versions (also known as <span class="emphasis"><em>regularized</em></span> | |
71 | beta functions) that return values in the range [0, 1], and two are non-normalised | |
72 | and return values in the range [0, <a class="link" href="beta_function.html" title="Beta">beta</a>(a, | |
73 | b)]. Users interested in statistical applications should use the normalised | |
74 | (or <a href="http://mathworld.wolfram.com/RegularizedBetaFunction.html" target="_top">regularized</a> | |
75 | ) versions (ibeta and ibetac). | |
76 | </p> | |
77 | <p> | |
78 | All of these functions require <span class="emphasis"><em>0 <= x <= 1</em></span>. | |
79 | </p> | |
80 | <p> | |
81 | The normalized functions <a class="link" href="ibeta_function.html" title="Incomplete Beta Functions">ibeta</a> | |
82 | and <a class="link" href="ibeta_function.html" title="Incomplete Beta Functions">ibetac</a> require | |
83 | <span class="emphasis"><em>a,b >= 0</em></span>, and in addition that not both <span class="emphasis"><em>a</em></span> | |
84 | and <span class="emphasis"><em>b</em></span> are zero. | |
85 | </p> | |
86 | <p> | |
87 | The functions <a class="link" href="beta_function.html" title="Beta">beta</a> | |
88 | and <a class="link" href="ibeta_function.html" title="Incomplete Beta Functions">betac</a> require | |
89 | <span class="emphasis"><em>a,b > 0</em></span>. | |
90 | </p> | |
91 | <p> | |
92 | The return type of these functions is computed using the <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result | |
93 | type calculation rules</em></span></a> when T1, T2 and T3 are different | |
94 | types. | |
95 | </p> | |
96 | <p> | |
97 | The final <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can | |
98 | be used to control the behaviour of the function: how it handles errors, | |
99 | what level of precision to use etc. Refer to the <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">policy | |
100 | documentation for more details</a>. | |
101 | </p> | |
102 | <pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">></span> | |
103 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ibeta</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">);</span> | |
104 | ||
105 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span> | |
106 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ibeta</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span> | |
107 | </pre> | |
108 | <p> | |
109 | Returns the normalised incomplete beta function of a, b and x: | |
110 | </p> | |
111 | <p> | |
112 | <span class="inlinemediaobject"><img src="../../../equations/ibeta3.svg"></span> | |
113 | </p> | |
114 | <p> | |
115 | <span class="inlinemediaobject"><img src="../../../graphs/ibeta.svg" align="middle"></span> | |
116 | </p> | |
117 | <pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">></span> | |
118 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ibetac</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">);</span> | |
119 | ||
120 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span> | |
121 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">ibetac</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span> | |
122 | </pre> | |
123 | <p> | |
124 | Returns the normalised complement of the incomplete beta function of a, b | |
125 | and x: | |
126 | </p> | |
127 | <p> | |
128 | <span class="inlinemediaobject"><img src="../../../equations/ibeta4.svg"></span> | |
129 | </p> | |
130 | <pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">></span> | |
131 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">beta</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">);</span> | |
132 | ||
133 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span> | |
134 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">beta</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span> | |
135 | </pre> | |
136 | <p> | |
137 | Returns the full (non-normalised) incomplete beta function of a, b and x: | |
138 | </p> | |
139 | <p> | |
140 | <span class="inlinemediaobject"><img src="../../../equations/ibeta1.svg"></span> | |
141 | </p> | |
142 | <pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">></span> | |
143 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">betac</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">);</span> | |
144 | ||
145 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span> | |
146 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">betac</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">b</span><span class="special">,</span> <span class="identifier">T3</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span> | |
147 | </pre> | |
148 | <p> | |
149 | Returns the full (non-normalised) complement of the incomplete beta function | |
150 | of a, b and x: | |
151 | </p> | |
152 | <p> | |
153 | <span class="inlinemediaobject"><img src="../../../equations/ibeta2.svg"></span> | |
154 | </p> | |
155 | <h5> | |
156 | <a name="math_toolkit.sf_beta.ibeta_function.h2"></a> | |
157 | <span class="phrase"><a name="math_toolkit.sf_beta.ibeta_function.accuracy"></a></span><a class="link" href="ibeta_function.html#math_toolkit.sf_beta.ibeta_function.accuracy">Accuracy</a> | |
158 | </h5> | |
159 | <p> | |
160 | The following tables give peak and mean relative errors in over various domains | |
161 | of a, b and x, along with comparisons to the <a href="http://www.gnu.org/software/gsl/" target="_top">GSL-1.9</a> | |
162 | and <a href="http://www.netlib.org/cephes/" target="_top">Cephes</a> libraries. | |
163 | Note that only results for the widest floating-point type on the system are | |
164 | given as narrower types have <a class="link" href="../relative_error.html#math_toolkit.relative_error.zero_error">effectively | |
165 | zero error</a>. | |
166 | </p> | |
167 | <p> | |
168 | Note that the results for 80 and 128-bit long doubles are noticeably higher | |
169 | than for doubles: this is because the wider exponent range of these types | |
170 | allow more extreme test cases to be tested. For example expected results | |
171 | that are zero at double precision, may be finite but exceptionally small | |
172 | with the wider exponent range of the long double types. | |
173 | </p> | |
174 | <div class="table"> | |
175 | <a name="math_toolkit.sf_beta.ibeta_function.table_ibeta"></a><p class="title"><b>Table 6.18. Error rates for ibeta</b></p> | |
176 | <div class="table-contents"><table class="table" summary="Error rates for ibeta"> | |
177 | <colgroup> | |
178 | <col> | |
179 | <col> | |
180 | <col> | |
181 | <col> | |
182 | <col> | |
183 | </colgroup> | |
184 | <thead><tr> | |
185 | <th> | |
186 | </th> | |
187 | <th> | |
188 | <p> | |
189 | Microsoft Visual C++ version 12.0<br> Win32<br> double | |
190 | </p> | |
191 | </th> | |
192 | <th> | |
193 | <p> | |
194 | GNU C++ version 5.1.0<br> linux<br> double | |
195 | </p> | |
196 | </th> | |
197 | <th> | |
198 | <p> | |
199 | GNU C++ version 5.1.0<br> linux<br> long double | |
200 | </p> | |
201 | </th> | |
202 | <th> | |
203 | <p> | |
204 | Sun compiler version 0x5130<br> Sun Solaris<br> long double | |
205 | </p> | |
206 | </th> | |
207 | </tr></thead> | |
208 | <tbody> | |
209 | <tr> | |
210 | <td> | |
211 | <p> | |
212 | Incomplete Beta Function: Small Values | |
213 | </p> | |
214 | </td> | |
215 | <td> | |
216 | <p> | |
217 | <span class="blue">Max = 9.42ε (Mean = 2.24ε)</span> | |
218 | </p> | |
219 | </td> | |
220 | <td> | |
221 | <p> | |
222 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
223 | 1.16:</em></span> Max = 682ε (Mean = 32.6ε))<br> (<span class="emphasis"><em>Rmath | |
224 | 3.0.2:</em></span> Max = 22.9ε (Mean = 3.35ε))<br> (<span class="emphasis"><em>Cephes:</em></span> | |
225 | Max = 22.7ε (Mean = 1.69ε)) | |
226 | </p> | |
227 | </td> | |
228 | <td> | |
229 | <p> | |
230 | <span class="blue">Max = 6.27ε (Mean = 1.7ε)</span> | |
231 | </p> | |
232 | </td> | |
233 | <td> | |
234 | <p> | |
235 | <span class="blue">Max = 21.3ε (Mean = 2.74ε)</span> | |
236 | </p> | |
237 | </td> | |
238 | </tr> | |
239 | <tr> | |
240 | <td> | |
241 | <p> | |
242 | Incomplete Beta Function: Medium Values | |
243 | </p> | |
244 | </td> | |
245 | <td> | |
246 | <p> | |
247 | <span class="blue">Max = 108ε (Mean = 16.3ε)</span> | |
248 | </p> | |
249 | </td> | |
250 | <td> | |
251 | <p> | |
252 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
253 | 1.16:</em></span> Max = 690ε (Mean = 151ε))<br> (<span class="emphasis"><em>Rmath | |
254 | 3.0.2:</em></span> Max = 232ε (Mean = 27.9ε))<br> (<span class="emphasis"><em>Cephes:</em></span> | |
255 | Max = 1.55e+03ε (Mean = 121ε)) | |
256 | </p> | |
257 | </td> | |
258 | <td> | |
259 | <p> | |
260 | <span class="blue">Max = 51.4ε (Mean = 12ε)</span> | |
261 | </p> | |
262 | </td> | |
263 | <td> | |
264 | <p> | |
265 | <span class="blue">Max = 124ε (Mean = 18.4ε)</span> | |
266 | </p> | |
267 | </td> | |
268 | </tr> | |
269 | <tr> | |
270 | <td> | |
271 | <p> | |
272 | Incomplete Beta Function: Large and Diverse Values | |
273 | </p> | |
274 | </td> | |
275 | <td> | |
276 | <p> | |
277 | <span class="blue">Max = 1.19e+003ε (Mean = 59.5ε)</span> | |
278 | </p> | |
279 | </td> | |
280 | <td> | |
281 | <p> | |
282 | <span class="blue">Max = 1.26ε (Mean = 0.063ε)</span><br> <br> | |
283 | (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 3.9e+05ε (Mean = 1.82e+04ε) | |
284 | <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_ibeta_GSL_1_16_Incomplete_Beta_Function_Large_and_Diverse_Values">And | |
285 | other failures.</a>)<br> (<span class="emphasis"><em>Rmath 3.0.2:</em></span> | |
286 | Max = 574ε (Mean = 49.4ε))<br> (<span class="emphasis"><em>Cephes:</em></span> Max | |
287 | = 5.92e+05ε (Mean = 2.17e+04ε)) | |
288 | </p> | |
289 | </td> | |
290 | <td> | |
291 | <p> | |
292 | <span class="blue">Max = 1.96e+04ε (Mean = 997ε)</span> | |
293 | </p> | |
294 | </td> | |
295 | <td> | |
296 | <p> | |
297 | <span class="blue">Max = 4.98e+04ε (Mean = 2.07e+03ε)</span> | |
298 | </p> | |
299 | </td> | |
300 | </tr> | |
301 | <tr> | |
302 | <td> | |
303 | <p> | |
304 | Incomplete Beta Function: Small Integer Values | |
305 | </p> | |
306 | </td> | |
307 | <td> | |
308 | <p> | |
309 | <span class="blue">Max = 3.69ε (Mean = 0.765ε)</span> | |
310 | </p> | |
311 | </td> | |
312 | <td> | |
313 | <p> | |
314 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
315 | 1.16:</em></span> Max = 254ε (Mean = 50.9ε))<br> (<span class="emphasis"><em>Rmath | |
316 | 3.0.2:</em></span> Max = 62.2ε (Mean = 8.95ε))<br> (<span class="emphasis"><em>Cephes:</em></span> | |
317 | Max = 7.96ε (Mean = 1.3ε)) | |
318 | </p> | |
319 | </td> | |
320 | <td> | |
321 | <p> | |
322 | <span class="blue">Max = 4.45ε (Mean = 0.814ε)</span> | |
323 | </p> | |
324 | </td> | |
325 | <td> | |
326 | <p> | |
327 | <span class="blue">Max = 44.5ε (Mean = 10.1ε)</span> | |
328 | </p> | |
329 | </td> | |
330 | </tr> | |
331 | </tbody> | |
332 | </table></div> | |
333 | </div> | |
334 | <br class="table-break"><div class="table"> | |
335 | <a name="math_toolkit.sf_beta.ibeta_function.table_ibetac"></a><p class="title"><b>Table 6.19. Error rates for ibetac</b></p> | |
336 | <div class="table-contents"><table class="table" summary="Error rates for ibetac"> | |
337 | <colgroup> | |
338 | <col> | |
339 | <col> | |
340 | <col> | |
341 | <col> | |
342 | <col> | |
343 | </colgroup> | |
344 | <thead><tr> | |
345 | <th> | |
346 | </th> | |
347 | <th> | |
348 | <p> | |
349 | Microsoft Visual C++ version 12.0<br> Win32<br> double | |
350 | </p> | |
351 | </th> | |
352 | <th> | |
353 | <p> | |
354 | GNU C++ version 5.1.0<br> linux<br> double | |
355 | </p> | |
356 | </th> | |
357 | <th> | |
358 | <p> | |
359 | GNU C++ version 5.1.0<br> linux<br> long double | |
360 | </p> | |
361 | </th> | |
362 | <th> | |
363 | <p> | |
364 | Sun compiler version 0x5130<br> Sun Solaris<br> long double | |
365 | </p> | |
366 | </th> | |
367 | </tr></thead> | |
368 | <tbody> | |
369 | <tr> | |
370 | <td> | |
371 | <p> | |
372 | Incomplete Beta Function: Small Values | |
373 | </p> | |
374 | </td> | |
375 | <td> | |
376 | <p> | |
377 | <span class="blue">Max = 6.56ε (Mean = 1.88ε)</span> | |
378 | </p> | |
379 | </td> | |
380 | <td> | |
381 | <p> | |
382 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>Rmath | |
383 | 3.0.2:</em></span> Max = 22.4ε (Mean = 3.67ε)) | |
384 | </p> | |
385 | </td> | |
386 | <td> | |
387 | <p> | |
388 | <span class="blue">Max = 8.47ε (Mean = 1.68ε)</span> | |
389 | </p> | |
390 | </td> | |
391 | <td> | |
392 | <p> | |
393 | <span class="blue">Max = 13.8ε (Mean = 2.69ε)</span> | |
394 | </p> | |
395 | </td> | |
396 | </tr> | |
397 | <tr> | |
398 | <td> | |
399 | <p> | |
400 | Incomplete Beta Function: Medium Values | |
401 | </p> | |
402 | </td> | |
403 | <td> | |
404 | <p> | |
405 | <span class="blue">Max = 56.2ε (Mean = 14.1ε)</span> | |
406 | </p> | |
407 | </td> | |
408 | <td> | |
409 | <p> | |
410 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>Rmath | |
411 | 3.0.2:</em></span> Max = 204ε (Mean = 25.8ε)) | |
412 | </p> | |
413 | </td> | |
414 | <td> | |
415 | <p> | |
416 | <span class="blue">Max = 75.3ε (Mean = 11.3ε)</span> | |
417 | </p> | |
418 | </td> | |
419 | <td> | |
420 | <p> | |
421 | <span class="blue">Max = 132ε (Mean = 19.8ε)</span> | |
422 | </p> | |
423 | </td> | |
424 | </tr> | |
425 | <tr> | |
426 | <td> | |
427 | <p> | |
428 | Incomplete Beta Function: Large and Diverse Values | |
429 | </p> | |
430 | </td> | |
431 | <td> | |
432 | <p> | |
433 | <span class="blue">Max = 1.87e+003ε (Mean = 93.8ε)</span> | |
434 | </p> | |
435 | </td> | |
436 | <td> | |
437 | <p> | |
438 | <span class="blue">Max = 0.981ε (Mean = 0.0638ε)</span><br> | |
439 | <br> (<span class="emphasis"><em>Rmath 3.0.2:</em></span> Max = 889ε (Mean = 68.4ε)) | |
440 | </p> | |
441 | </td> | |
442 | <td> | |
443 | <p> | |
444 | <span class="blue">Max = 3.45e+04ε (Mean = 1.32e+03ε)</span> | |
445 | </p> | |
446 | </td> | |
447 | <td> | |
448 | <p> | |
449 | <span class="blue">Max = 4.26e+04ε (Mean = 1.54e+03ε)</span> | |
450 | </p> | |
451 | </td> | |
452 | </tr> | |
453 | <tr> | |
454 | <td> | |
455 | <p> | |
456 | Incomplete Beta Function: Small Integer Values | |
457 | </p> | |
458 | </td> | |
459 | <td> | |
460 | <p> | |
461 | <span class="blue">Max = 6.37ε (Mean = 1.03ε)</span> | |
462 | </p> | |
463 | </td> | |
464 | <td> | |
465 | <p> | |
466 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>Rmath | |
467 | 3.0.2:</em></span> Max = 84.6ε (Mean = 18ε)) | |
468 | </p> | |
469 | </td> | |
470 | <td> | |
471 | <p> | |
472 | <span class="blue">Max = 5.34ε (Mean = 1.11ε)</span> | |
473 | </p> | |
474 | </td> | |
475 | <td> | |
476 | <p> | |
477 | <span class="blue">Max = 107ε (Mean = 17.1ε)</span> | |
478 | </p> | |
479 | </td> | |
480 | </tr> | |
481 | </tbody> | |
482 | </table></div> | |
483 | </div> | |
484 | <br class="table-break"><div class="table"> | |
485 | <a name="math_toolkit.sf_beta.ibeta_function.table_beta_incomplete_"></a><p class="title"><b>Table 6.20. Error rates for beta (incomplete)</b></p> | |
486 | <div class="table-contents"><table class="table" summary="Error rates for beta (incomplete)"> | |
487 | <colgroup> | |
488 | <col> | |
489 | <col> | |
490 | <col> | |
491 | <col> | |
492 | <col> | |
493 | </colgroup> | |
494 | <thead><tr> | |
495 | <th> | |
496 | </th> | |
497 | <th> | |
498 | <p> | |
499 | Microsoft Visual C++ version 12.0<br> Win32<br> double | |
500 | </p> | |
501 | </th> | |
502 | <th> | |
503 | <p> | |
504 | GNU C++ version 5.1.0<br> linux<br> double | |
505 | </p> | |
506 | </th> | |
507 | <th> | |
508 | <p> | |
509 | GNU C++ version 5.1.0<br> linux<br> long double | |
510 | </p> | |
511 | </th> | |
512 | <th> | |
513 | <p> | |
514 | Sun compiler version 0x5130<br> Sun Solaris<br> long double | |
515 | </p> | |
516 | </th> | |
517 | </tr></thead> | |
518 | <tbody> | |
519 | <tr> | |
520 | <td> | |
521 | <p> | |
522 | Incomplete Beta Function: Small Values | |
523 | </p> | |
524 | </td> | |
525 | <td> | |
526 | <p> | |
527 | <span class="blue">Max = 11.1ε (Mean = 2.28ε)</span> | |
528 | </p> | |
529 | </td> | |
530 | <td> | |
531 | <p> | |
532 | <span class="blue">Max = 0ε (Mean = 0ε)</span> | |
533 | </p> | |
534 | </td> | |
535 | <td> | |
536 | <p> | |
537 | <span class="blue">Max = 12.5ε (Mean = 2.01ε)</span> | |
538 | </p> | |
539 | </td> | |
540 | <td> | |
541 | <p> | |
542 | <span class="blue">Max = 18.7ε (Mean = 3.19ε)</span> | |
543 | </p> | |
544 | </td> | |
545 | </tr> | |
546 | <tr> | |
547 | <td> | |
548 | <p> | |
549 | Incomplete Beta Function: Medium Values | |
550 | </p> | |
551 | </td> | |
552 | <td> | |
553 | <p> | |
554 | <span class="blue">Max = 91.1ε (Mean = 12.7ε)</span> | |
555 | </p> | |
556 | </td> | |
557 | <td> | |
558 | <p> | |
559 | <span class="blue">Max = 0.568ε (Mean = 0.0342ε)</span> | |
560 | </p> | |
561 | </td> | |
562 | <td> | |
563 | <p> | |
564 | <span class="blue">Max = 67.1ε (Mean = 13.3ε)</span> | |
565 | </p> | |
566 | </td> | |
567 | <td> | |
568 | <p> | |
569 | <span class="blue">Max = 174ε (Mean = 25ε)</span> | |
570 | </p> | |
571 | </td> | |
572 | </tr> | |
573 | <tr> | |
574 | <td> | |
575 | <p> | |
576 | Incomplete Beta Function: Large and Diverse Values | |
577 | </p> | |
578 | </td> | |
579 | <td> | |
580 | <p> | |
581 | <span class="blue">Max = 635ε (Mean = 29.5ε)</span> | |
582 | </p> | |
583 | </td> | |
584 | <td> | |
585 | <p> | |
586 | <span class="blue">Max = 0.999ε (Mean = 0.0399ε)</span> | |
587 | </p> | |
588 | </td> | |
589 | <td> | |
590 | <p> | |
591 | <span class="blue">Max = 6.84e+04ε (Mean = 2.76e+03ε)</span> | |
592 | </p> | |
593 | </td> | |
594 | <td> | |
595 | <p> | |
596 | <span class="blue">Max = 6.86e+04ε (Mean = 2.79e+03ε)</span> | |
597 | </p> | |
598 | </td> | |
599 | </tr> | |
600 | <tr> | |
601 | <td> | |
602 | <p> | |
603 | Incomplete Beta Function: Small Integer Values | |
604 | </p> | |
605 | </td> | |
606 | <td> | |
607 | <p> | |
608 | <span class="blue">Max = 26.8ε (Mean = 6.61ε)</span> | |
609 | </p> | |
610 | </td> | |
611 | <td> | |
612 | <p> | |
613 | <span class="blue">Max = 0.786ε (Mean = 0.0248ε)</span> | |
614 | </p> | |
615 | </td> | |
616 | <td> | |
617 | <p> | |
618 | <span class="blue">Max = 10.2ε (Mean = 3.49ε)</span> | |
619 | </p> | |
620 | </td> | |
621 | <td> | |
622 | <p> | |
623 | <span class="blue">Max = 51.8ε (Mean = 11ε)</span> | |
624 | </p> | |
625 | </td> | |
626 | </tr> | |
627 | </tbody> | |
628 | </table></div> | |
629 | </div> | |
630 | <br class="table-break"><div class="table"> | |
631 | <a name="math_toolkit.sf_beta.ibeta_function.table_betac"></a><p class="title"><b>Table 6.21. Error rates for betac</b></p> | |
632 | <div class="table-contents"><table class="table" summary="Error rates for betac"> | |
633 | <colgroup> | |
634 | <col> | |
635 | <col> | |
636 | <col> | |
637 | <col> | |
638 | <col> | |
639 | </colgroup> | |
640 | <thead><tr> | |
641 | <th> | |
642 | </th> | |
643 | <th> | |
644 | <p> | |
645 | Microsoft Visual C++ version 12.0<br> Win32<br> double | |
646 | </p> | |
647 | </th> | |
648 | <th> | |
649 | <p> | |
650 | GNU C++ version 5.1.0<br> linux<br> double | |
651 | </p> | |
652 | </th> | |
653 | <th> | |
654 | <p> | |
655 | GNU C++ version 5.1.0<br> linux<br> long double | |
656 | </p> | |
657 | </th> | |
658 | <th> | |
659 | <p> | |
660 | Sun compiler version 0x5130<br> Sun Solaris<br> long double | |
661 | </p> | |
662 | </th> | |
663 | </tr></thead> | |
664 | <tbody> | |
665 | <tr> | |
666 | <td> | |
667 | <p> | |
668 | Incomplete Beta Function: Small Values | |
669 | </p> | |
670 | </td> | |
671 | <td> | |
672 | <p> | |
673 | <span class="blue">Max = 12ε (Mean = 2.43ε)</span> | |
674 | </p> | |
675 | </td> | |
676 | <td> | |
677 | <p> | |
678 | <span class="blue">Max = 0.676ε (Mean = 0.0302ε)</span> | |
679 | </p> | |
680 | </td> | |
681 | <td> | |
682 | <p> | |
683 | <span class="blue">Max = 7.75ε (Mean = 1.91ε)</span> | |
684 | </p> | |
685 | </td> | |
686 | <td> | |
687 | <p> | |
688 | <span class="blue">Max = 12.6ε (Mean = 3.02ε)</span> | |
689 | </p> | |
690 | </td> | |
691 | </tr> | |
692 | <tr> | |
693 | <td> | |
694 | <p> | |
695 | Incomplete Beta Function: Medium Values | |
696 | </p> | |
697 | </td> | |
698 | <td> | |
699 | <p> | |
700 | <span class="blue">Max = 91.3ε (Mean = 14.8ε)</span> | |
701 | </p> | |
702 | </td> | |
703 | <td> | |
704 | <p> | |
705 | <span class="blue">Max = 0.949ε (Mean = 0.0944ε)</span> | |
706 | </p> | |
707 | </td> | |
708 | <td> | |
709 | <p> | |
710 | <span class="blue">Max = 63.5ε (Mean = 13.4ε)</span> | |
711 | </p> | |
712 | </td> | |
713 | <td> | |
714 | <p> | |
715 | <span class="blue">Max = 97.6ε (Mean = 24.3ε)</span> | |
716 | </p> | |
717 | </td> | |
718 | </tr> | |
719 | <tr> | |
720 | <td> | |
721 | <p> | |
722 | Incomplete Beta Function: Large and Diverse Values | |
723 | </p> | |
724 | </td> | |
725 | <td> | |
726 | <p> | |
727 | <span class="blue">Max = 3.72e+003ε (Mean = 113ε)</span> | |
728 | </p> | |
729 | </td> | |
730 | <td> | |
731 | <p> | |
732 | <span class="blue">Max = 1.12ε (Mean = 0.0458ε)</span> | |
733 | </p> | |
734 | </td> | |
735 | <td> | |
736 | <p> | |
737 | <span class="blue">Max = 1.05e+05ε (Mean = 5.45e+03ε)</span> | |
738 | </p> | |
739 | </td> | |
740 | <td> | |
741 | <p> | |
742 | <span class="blue">Max = 1.04e+05ε (Mean = 5.46e+03ε)</span> | |
743 | </p> | |
744 | </td> | |
745 | </tr> | |
746 | <tr> | |
747 | <td> | |
748 | <p> | |
749 | Incomplete Beta Function: Small Integer Values | |
750 | </p> | |
751 | </td> | |
752 | <td> | |
753 | <p> | |
754 | <span class="blue">Max = 26.7ε (Mean = 6.67ε)</span> | |
755 | </p> | |
756 | </td> | |
757 | <td> | |
758 | <p> | |
759 | <span class="blue">Max = 0.586ε (Mean = 0.0314ε)</span> | |
760 | </p> | |
761 | </td> | |
762 | <td> | |
763 | <p> | |
764 | <span class="blue">Max = 10.4ε (Mean = 3.54ε)</span> | |
765 | </p> | |
766 | </td> | |
767 | <td> | |
768 | <p> | |
769 | <span class="blue">Max = 103ε (Mean = 17.4ε)</span> | |
770 | </p> | |
771 | </td> | |
772 | </tr> | |
773 | </tbody> | |
774 | </table></div> | |
775 | </div> | |
776 | <br class="table-break"><h5> | |
777 | <a name="math_toolkit.sf_beta.ibeta_function.h3"></a> | |
778 | <span class="phrase"><a name="math_toolkit.sf_beta.ibeta_function.testing"></a></span><a class="link" href="ibeta_function.html#math_toolkit.sf_beta.ibeta_function.testing">Testing</a> | |
779 | </h5> | |
780 | <p> | |
781 | There are two sets of tests: spot tests compare values taken from <a href="http://functions.wolfram.com/webMathematica/FunctionEvaluation.jsp?name=BetaRegularized" target="_top">Mathworld's | |
782 | online function evaluator</a> with this implementation: they provide | |
783 | a basic "sanity check" for the implementation, with one spot-test | |
784 | in each implementation-domain (see implementation notes below). | |
785 | </p> | |
786 | <p> | |
787 | Accuracy tests use data generated at very high precision (with <a href="http://shoup.net/ntl/doc/RR.txt" target="_top">NTL | |
788 | RR class</a> set at 1000-bit precision), using the "textbook" | |
789 | continued fraction representation (refer to the first continued fraction | |
790 | in the implementation discussion below). Note that this continued fraction | |
791 | is <span class="emphasis"><em>not</em></span> used in the implementation, and therefore we | |
792 | have test data that is fully independent of the code. | |
793 | </p> | |
794 | <h5> | |
795 | <a name="math_toolkit.sf_beta.ibeta_function.h4"></a> | |
796 | <span class="phrase"><a name="math_toolkit.sf_beta.ibeta_function.implementation"></a></span><a class="link" href="ibeta_function.html#math_toolkit.sf_beta.ibeta_function.implementation">Implementation</a> | |
797 | </h5> | |
798 | <p> | |
799 | This implementation is closely based upon <a href="http://portal.acm.org/citation.cfm?doid=131766.131776" target="_top">"Algorithm | |
800 | 708; Significant digit computation of the incomplete beta function ratios", | |
801 | DiDonato and Morris, ACM, 1992.</a> | |
802 | </p> | |
803 | <p> | |
804 | All four of these functions share a common implementation: this is passed | |
805 | both x and y, and can return either p or q where these are related by: | |
806 | </p> | |
807 | <p> | |
808 | <span class="inlinemediaobject"><img src="../../../equations/ibeta_inv5.svg"></span> | |
809 | </p> | |
810 | <p> | |
811 | so at any point we can swap a for b, x for y and p for q if this results | |
812 | in a more favourable position. Generally such swaps are performed so that | |
813 | we always compute a value less than 0.9: when required this can then be subtracted | |
814 | from 1 without undue cancellation error. | |
815 | </p> | |
816 | <p> | |
817 | The following continued fraction representation is found in many textbooks | |
818 | but is not used in this implementation - it's both slower and less accurate | |
819 | than the alternatives - however it is used to generate test data: | |
820 | </p> | |
821 | <p> | |
822 | <span class="inlinemediaobject"><img src="../../../equations/ibeta5.svg"></span> | |
823 | </p> | |
824 | <p> | |
825 | The following continued fraction is due to <a href="http://portal.acm.org/citation.cfm?doid=131766.131776" target="_top">Didonato | |
826 | and Morris</a>, and is used in this implementation when a and b are both | |
827 | greater than 1: | |
828 | </p> | |
829 | <p> | |
830 | <span class="inlinemediaobject"><img src="../../../equations/ibeta6.svg"></span> | |
831 | </p> | |
832 | <p> | |
833 | For smallish b and x then a series representation can be used: | |
834 | </p> | |
835 | <p> | |
836 | <span class="inlinemediaobject"><img src="../../../equations/ibeta7.svg"></span> | |
837 | </p> | |
838 | <p> | |
839 | When b << a then the transition from 0 to 1 occurs very close to x | |
840 | = 1 and some care has to be taken over the method of computation, in that | |
841 | case the following series representation is used: | |
842 | </p> | |
843 | <p> | |
844 | <span class="inlinemediaobject"><img src="../../../equations/ibeta8.svg"></span> | |
845 | ||
846 | </p> | |
847 | <p> | |
848 | Where Q(a,x) is an <a href="http://functions.wolfram.com/GammaBetaErf/Gamma2/" target="_top">incomplete | |
849 | gamma function</a>. Note that this method relies on keeping a table of | |
850 | all the p<sub>n </sub> previously computed, which does limit the precision of the method, | |
851 | depending upon the size of the table used. | |
852 | </p> | |
853 | <p> | |
854 | When <span class="emphasis"><em>a</em></span> and <span class="emphasis"><em>b</em></span> are both small integers, | |
855 | then we can relate the incomplete beta to the binomial distribution and use | |
856 | the following finite sum: | |
857 | </p> | |
858 | <p> | |
859 | <span class="inlinemediaobject"><img src="../../../equations/ibeta12.svg"></span> | |
860 | </p> | |
861 | <p> | |
862 | Finally we can sidestep difficult areas, or move to an area with a more efficient | |
863 | means of computation, by using the duplication formulae: | |
864 | </p> | |
865 | <p> | |
866 | <span class="inlinemediaobject"><img src="../../../equations/ibeta10.svg"></span> | |
867 | </p> | |
868 | <p> | |
869 | <span class="inlinemediaobject"><img src="../../../equations/ibeta11.svg"></span> | |
870 | </p> | |
871 | <p> | |
872 | The domains of a, b and x for which the various methods are used are identical | |
873 | to those described in the <a href="http://portal.acm.org/citation.cfm?doid=131766.131776" target="_top">Didonato | |
874 | and Morris TOMS 708 paper</a>. | |
875 | </p> | |
876 | </div> | |
877 | <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> | |
878 | <td align="left"></td> | |
879 | <td align="right"><div class="copyright-footer">Copyright © 2006-2010, 2012-2014 Nikhar Agrawal, | |
880 | Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert | |
881 | Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan Råde, Gautam Sewani, | |
882 | Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang<p> | |
883 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
884 | file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) | |
885 | </p> | |
886 | </div></td> | |
887 | </tr></table> | |
888 | <hr> | |
889 | <div class="spirit-nav"> | |
890 | <a accesskey="p" href="beta_function.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../sf_beta.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="ibeta_inv_function.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
891 | </div> | |
892 | </body> | |
893 | </html> |