public class GaussianPDF extends java.lang.Object implements PDF
Constructor and Description |
---|
GaussianPDF()
Instantiates with default mean=0 and variance=1
|
GaussianPDF(float mean,
float variance) |
GaussianPDF(float mean,
float variance,
float peak)
Constructs a scaled Gaussian with the given peak value.
|
Modifier and Type | Method and Description |
---|---|
PDF |
clone() |
static float[] |
doSample()
This method is publically exposed because normal deviates are often needed,
and static access allows the compiler to inline the call, which brings a
small performance advantage.
|
int |
getDimension() |
float |
getMean() |
float |
getPeak() |
boolean |
getScalePeakWithVariance() |
float |
getVariance() |
float |
map(float[] from) |
float[] |
multiMap(float[][] from) |
float[] |
sample() |
void |
setMean(float mean) |
void |
setPeak(float peak) |
void |
setScalePeakWithVariance(boolean scale) |
void |
setVariance(float variance) |
public GaussianPDF(float mean, float variance)
mean
- Mean of the distributionvariance
- Variance of the distributionpublic GaussianPDF(float mean, float variance, float peak)
mean
- Mean of the distributionvariance
- Variance of the distributionpeak
- Maximum value of scaled Gaussianpublic GaussianPDF()
public void setMean(float mean)
mean
- Mean of the distributionpublic float getMean()
public void setVariance(float variance)
variance
- Variance of the distributionpublic float getVariance()
public void setPeak(float peak)
peak
- Maximum value of scaled Gaussianpublic float getPeak()
public void setScalePeakWithVariance(boolean scale)
scale
- If true, the peak of the distribution scales automatically so that the integral is 1public boolean getScalePeakWithVariance()
public float[] sample()
sample
in interface PDF
PDF.sample()
public static float[] doSample()
public int getDimension()
getDimension
in interface Function
Function.getDimension()
public float map(float[] from)
map
in interface Function
from
- Must have same length as getDimension()Function.map(float[])
public float[] multiMap(float[][] from)
multiMap
in interface Function
from
- An array of arguments; each element must have length getDimension().Function.multiMap(float[][])