unbbayes.util
Class ProbabilityMath

java.lang.Object
  extended by unbbayes.util.ProbabilityMath

public class ProbabilityMath
extends Object

Mathematical functions for statistics. Most methods retrieved from http://www.math.csusb.edu/faculty/stanton/danby/danby_package.html.


Constructor Summary
ProbabilityMath()
           
 
Method Summary
static double combin(int N, int k)
          Calculate N choose k
static double factorial(int n)
           
static double getNormalPDF(double x)
          Returns the PDF of a given value x for a standard normal distribution with the mean = 0 and variance = 1.
static double getNormalPDF(double x, double mean, double variance)
          Returns the PDF of a given value x for a normal distribution with the given mean and variance.
static double inverseNormal(double p)
          inverseNormal
static double loggamma(double a)
          log gamma function
static double normalCdf(double x)
          normalCdf calculates the cumulative (standard) normal distribution function of x
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProbabilityMath

public ProbabilityMath()
Method Detail

normalCdf

public static double normalCdf(double x)
normalCdf calculates the cumulative (standard) normal distribution function of x

Parameters:
x - input value
Returns:
P(Z,z);

inverseNormal

public static double inverseNormal(double p)
inverseNormal

Parameters:
p - argument of function
Returns:
z such that P(Z <= z) = p.

factorial

public static double factorial(int n)

loggamma

public static double loggamma(double a)
log gamma function

Parameters:
x - is the value at which log gamma is to be returned

combin

public static double combin(int N,
                            int k)
Calculate N choose k


getNormalPDF

public static double getNormalPDF(double x,
                                  double mean,
                                  double variance)
Returns the PDF of a given value x for a normal distribution with the given mean and variance.

Parameters:
x - The value we want to know the probability of.
mean - The mean of this normal distribution.
variance - The variance of this normal distribution.
Returns:
The PDF of x of the given normal distribution.

getNormalPDF

public static double getNormalPDF(double x)
Returns the PDF of a given value x for a standard normal distribution with the mean = 0 and variance = 1.

Parameters:
x - The value we want to know the probability of.
Returns:
The PDF of x of the standard normal distribution.


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.