de.unihalle.informatik.MiToBo.math.distributions.impl
Class UniformDistribution

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.math.distributions.impl.UniformDistribution
All Implemented Interfaces:
EvaluatableDistribution<Jama.Matrix>, FirstOrderMoment<Jama.Matrix>, LogEvaluatableDistribution<Jama.Matrix>, LogProbabilityDensityFunction, ProbabilityDensityFunction, SamplingDistribution<Jama.Matrix>

public class UniformDistribution
extends java.lang.Object
implements ProbabilityDensityFunction, LogProbabilityDensityFunction, SamplingDistribution<Jama.Matrix>, FirstOrderMoment<Jama.Matrix>

A multivariate uniform distribution.

Author:
Oliver Gress

Field Summary
protected  int DOF
           
protected  double[] llimits
           
protected  double log_p
           
protected  Jama.Matrix mean
           
protected  double p
           
protected  java.util.Random rand
           
protected  double[] ulimits
           
protected  double vol
           
 
Constructor Summary
UniformDistribution(int DOF, double[] lowerlimits, double[] upperlimits, java.util.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.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOF

protected int DOF

llimits

protected double[] llimits

log_p

protected double log_p

mean

protected Jama.Matrix mean

p

protected double p

rand

protected java.util.Random rand

ulimits

protected double[] ulimits

vol

protected double vol
Constructor Detail

UniformDistribution

public UniformDistribution(int DOF,
                           double[] lowerlimits,
                           double[] upperlimits,
                           java.util.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. Throws IllegalArgumentException, if the limit arrays are not of length DOF.

Parameters:
DOF - degrees of freedom
lowerlimits - lower limits for each dimension
upperlimits - upper limits for each dimension
rand - random generator
Method Detail

drawSample

public Jama.Matrix drawSample()
Description copied from interface: SamplingDistribution
Generate a new sample from this density. This method should create a new object.

Specified by:
drawSample in interface SamplingDistribution<Jama.Matrix>
Returns:
new sample object

getMean

public Jama.Matrix getMean()
Specified by:
getMean in interface FirstOrderMoment<Jama.Matrix>

getVolume

public double getVolume()
Get volume of the hypercube where p(x) > 0


log_p

public double log_p(Jama.Matrix x)
Description copied from interface: LogEvaluatableDistribution
Evaluate natural logarithm of p(X) at location x. log(P(X=x))

Specified by:
log_p in interface LogEvaluatableDistribution<Jama.Matrix>
Parameters:
x - realization of random variable X
Returns:
value of log(p(X)) at x

p

public double p(Jama.Matrix x)
Description copied from interface: EvaluatableDistribution
Evaluate p(X) at location x. P(X=x)

Specified by:
p in interface EvaluatableDistribution<Jama.Matrix>
Parameters:
x - realization of random variable X
Returns:
value of p(X) at x