ca.nengo.math.impl
Class ExponentialPDF
java.lang.Object
ca.nengo.math.impl.AbstractFunction
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 recipes in C chapter 7)
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExponentialPDF
public ExponentialPDF(float tau)
- Parameters:
tau
- Rate parameter of exponential distribution
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
- Returns:
- Valid clone
- Throws:
java.lang.CloneNotSupportedException
- is super does not support clone