ca.nengo.math.impl
Class ExponentialPDF

java.lang.Object
  extended by ca.nengo.math.impl.AbstractFunction
      extended by ca.nengo.math.impl.ExponentialPDF
All Implemented Interfaces:
Function, PDF, java.io.Serializable, java.lang.Cloneable

public class ExponentialPDF
extends AbstractFunction
implements PDF

A one-dimensional exponential probability density function. TODO: unit tests TODO: generalize to any function with invertible integral (see numerical recipies in C chapter 7)

Author:
Bryan Tripp
See Also:
Serialized Form

Field Summary
 
Fields inherited from class ca.nengo.math.impl.AbstractFunction
DIMENSION_PROPERTY
 
Constructor Summary
ExponentialPDF(float tau)
           
 
Method Summary
 PDF clone()
           
 float getTau()
           
static void main(java.lang.String[] args)
           
 float map(float[] from)
           
 float[] sample()
           
 void setTau(float tau)
           
 
Methods inherited from class ca.nengo.math.impl.AbstractFunction
getDimension, multiMap
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ca.nengo.math.Function
getDimension, multiMap
 

Constructor Detail

ExponentialPDF

public ExponentialPDF(float tau)
Parameters:
tau - Rate parameter of exponential distribution
Method Detail

getTau

public float getTau()
Returns:
Rate parameter of exponential distribution

setTau

public void setTau(float tau)
Parameters:
tau - Rate parameter of exponential distribution

map

public float map(float[] from)
Specified by:
map in interface Function
Specified by:
map in class AbstractFunction
Parameters:
from - Must have same length as getDimension()
Returns:
result of function operation on arg
See Also:
AbstractFunction.map(float[])

sample

public float[] sample()
Specified by:
sample in interface PDF
Returns:
A random sample from this density
See Also:
PDF.sample()

clone

public PDF clone()
          throws java.lang.CloneNotSupportedException
Specified by:
clone in interface Function
Specified by:
clone in interface PDF
Overrides:
clone in class AbstractFunction
Throws:
java.lang.CloneNotSupportedException
See Also:
Object.clone()

main

public static void main(java.lang.String[] args)