distribution
Class MultivariateNormal

java.lang.Object
  extended by distribution.BasicMultivariateDistribution
      extended by distribution.MultivariateNormal
All Implemented Interfaces:
MultivariateDistribution

public class MultivariateNormal
extends BasicMultivariateDistribution

Implements a multivariate normal distribution by extending BasicMultivariateDistribution. Some methods are more streamlined by exploiting the optimizations in the colt classes.

Author:
dgorur

Field Summary
 
Fields inherited from class distribution.BasicMultivariateDistribution
randomEngine
 
Constructor Summary
MultivariateNormal()
           
 
Method Summary
 double densityAt(double[] x)
          Computes the density at the given point.
 cern.colt.matrix.DoubleMatrix1D densityAt(cern.colt.matrix.DoubleMatrix2D x, cern.colt.matrix.DoubleMatrix1D p)
          Computes the density at the points comprising the rows of the input matrix, and places the result in the supplied vector.
 void nextSample(double[] arr)
          Generates the next random sample of this distribution and places the result in the supplied array.
 cern.colt.matrix.DoubleMatrix2D nextSample(cern.colt.matrix.DoubleMatrix2D mat)
          Generates the next m random samples of this distribution and places the result in the supplied matrix.
 void setCovariance(cern.colt.matrix.DoubleMatrix2D covariance)
          Sets the covariance of this distribution.
 void setInputDimension(int numDim)
          Sets the number of dimensions of this distribution
 void setMean(cern.colt.matrix.DoubleMatrix1D mean)
          Sets the mean of this distribution.
 void setSeed(int seed)
          Sets the seed for the random number generator of this distribution instance.
 
Methods inherited from class distribution.BasicMultivariateDistribution
densityAt, densityAt, densityAt, getInputDimension, makeNextSample, makeNextSample, nextSample, nextSample
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultivariateNormal

public MultivariateNormal()
Method Detail

densityAt

public double densityAt(double[] x)
Description copied from interface: MultivariateDistribution
Computes the density at the given point.

Parameters:
x - the given point.
Returns:
the density at the given point.

densityAt

public cern.colt.matrix.DoubleMatrix1D densityAt(cern.colt.matrix.DoubleMatrix2D x,
                                                 cern.colt.matrix.DoubleMatrix1D p)
Description copied from interface: MultivariateDistribution
Computes the density at the points comprising the rows of the input matrix, and places the result in the supplied vector.

Specified by:
densityAt in interface MultivariateDistribution
Overrides:
densityAt in class BasicMultivariateDistribution
Parameters:
x - matrix whose rows are the points where density is desired.
p - vector to hold the result, cannot be null.
Returns:
pointer to the result vector, for convenience.

nextSample

public void nextSample(double[] arr)
Description copied from interface: MultivariateDistribution
Generates the next random sample of this distribution and places the result in the supplied array.

Parameters:
arr - array to store the result, cannot be null.

nextSample

public cern.colt.matrix.DoubleMatrix2D nextSample(cern.colt.matrix.DoubleMatrix2D mat)
Description copied from interface: MultivariateDistribution
Generates the next m random samples of this distribution and places the result in the supplied matrix. Returns a pointer to the same matrix for convenience.

Specified by:
nextSample in interface MultivariateDistribution
Overrides:
nextSample in class BasicMultivariateDistribution
Parameters:
mat - matrix to hold the result. Cannot be null
Returns:
a pointer to the same matrix, for convenience. Use MultivariateDistribution.makeNextSample(int) to creates samples from scratch.

setCovariance

public void setCovariance(cern.colt.matrix.DoubleMatrix2D covariance)
Sets the covariance of this distribution.

Parameters:
covariance - the given covariance matrix.

setInputDimension

public void setInputDimension(int numDim)
Description copied from interface: MultivariateDistribution
Sets the number of dimensions of this distribution

Specified by:
setInputDimension in interface MultivariateDistribution
Overrides:
setInputDimension in class BasicMultivariateDistribution
Parameters:
numDim - the given number of dimensions.

setMean

public void setMean(cern.colt.matrix.DoubleMatrix1D mean)
Sets the mean of this distribution.

Parameters:
mean - the given mean.

setSeed

public void setSeed(int seed)
Description copied from interface: MultivariateDistribution
Sets the seed for the random number generator of this distribution instance.

Parameters:
seed - the given seed.