public class UniformDistribution extends Object implements ProbabilityDensityFunction, LogProbabilityDensityFunction, SamplingDistribution<Jama.Matrix>, FirstOrderMoment<Jama.Matrix>
Modifier and Type | Field and Description |
---|---|
protected int |
DOF |
protected double[] |
llimits |
protected double |
log_p |
protected Jama.Matrix |
mean |
protected double |
p |
protected Random |
rand |
protected double[] |
ulimits |
protected double |
vol |
Constructor and Description |
---|
UniformDistribution(int DOF,
double[] lowerlimits,
double[] upperlimits,
Random rand)
Constructor for uniform distribution with hypercube shape in dimension DOF, given lower and upper limits in the
corresponding dimension and a random generator for sampling.
|
Modifier and Type | Method and Description |
---|---|
Jama.Matrix |
drawSample()
Generate a new sample from this density.
|
Jama.Matrix |
getMean() |
double |
getVolume()
Get volume of the hypercube where p(x) > 0
|
double |
log_p(Jama.Matrix x)
Evaluate natural logarithm of p(X) at location x. log(P(X=x))
|
double |
p(Jama.Matrix x)
Evaluate p(X) at location x.
|
protected Random rand
protected Jama.Matrix mean
protected double[] llimits
protected double[] ulimits
protected double p
protected double log_p
protected double vol
protected int DOF
public UniformDistribution(int DOF, double[] lowerlimits, double[] upperlimits, Random rand)
DOF
- degrees of freedomlowerlimits
- lower limits for each dimensionupperlimits
- upper limits for each dimensionrand
- random generatorpublic double p(Jama.Matrix x)
EvaluatableDistribution
p
in interface EvaluatableDistribution<Jama.Matrix>
x
- realization of random variable Xpublic double log_p(Jama.Matrix x)
LogEvaluatableDistribution
log_p
in interface LogEvaluatableDistribution<Jama.Matrix>
x
- realization of random variable Xpublic Jama.Matrix getMean()
getMean
in interface FirstOrderMoment<Jama.Matrix>
public Jama.Matrix drawSample()
SamplingDistribution
drawSample
in interface SamplingDistribution<Jama.Matrix>
public double getVolume()
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.