blog.distrib
Class Exponential

java.lang.Object
  extended by blog.AbstractCondProbDistrib
      extended by blog.distrib.Exponential
All Implemented Interfaces:
CondProbDistrib

public class Exponential
extends AbstractCondProbDistrib

An Exponential distribution with parameter lambda over non-negative reals. The probability of x is lambda * e^(-lambda*x).


Constructor Summary
Exponential(java.util.List params)
          Creates a new Exponential with parameter lambda
 
Method Summary
 double getLogProb(java.util.List args, java.lang.Object value)
          Returns the log of the probability of x under this distribution.
 double getProb(java.util.List args, java.lang.Object value)
          Returns the probability of x under this distribution
 java.lang.Object sampleVal(java.util.List args, Type childType)
          Returns a double sampled according to this distribution.
 
Methods inherited from class blog.AbstractCondProbDistrib
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Exponential

public Exponential(java.util.List params)
Creates a new Exponential with parameter lambda

Method Detail

getProb

public double getProb(java.util.List args,
                      java.lang.Object value)
Returns the probability of x under this distribution


getLogProb

public double getLogProb(java.util.List args,
                         java.lang.Object value)
Returns the log of the probability of x under this distribution.

Specified by:
getLogProb in interface CondProbDistrib
Overrides:
getLogProb in class AbstractCondProbDistrib

sampleVal

public java.lang.Object sampleVal(java.util.List args,
                                  Type childType)
Returns a double sampled according to this distribution. Takes constant time. (Reference: A Guide to Simulation, 2nd Ed. Bratley, Paul, Bennett L. Fox and Linus E. Schrage.)