statistic.distribution
Class GammaDistribution

java.lang.Object
  |
  +--statistic.distribution.GenericDistribution
        |
        +--statistic.distribution.GenericContinuousDistribution
              |
              +--statistic.distribution.GammaDistribution
All Implemented Interfaces:
ComputerArithmetic, RandomGenerator, statistic.UNKComputer

public class GammaDistribution
extends GenericContinuousDistribution
implements RandomGenerator, ComputerArithmetic


Field Summary
static int A
          Equation de la densite:
f(x)= lambda^a * x^(a-1) * exp(-lambda*x) / Gamma(a)
where alpha = shape parameter, must be > 0
lambda = scale parameter, must be > 0
x = the random variable, must be >= 0
static int LAMBDA
           
 
Fields inherited from class statistic.distribution.GenericDistribution
name, paramNames, params
 
Fields inherited from interface statistic.RandomGenerator
random
 
Fields inherited from interface statistic.ComputerArithmetic
MACHEP, MAXGAM, MAXLOG, MAXNUM, MAXSTIR, MINLOG, P, P0, P1, P2, Q, Q0, Q1, Q2, s2pi, SQTPI, STIR
 
Constructor Summary
GammaDistribution()
          Definition des constructeurs
GammaDistribution(double[] params)
           
GammaDistribution(double a, double lambda)
           
 
Method Summary
 double cdf(double x)
          Returns the value of the cumulative distribution function at x (=Fonction de repartition)
 double inverseCdf(double x)
          Return the value of Inverse Function at x
static void main(java.lang.String[] args)
          Methode: Main pour tester la classe
 double mean()
          Returns the mean of the distribution
 double pdf(double x)
          Returns the value of the probability distribution function at x
 double rand()
          Return a random value
 void setParam(int idx, double p)
          Positionne la valeur d'un ou de plusieurs parametres
 void setParams(double[] params)
          public GammaDistribution(double mean,double var) throws IllegalArgumentException { this(); if (mean > 0 && var>0) { params[A] = Math.pow(mean,2) / var; params[LAMBDA] = mean / var; } else { throw new IllegalArgumentException("GammaDistribution.constructor : mean and var must be greater than 0"); } }
 double var()
          Returns the variance of the distribution
 
Methods inherited from class statistic.distribution.GenericContinuousDistribution
normalStandardCdf
 
Methods inherited from class statistic.distribution.GenericDistribution
getEquation, getName, getParam, getParamName, getParams, getParamsCount, getParamsNames
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

A

public static int A
Equation de la densite:
f(x)= lambda^a * x^(a-1) * exp(-lambda*x) / Gamma(a)
where alpha = shape parameter, must be > 0
lambda = scale parameter, must be > 0
x = the random variable, must be >= 0


LAMBDA

public static int LAMBDA
Constructor Detail

GammaDistribution

public GammaDistribution()
Definition des constructeurs


GammaDistribution

public GammaDistribution(double a,
                         double lambda)
                  throws java.lang.IllegalArgumentException

GammaDistribution

public GammaDistribution(double[] params)
                  throws java.lang.IllegalArgumentException
Method Detail

setParams

public void setParams(double[] params)
               throws java.lang.IllegalArgumentException
public GammaDistribution(double mean,double var) throws IllegalArgumentException { this(); if (mean > 0 && var>0) { params[A] = Math.pow(mean,2) / var; params[LAMBDA] = mean / var; } else { throw new IllegalArgumentException("GammaDistribution.constructor : mean and var must be greater than 0"); } }

Overrides:
setParams in class GenericDistribution
java.lang.IllegalArgumentException

setParam

public void setParam(int idx,
                     double p)
              throws java.lang.IllegalArgumentException
Description copied from class: GenericDistribution
Positionne la valeur d'un ou de plusieurs parametres

Overrides:
setParam in class GenericDistribution
java.lang.IllegalArgumentException

pdf

public double pdf(double x)
Returns the value of the probability distribution function at x

Specified by:
pdf in class GenericDistribution

cdf

public double cdf(double x)
Returns the value of the cumulative distribution function at x (=Fonction de repartition)

Specified by:
cdf in class GenericDistribution

inverseCdf

public double inverseCdf(double x)
Return the value of Inverse Function at x

Specified by:
inverseCdf in class GenericContinuousDistribution
Parameters:
x - with x>=0 and x<=1

mean

public double mean()
Description copied from class: GenericDistribution
Returns the mean of the distribution

Specified by:
mean in class GenericDistribution

var

public double var()
Description copied from class: GenericDistribution
Returns the variance of the distribution

Specified by:
var in class GenericDistribution

rand

public double rand()
Description copied from class: GenericDistribution
Return a random value

Overrides:
rand in class GenericDistribution

main

public static void main(java.lang.String[] args)
Methode: Main pour tester la classe