blob: a23dd9c03764301f2b34267e0f76f4ee28d52737 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Fri Apr 14 22:10:58 PDT 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Probability (Mahout Math 0.13.0 API)</title>
<meta name="date" content="2017-04-14">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Probability (Mahout Math 0.13.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Probability.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/mahout/math/jet/stat/Gamma.html" title="class in org.apache.mahout.math.jet.stat"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/mahout/math/jet/stat/Probability.html" target="_top">Frames</a></li>
<li><a href="Probability.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.mahout.math.jet.stat</div>
<h2 title="Class Probability" class="title">Class Probability</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.mahout.math.jet.stat.Probability</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public final class <span class="typeNameLabel">Probability</span>
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Partially deprecated until unit tests are in place. Until this time, this class/interface is unsupported.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/mahout/math/jet/stat/Probability.html#beta-double-double-double-">beta</a></span>(double&nbsp;a,
double&nbsp;b,
double&nbsp;x)</code>
<div class="block">Returns the area from zero to <tt>x</tt> under the beta density function.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/mahout/math/jet/stat/Probability.html#gamma-double-double-double-">gamma</a></span>(double&nbsp;alpha,
double&nbsp;beta,
double&nbsp;x)</code>
<div class="block">Returns the integral from zero to <tt>x</tt> of the gamma probability density function.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/mahout/math/jet/stat/Probability.html#negativeBinomial-int-int-double-">negativeBinomial</a></span>(int&nbsp;k,
int&nbsp;n,
double&nbsp;p)</code>
<div class="block">Returns the sum of the terms <tt>0</tt> through <tt>k</tt> of the Negative Binomial Distribution.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/mahout/math/jet/stat/Probability.html#normal-double-">normal</a></span>(double&nbsp;a)</code>
<div class="block">Returns the area under the Normal (Gaussian) probability density function, integrated from minus infinity to
<tt>x</tt> (assumes mean is zero, variance is one).</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/mahout/math/jet/stat/Probability.html#normal-double-double-double-">normal</a></span>(double&nbsp;mean,
double&nbsp;variance,
double&nbsp;x)</code>
<div class="block">Returns the area under the Normal (Gaussian) probability density function, integrated from minus infinity to
<tt>x</tt>.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/mahout/math/jet/stat/Probability.html#poisson-int-double-">poisson</a></span>(int&nbsp;k,
double&nbsp;mean)</code>
<div class="block">Returns the sum of the first <tt>k</tt> terms of the Poisson distribution.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="beta-double-double-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>beta</h4>
<pre>public static&nbsp;double&nbsp;beta(double&nbsp;a,
double&nbsp;b,
double&nbsp;x)</pre>
<div class="block">Returns the area from zero to <tt>x</tt> under the beta density function.
<pre>
x
- -
| (a+b) | | a-1 b-1
P(x) = ---------- | t (1-t) dt
- - | |
| (a) | (b) -
0
</pre>
This function is identical to the incomplete beta integral function <tt>Gamma.incompleteBeta(a, b, x)</tt>.
The complemented function is
<tt>1 - P(1-x) = Gamma.incompleteBeta( b, a, x )</tt>;</div>
</li>
</ul>
<a name="gamma-double-double-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>gamma</h4>
<pre>public static&nbsp;double&nbsp;gamma(double&nbsp;alpha,
double&nbsp;beta,
double&nbsp;x)</pre>
<div class="block">Returns the integral from zero to <tt>x</tt> of the gamma probability density function.
<pre>
alpha - x
beta | alpha-1 -beta t
y = --------- | t e dt
- |
| (alpha) - 0
</pre>
The incomplete gamma integral is used, according to the relation
<tt>y = Gamma.incompleteGamma( alpha, beta*x )</tt>.
See http://en.wikipedia.org/wiki/Gamma_distribution#Probability_density_function</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>alpha</code> - the shape parameter of the gamma distribution.</dd>
<dd><code>beta</code> - the rate parameter of the gamma distribution.</dd>
<dd><code>x</code> - integration end point.</dd>
</dl>
</li>
</ul>
<a name="negativeBinomial-int-int-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>negativeBinomial</h4>
<pre>public static&nbsp;double&nbsp;negativeBinomial(int&nbsp;k,
int&nbsp;n,
double&nbsp;p)</pre>
<div class="block">Returns the sum of the terms <tt>0</tt> through <tt>k</tt> of the Negative Binomial Distribution.
<code>k
-- ( n+j-1 ) n j
&gt; ( ) p (1-p)
-- ( j )
j=0
</code>
In a sequence of Bernoulli trials, this is the probability that <tt>k</tt> or fewer failures precede the
<tt>n</tt>-th success. <p> The terms are not computed individually; instead the incomplete beta integral is
employed, according to the formula <p> <tt>y = negativeBinomial( k, n, p ) = Gamma.incompleteBeta( n, k+1, p
)</tt>.
All arguments must be positive,</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>k</code> - end term.</dd>
<dd><code>n</code> - the number of trials.</dd>
<dd><code>p</code> - the probability of success (must be in <tt>(0.0,1.0)</tt>).</dd>
</dl>
</li>
</ul>
<a name="normal-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>normal</h4>
<pre>public static&nbsp;double&nbsp;normal(double&nbsp;a)</pre>
<div class="block">Returns the area under the Normal (Gaussian) probability density function, integrated from minus infinity to
<tt>x</tt> (assumes mean is zero, variance is one).
<code>x
-
1 | | 2
normal(x) = --------- | exp( - t /2 ) dt
sqrt(2pi) | |
-
-inf.
= ( 1 + erf(z) ) / 2
= erfc(z) / 2
</code>
where <tt>z = x/sqrt(2)</tt>. Computation is via the functions <tt>errorFunction</tt> and
<tt>errorFunctionComplement</tt>.
<p>
Computed using method 26.2.17 from Abramovitz and Stegun (see http://www.math.sfu.ca/~cbm/aands/page_932.htm
and http://en.wikipedia.org/wiki/Normal_distribution#Numerical_approximations_of_the_normal_cdf</div>
</li>
</ul>
<a name="normal-double-double-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>normal</h4>
<pre>public static&nbsp;double&nbsp;normal(double&nbsp;mean,
double&nbsp;variance,
double&nbsp;x)</pre>
<div class="block">Returns the area under the Normal (Gaussian) probability density function, integrated from minus infinity to
<tt>x</tt>.
<code>x
-
1 | | 2
normal(x) = --------- | exp( - (t-mean) / 2v ) dt
sqrt(2pi*v)| |
-
-inf.
</code>
where <tt>v = variance</tt>. Computation is via the functions <tt>errorFunction</tt>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>mean</code> - the mean of the normal distribution.</dd>
<dd><code>variance</code> - the variance of the normal distribution.</dd>
<dd><code>x</code> - the integration limit.</dd>
</dl>
</li>
</ul>
<a name="poisson-int-double-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>poisson</h4>
<pre>public static&nbsp;double&nbsp;poisson(int&nbsp;k,
double&nbsp;mean)</pre>
<div class="block">Returns the sum of the first <tt>k</tt> terms of the Poisson distribution.
<pre>
k j
-- -m m
> e --
-- j!
j=0
</pre>
The terms are not summed directly; instead the incomplete gamma integral is employed, according to the relation <p>
<tt>y = poisson( k, m ) = Gamma.incompleteGammaComplement( k+1, m )</tt>.
The arguments must both be positive.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>k</code> - number of terms.</dd>
<dd><code>mean</code> - the mean of the poisson distribution.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Probability.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/mahout/math/jet/stat/Gamma.html" title="class in org.apache.mahout.math.jet.stat"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/mahout/math/jet/stat/Probability.html" target="_top">Frames</a></li>
<li><a href="Probability.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2008&#x2013;2017 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>