Portfolio Code | Clement Colmerauer
Repositories
Site
Rabbit simulation
Code
Commits
Branches
Tags
Search
Tree:
a20104a
Branches
Tags
master
Rabbit simulation
build
colt
doc
api
cern
jet
stat
Probability.html
initial commit
Clement COLMERAUER
commited
a20104a
at 2024-09-09 10:17:52
Probability.html
Blame
History
Raw
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.4.2_05) on Thu Sep 09 20:36:13 PDT 2004 --> <TITLE> Probability (Colt 1.2.0 - API Specification) </TITLE> <META NAME="keywords" CONTENT="cern.jet.stat.Probability class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="Probability (Colt 1.2.0 - API Specification)"; } </SCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Probability.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Colt 1.2.0</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../cern/jet/stat/Gamma.html" title="class in cern.jet.stat"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="Probability.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> cern.jet.stat</FONT> <BR> Class Probability</H2> <PRE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../cern/jet/math/Constants.html" title="class in cern.jet.math">cern.jet.math.Constants</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>cern.jet.stat.Probability</B> </PRE> <HR> <DL> <DT>public class <B>Probability</B><DT>extends <A HREF="../../../cern/jet/math/Constants.html" title="class in cern.jet.math">Constants</A></DL> <P> Custom tailored numerical integration of certain probability distributions. <p> <b>Implementation:</b> <dt> Some code taken and adapted from the <A HREF="http://www.sci.usq.edu.au/staff/leighb/graph/Top.html">Java 2D Graph Package 2.4</A>, which in turn is a port from the <A HREF="http://people.ne.mediaone.net/moshier/index.html#Cephes">Cephes 2.2</A> Math Library (C). Most Cephes code (missing from the 2D Graph Package) directly ported. <P> <P> <DL> <DT><B>Version:</B></DT> <DD>0.91, 08-Dec-99</DD> </DL> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#beta(double, double, double)">beta</A></B>(double a, double b, double x)</CODE> <BR> Returns the area from zero to <tt>x</tt> under the beta density function.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#betaComplemented(double, double, double)">betaComplemented</A></B>(double a, double b, double x)</CODE> <BR> Returns the area under the right hand tail (from <tt>x</tt> to infinity) of the beta density function.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#binomial(int, int, double)">binomial</A></B>(int k, int n, double p)</CODE> <BR> Returns the sum of the terms <tt>0</tt> through <tt>k</tt> of the Binomial probability density.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#binomialComplemented(int, int, double)">binomialComplemented</A></B>(int k, int n, double p)</CODE> <BR> Returns the sum of the terms <tt>k+1</tt> through <tt>n</tt> of the Binomial probability density.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#chiSquare(double, double)">chiSquare</A></B>(double v, double x)</CODE> <BR> Returns the area under the left hand tail (from 0 to <tt>x</tt>) of the Chi square probability density function with <tt>v</tt> degrees of freedom.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#chiSquareComplemented(double, double)">chiSquareComplemented</A></B>(double v, double x)</CODE> <BR> Returns the area under the right hand tail (from <tt>x</tt> to infinity) of the Chi square probability density function with <tt>v</tt> degrees of freedom.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#errorFunction(double)">errorFunction</A></B>(double x)</CODE> <BR> Returns the error function of the normal distribution; formerly named <tt>erf</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#errorFunctionComplemented(double)">errorFunctionComplemented</A></B>(double a)</CODE> <BR> Returns the complementary Error function of the normal distribution; formerly named <tt>erfc</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#gamma(double, double, double)">gamma</A></B>(double a, double b, double x)</CODE> <BR> Returns the integral from zero to <tt>x</tt> of the gamma probability density function.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#gammaComplemented(double, double, double)">gammaComplemented</A></B>(double a, double b, double x)</CODE> <BR> Returns the integral from <tt>x</tt> to infinity of the gamma probability density function: </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#negativeBinomial(int, int, double)">negativeBinomial</A></B>(int k, int n, double p)</CODE> <BR> Returns the sum of the terms <tt>0</tt> through <tt>k</tt> of the Negative Binomial Distribution.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#negativeBinomialComplemented(int, int, double)">negativeBinomialComplemented</A></B>(int k, int n, double p)</CODE> <BR> Returns the sum of the terms <tt>k+1</tt> to infinity of the Negative Binomial distribution.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#normal(double)">normal</A></B>(double a)</CODE> <BR> 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).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#normal(double, double, double)">normal</A></B>(double mean, double variance, double x)</CODE> <BR> Returns the area under the Normal (Gaussian) probability density function, integrated from minus infinity to <tt>x</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#normalInverse(double)">normalInverse</A></B>(double y0)</CODE> <BR> Returns the value, <tt>x</tt>, for which the area under the Normal (Gaussian) probability density function (integrated from minus infinity to <tt>x</tt>) is equal to the argument <tt>y</tt> (assumes mean is zero, variance is one); formerly named <tt>ndtri</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#poisson(int, double)">poisson</A></B>(int k, double mean)</CODE> <BR> Returns the sum of the first <tt>k</tt> terms of the Poisson distribution.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#poissonComplemented(int, double)">poissonComplemented</A></B>(int k, double mean)</CODE> <BR> Returns the sum of the terms <tt>k+1</tt> to <tt>Infinity</tt> of the Poisson distribution.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#studentT(double, double)">studentT</A></B>(double k, double t)</CODE> <BR> Returns the integral from minus infinity to <tt>t</tt> of the Student-t distribution with <tt>k > 0</tt> degrees of freedom.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/stat/Probability.html#studentTInverse(double, int)">studentTInverse</A></B>(double alpha, int size)</CODE> <BR> Returns the value, <tt>t</tt>, for which the area under the Student-t probability density function (integrated from minus infinity to <tt>t</tt>) is equal to <tt>1-alpha/2</tt>.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <!-- ========= CONSTRUCTOR DETAIL ======== --> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="beta(double, double, double)"><!-- --></A><H3> beta</H3> <PRE> public static double <B>beta</B>(double a, double b, double x)</PRE> <DL> <DD>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>; <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="betaComplemented(double, double, double)"><!-- --></A><H3> betaComplemented</H3> <PRE> public static double <B>betaComplemented</B>(double a, double b, double x)</PRE> <DL> <DD>Returns the area under the right hand tail (from <tt>x</tt> to infinity) of the beta density function. This function is identical to the incomplete beta integral function <tt>Gamma.incompleteBeta(b, a, x)</tt>. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="binomial(int, int, double)"><!-- --></A><H3> binomial</H3> <PRE> public static double <B>binomial</B>(int k, int n, double p)</PRE> <DL> <DD>Returns the sum of the terms <tt>0</tt> through <tt>k</tt> of the Binomial probability density. <pre> k -- ( n ) j n-j > ( ) p (1-p) -- ( j ) j=0 </pre> The terms are not summed directly; instead the incomplete beta integral is employed, according to the formula <p> <tt>y = binomial( k, n, p ) = Gamma.incompleteBeta( n-k, k+1, 1-p )</tt>. <p> All arguments must be positive, <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>k</CODE> - end term.<DD><CODE>n</CODE> - the number of trials.<DD><CODE>p</CODE> - the probability of success (must be in <tt>(0.0,1.0)</tt>).</DL> </DD> </DL> <HR> <A NAME="binomialComplemented(int, int, double)"><!-- --></A><H3> binomialComplemented</H3> <PRE> public static double <B>binomialComplemented</B>(int k, int n, double p)</PRE> <DL> <DD>Returns the sum of the terms <tt>k+1</tt> through <tt>n</tt> of the Binomial probability density. <pre> n -- ( n ) j n-j > ( ) p (1-p) -- ( j ) j=k+1 </pre> The terms are not summed directly; instead the incomplete beta integral is employed, according to the formula <p> <tt>y = binomialComplemented( k, n, p ) = Gamma.incompleteBeta( k+1, n-k, p )</tt>. <p> All arguments must be positive, <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>k</CODE> - end term.<DD><CODE>n</CODE> - the number of trials.<DD><CODE>p</CODE> - the probability of success (must be in <tt>(0.0,1.0)</tt>).</DL> </DD> </DL> <HR> <A NAME="chiSquare(double, double)"><!-- --></A><H3> chiSquare</H3> <PRE> public static double <B>chiSquare</B>(double v, double x) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></PRE> <DL> <DD>Returns the area under the left hand tail (from 0 to <tt>x</tt>) of the Chi square probability density function with <tt>v</tt> degrees of freedom. <pre> inf. - 1 | | v/2-1 -t/2 P( x | v ) = ----------- | t e dt v/2 - | | 2 | (v/2) - x </pre> where <tt>x</tt> is the Chi-square variable. <p> The incomplete gamma integral is used, according to the formula <p> <tt>y = chiSquare( v, x ) = incompleteGamma( v/2.0, x/2.0 )</tt>. <p> The arguments must both be positive. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>v</CODE> - degrees of freedom.<DD><CODE>x</CODE> - integration end point. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></CODE></DL> </DD> </DL> <HR> <A NAME="chiSquareComplemented(double, double)"><!-- --></A><H3> chiSquareComplemented</H3> <PRE> public static double <B>chiSquareComplemented</B>(double v, double x) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></PRE> <DL> <DD>Returns the area under the right hand tail (from <tt>x</tt> to infinity) of the Chi square probability density function with <tt>v</tt> degrees of freedom. <pre> inf. - 1 | | v/2-1 -t/2 P( x | v ) = ----------- | t e dt v/2 - | | 2 | (v/2) - x </pre> where <tt>x</tt> is the Chi-square variable. The incomplete gamma integral is used, according to the formula <tt>y = chiSquareComplemented( v, x ) = incompleteGammaComplement( v/2.0, x/2.0 )</tt>. The arguments must both be positive. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>v</CODE> - degrees of freedom. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></CODE></DL> </DD> </DL> <HR> <A NAME="errorFunction(double)"><!-- --></A><H3> errorFunction</H3> <PRE> public static double <B>errorFunction</B>(double x) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></PRE> <DL> <DD>Returns the error function of the normal distribution; formerly named <tt>erf</tt>. The integral is <pre> x - 2 | | 2 erf(x) = -------- | exp( - t ) dt. sqrt(pi) | | - 0 </pre> <b>Implementation:</b> For <tt>0 <= |x| < 1, erf(x) = x * P4(x**2)/Q5(x**2)</tt>; otherwise <tt>erf(x) = 1 - erfc(x)</tt>. <p> Code adapted from the <A HREF="http://www.sci.usq.edu.au/staff/leighb/graph/Top.html">Java 2D Graph Package 2.4</A>, which in turn is a port from the <A HREF="http://people.ne.mediaone.net/moshier/index.html#Cephes">Cephes 2.2</A> Math Library (C). <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></CODE></DL> </DD> </DL> <HR> <A NAME="errorFunctionComplemented(double)"><!-- --></A><H3> errorFunctionComplemented</H3> <PRE> public static double <B>errorFunctionComplemented</B>(double a) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></PRE> <DL> <DD>Returns the complementary Error function of the normal distribution; formerly named <tt>erfc</tt>. <pre> 1 - erf(x) = inf. - 2 | | 2 erfc(x) = -------- | exp( - t ) dt sqrt(pi) | | - x </pre> <b>Implementation:</b> For small x, <tt>erfc(x) = 1 - erf(x)</tt>; otherwise rational approximations are computed. <p> Code adapted from the <A HREF="http://www.sci.usq.edu.au/staff/leighb/graph/Top.html">Java 2D Graph Package 2.4</A>, which in turn is a port from the <A HREF="http://people.ne.mediaone.net/moshier/index.html#Cephes">Cephes 2.2</A> Math Library (C). <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>a</CODE> - the argument to the function. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></CODE></DL> </DD> </DL> <HR> <A NAME="gamma(double, double, double)"><!-- --></A><H3> gamma</H3> <PRE> public static double <B>gamma</B>(double a, double b, double x)</PRE> <DL> <DD>Returns the integral from zero to <tt>x</tt> of the gamma probability density function. <pre> x b - a | | b-1 -at y = ----- | t e dt - | | | (b) - 0 </pre> The incomplete gamma integral is used, according to the relation <tt>y = Gamma.incompleteGamma( b, a*x )</tt>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>a</CODE> - the paramater a (alpha) of the gamma distribution.<DD><CODE>b</CODE> - the paramater b (beta, lambda) of the gamma distribution.<DD><CODE>x</CODE> - integration end point.</DL> </DD> </DL> <HR> <A NAME="gammaComplemented(double, double, double)"><!-- --></A><H3> gammaComplemented</H3> <PRE> public static double <B>gammaComplemented</B>(double a, double b, double x)</PRE> <DL> <DD>Returns the integral from <tt>x</tt> to infinity of the gamma probability density function: <pre> inf. b - a | | b-1 -at y = ----- | t e dt - | | | (b) - x </pre> The incomplete gamma integral is used, according to the relation <p> y = Gamma.incompleteGammaComplement( b, a*x ). <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>a</CODE> - the paramater a (alpha) of the gamma distribution.<DD><CODE>b</CODE> - the paramater b (beta, lambda) of the gamma distribution.<DD><CODE>x</CODE> - integration end point.</DL> </DD> </DL> <HR> <A NAME="negativeBinomial(int, int, double)"><!-- --></A><H3> negativeBinomial</H3> <PRE> public static double <B>negativeBinomial</B>(int k, int n, double p)</PRE> <DL> <DD>Returns the sum of the terms <tt>0</tt> through <tt>k</tt> of the Negative Binomial Distribution. <pre> k -- ( n+j-1 ) n j > ( ) p (1-p) -- ( j ) j=0 </pre> 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, <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>k</CODE> - end term.<DD><CODE>n</CODE> - the number of trials.<DD><CODE>p</CODE> - the probability of success (must be in <tt>(0.0,1.0)</tt>).</DL> </DD> </DL> <HR> <A NAME="negativeBinomialComplemented(int, int, double)"><!-- --></A><H3> negativeBinomialComplemented</H3> <PRE> public static double <B>negativeBinomialComplemented</B>(int k, int n, double p)</PRE> <DL> <DD>Returns the sum of the terms <tt>k+1</tt> to infinity of the Negative Binomial distribution. <pre> inf -- ( n+j-1 ) n j > ( ) p (1-p) -- ( j ) j=k+1 </pre> The terms are not computed individually; instead the incomplete beta integral is employed, according to the formula <p> y = negativeBinomialComplemented( k, n, p ) = Gamma.incompleteBeta( k+1, n, 1-p ). All arguments must be positive, <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>k</CODE> - end term.<DD><CODE>n</CODE> - the number of trials.<DD><CODE>p</CODE> - the probability of success (must be in <tt>(0.0,1.0)</tt>).</DL> </DD> </DL> <HR> <A NAME="normal(double)"><!-- --></A><H3> normal</H3> <PRE> public static double <B>normal</B>(double a) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></PRE> <DL> <DD>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). <pre> x - 1 | | 2 normal(x) = --------- | exp( - t /2 ) dt sqrt(2pi) | | - -inf. = ( 1 + erf(z) ) / 2 = erfc(z) / 2 </pre> where <tt>z = x/sqrt(2)</tt>. Computation is via the functions <tt>errorFunction</tt> and <tt>errorFunctionComplement</tt>. <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></CODE></DL> </DD> </DL> <HR> <A NAME="normal(double, double, double)"><!-- --></A><H3> normal</H3> <PRE> public static double <B>normal</B>(double mean, double variance, double x) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></PRE> <DL> <DD>Returns the area under the Normal (Gaussian) probability density function, integrated from minus infinity to <tt>x</tt>. <pre> x - 1 | | 2 normal(x) = --------- | exp( - (t-mean) / 2v ) dt sqrt(2pi*v)| | - -inf. </pre> where <tt>v = variance</tt>. Computation is via the functions <tt>errorFunction</tt>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>mean</CODE> - the mean of the normal distribution.<DD><CODE>variance</CODE> - the variance of the normal distribution.<DD><CODE>x</CODE> - the integration limit. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></CODE></DL> </DD> </DL> <HR> <A NAME="normalInverse(double)"><!-- --></A><H3> normalInverse</H3> <PRE> public static double <B>normalInverse</B>(double y0) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></PRE> <DL> <DD>Returns the value, <tt>x</tt>, for which the area under the Normal (Gaussian) probability density function (integrated from minus infinity to <tt>x</tt>) is equal to the argument <tt>y</tt> (assumes mean is zero, variance is one); formerly named <tt>ndtri</tt>. <p> For small arguments <tt>0 < y < exp(-2)</tt>, the program computes <tt>z = sqrt( -2.0 * log(y) )</tt>; then the approximation is <tt>x = z - log(z)/z - (1/z) P(1/z) / Q(1/z)</tt>. There are two rational functions P/Q, one for <tt>0 < y < exp(-32)</tt> and the other for <tt>y</tt> up to <tt>exp(-2)</tt>. For larger arguments, <tt>w = y - 0.5</tt>, and <tt>x/sqrt(2pi) = w + w**3 R(w**2)/S(w**2))</tt>. <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></CODE></DL> </DD> </DL> <HR> <A NAME="poisson(int, double)"><!-- --></A><H3> poisson</H3> <PRE> public static double <B>poisson</B>(int k, double mean) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></PRE> <DL> <DD>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. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>k</CODE> - number of terms.<DD><CODE>mean</CODE> - the mean of the poisson distribution. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></CODE></DL> </DD> </DL> <HR> <A NAME="poissonComplemented(int, double)"><!-- --></A><H3> poissonComplemented</H3> <PRE> public static double <B>poissonComplemented</B>(int k, double mean) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></PRE> <DL> <DD>Returns the sum of the terms <tt>k+1</tt> to <tt>Infinity</tt> of the Poisson distribution. <pre> inf. j -- -m m > e -- -- j! j=k+1 </pre> The terms are not summed directly; instead the incomplete gamma integral is employed, according to the formula <p> <tt>y = poissonComplemented( k, m ) = Gamma.incompleteGamma( k+1, m )</tt>. The arguments must both be positive. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>k</CODE> - start term.<DD><CODE>mean</CODE> - the mean of the poisson distribution. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></CODE></DL> </DD> </DL> <HR> <A NAME="studentT(double, double)"><!-- --></A><H3> studentT</H3> <PRE> public static double <B>studentT</B>(double k, double t) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></PRE> <DL> <DD>Returns the integral from minus infinity to <tt>t</tt> of the Student-t distribution with <tt>k > 0</tt> degrees of freedom. <pre> t - | | - | 2 -(k+1)/2 | ( (k+1)/2 ) | ( x ) ---------------------- | ( 1 + --- ) dx - | ( k ) sqrt( k pi ) | ( k/2 ) | | | - -inf. </pre> Relation to incomplete beta integral: <p> <tt>1 - studentT(k,t) = 0.5 * Gamma.incompleteBeta( k/2, 1/2, z )</tt> where <tt>z = k/(k + t**2)</tt>. <p> Since the function is symmetric about <tt>t=0</tt>, the area under the right tail of the density is found by calling the function with <tt>-t</tt> instead of <tt>t</tt>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>k</CODE> - degrees of freedom.<DD><CODE>t</CODE> - integration end point. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/ArithmeticException.html" title="class or interface in java.lang">ArithmeticException</A></CODE></DL> </DD> </DL> <HR> <A NAME="studentTInverse(double, int)"><!-- --></A><H3> studentTInverse</H3> <PRE> public static double <B>studentTInverse</B>(double alpha, int size)</PRE> <DL> <DD>Returns the value, <tt>t</tt>, for which the area under the Student-t probability density function (integrated from minus infinity to <tt>t</tt>) is equal to <tt>1-alpha/2</tt>. The value returned corresponds to usual Student t-distribution lookup table for <tt>t<sub>alpha[size]</sub></tt>. <p> The function uses the studentT function to determine the return value iteratively. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>alpha</CODE> - probability<DD><CODE>size</CODE> - size of data set</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Probability.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Colt 1.2.0</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../cern/jet/stat/Gamma.html" title="class in cern.jet.stat"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="Probability.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <font size=-1 >Jump to the <a target=_top href=http://dsd.lbl.gov/~hoschek/colt >Colt Homepage</a> </BODY> </HTML>