sugr.test
Class RandomVector

java.lang.Object
  extended bysugr.test.RandomVector

public class RandomVector
extends java.lang.Object

Generate normally distributed random vectors from a given covariance matrix. This is done in the following way to support a covariance matrix with covariances Given: covariance matrix of vector v 1) Cholesky decomposition: sigma=A*At 2) Singular value decomposition from A : A=U*S*Vt ==> sigma=U*S^2*Ut 3) Error propagation: Use random generator to get a random vector y with y1sigma, y2sigma, ... (of course without covariances !) Then v=U*y has covariance matrix sigma. This class uses Jama for Cholesky decomposition directly.

Author:
Thomas Laebe, ipb

Constructor Summary
RandomVector(Matrix sigma)
          Initialize random generation with a given covariance.
RandomVector(Vector v, Matrix sigma)
          Initialize random generation with a given covariance and vector.
 
Method Summary
 Vector getNextRandom()
          Get next random vector.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomVector

public RandomVector(Matrix sigma)
Initialize random generation with a given covariance.

Parameters:
sigma - covariance matrix of the random vector

RandomVector

public RandomVector(Vector v,
                    Matrix sigma)
Initialize random generation with a given covariance and vector.

Parameters:
v - the mean value.
sigma - covariance matrix of the random vector
Method Detail

getNextRandom

public Vector getNextRandom()
Get next random vector.

Returns:
the random vector