|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.randvarmulti.RandomMultivariateGen umontreal.iro.lecuyer.randvarmulti.MultinormalGen umontreal.iro.lecuyer.randvarmulti.MultinormalPCAGen
public class MultinormalPCAGen
Extends MultinormalGen
for a multivariate normal distribution, generated via the method of principal components analysis
(PCA) of the covariance matrix. The covariance matrix
Σ is
decomposed (by the constructor) as
Σ = VΛVt where
V is an orthogonal matrix and
Λ is the diagonal matrix made up
of the eigenvalues of
Σ. Vt is the transpose
matrix of V. The eigenvalues are ordered from the
largest (λ1) to the smallest (λd). The random multinormal
vector
X is generated via
Constructor Summary | |
---|---|
MultinormalPCAGen(NormalGen gen1,
double[] mu,
double[][] sigma)
Equivalent to MultinormalPCAGen (gen1, mu, new DenseDoubleMatrix2D(sigma)). |
|
MultinormalPCAGen(NormalGen gen1,
double[] mu,
cern.colt.matrix.DoubleMatrix2D sigma)
Constructs a multinormal generator with mean vector mu and covariance matrix sigma. |
Method Summary | |
---|---|
static cern.colt.matrix.DoubleMatrix2D |
decompPCA(double[][] sigma)
Computes the decomposition sigma = Σ = VΛVt. |
static cern.colt.matrix.DoubleMatrix2D |
decompPCA(cern.colt.matrix.DoubleMatrix2D sigma)
Computes the decomposition sigma = Σ = VΛVt. |
double[] |
getLambda()
Returns the eigenvalues of Σ in decreasing order. |
static double[] |
getLambda(cern.colt.matrix.DoubleMatrix2D sigma)
Computes and returns the eigenvalues of sigma in decreasing order. |
cern.colt.matrix.DoubleMatrix2D |
getPCADecompSigma()
Returns the matrix A = V()1/2 of this object. |
void |
nextPoint(double[] p)
Generates a point from this multinormal distribution. |
static void |
nextPoint(NormalGen gen1,
double[] mu,
double[][] sigma,
double[] p)
Equivalent to nextPoint (gen1, mu, new DenseDoubleMatrix2D(sigma), p). |
static void |
nextPoint(NormalGen gen1,
double[] mu,
cern.colt.matrix.DoubleMatrix2D sigma,
double[] p)
Generates a d-dimensional vector from the multinormal distribution with mean vector mu and covariance matrix sigma, using the one-dimensional normal generator gen1 to generate the coordinates of Z, and using the PCA decomposition of Σ. |
void |
setSigma(cern.colt.matrix.DoubleMatrix2D sigma)
Sets the covariance matrix Σ of this multinormal generator to sigma (and recomputes A). |
Methods inherited from class umontreal.iro.lecuyer.randvarmulti.MultinormalGen |
---|
getMu, getMu, getSigma, setMu, setMu |
Methods inherited from class umontreal.iro.lecuyer.randvarmulti.RandomMultivariateGen |
---|
getDimension, getStream, nextArrayOfPoints, setStream |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultinormalPCAGen(NormalGen gen1, double[] mu, double[][] sigma)
MultinormalPCAGen
(gen1, mu, new DenseDoubleMatrix2D(sigma)).
public MultinormalPCAGen(NormalGen gen1, double[] mu, cern.colt.matrix.DoubleMatrix2D sigma)
gen1
- the one-dimensional generatormu
- the mean vector.sigma
- the covariance matrix.
NullPointerException
- if any argument is null.
IllegalArgumentException
- if the length of the mean
vector is incompatible with the dimensions of the covariance matrix.Method Detail |
---|
public static cern.colt.matrix.DoubleMatrix2D decompPCA(double[][] sigma)
public static cern.colt.matrix.DoubleMatrix2D decompPCA(cern.colt.matrix.DoubleMatrix2D sigma)
public cern.colt.matrix.DoubleMatrix2D getPCADecompSigma()
public static double[] getLambda(cern.colt.matrix.DoubleMatrix2D sigma)
public double[] getLambda()
public void setSigma(cern.colt.matrix.DoubleMatrix2D sigma)
sigma
- the new covariance matrix.
IllegalArgumentException
- if sigma has
incorrect dimensions.public static void nextPoint(NormalGen gen1, double[] mu, cern.colt.matrix.DoubleMatrix2D sigma, double[] p)
p
- the array to be filled with the generated point.
IllegalArgumentException
- if the one-dimensional normal
generator uses a normal distribution with μ not equal to 0, or
σ not equal to 1.
IllegalArgumentException
- if the length of the mean
vector is different from the dimensions of the covariance matrix,
or if the covariance matrix is not symmetric and positive-definite.
NullPointerException
- if any argument is null.public static void nextPoint(NormalGen gen1, double[] mu, double[][] sigma, double[] p)
nextPoint
(gen1, mu, new DenseDoubleMatrix2D(sigma), p).
public void nextPoint(double[] p)
nextPoint
in class MultinormalGen
p
- the array to be filled with the generated point
|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |