blog.distrib
Class UniformVector

java.lang.Object
  extended by blog.AbstractCondProbDistrib
      extended by blog.distrib.UniformVector
All Implemented Interfaces:
CondProbDistrib

public class UniformVector
extends AbstractCondProbDistrib

The uniform distribution over n-dimensional column vectors coming from a specified n-dimensional "box".


Constructor Summary
UniformVector(java.util.List params)
          The constructor takes an even number of parameters.
 
Method Summary
 double getLogProb(java.util.List args, java.lang.Object value)
          Returns the natural log of the value returned by getProb.
 double getProb(java.util.List args, java.lang.Object value)
          For a discrete distribution, returns the conditional probability of childValue given the argument values args.
 java.lang.Object sampleVal(java.util.List args, Type childType)
          Samples a value according to this CPD given the args .
 
Methods inherited from class blog.AbstractCondProbDistrib
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UniformVector

public UniformVector(java.util.List params)
The constructor takes an even number of parameters. For all i, 0<=i<=(n-1)/2, the (2i)-th parameter is treated as the lower bound of the generated vectors' i-th component, and every (2i+1)-th argument as the i-th component upper bound. All parameters must be of type Number.

Throws:
java.lang.IllegalArgumentException
Method Detail

getProb

public double getProb(java.util.List args,
                      java.lang.Object value)
Description copied from interface: CondProbDistrib
For a discrete distribution, returns the conditional probability of childValue given the argument values args. For a continuous distribution, returns the conditional probability density at childValue.


getLogProb

public double getLogProb(java.util.List args,
                         java.lang.Object value)
Description copied from interface: CondProbDistrib
Returns the natural log of the value returned by getProb.

Specified by:
getLogProb in interface CondProbDistrib
Overrides:
getLogProb in class AbstractCondProbDistrib

sampleVal

public java.lang.Object sampleVal(java.util.List args,
                                  Type childType)
Description copied from interface: CondProbDistrib
Samples a value according to this CPD given the args . The object returned should be of the specified type.