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>

@ALDMetaInfo(export=ALLOWED)
public class UniformDistribution
extends 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  Random rand
           
protected  double[] ulimits
           
protected  double vol
           
 
Constructor Summary
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.
 
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

rand

protected Random rand

mean

protected Jama.Matrix mean

llimits

protected double[] llimits

ulimits

protected double[] ulimits

p

protected double p

log_p

protected double log_p

vol

protected double vol

DOF

protected int DOF
Constructor Detail

UniformDistribution

public 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. 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

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

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

getMean

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

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

getVolume

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



Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.