public class RotatedBivariateNormalVector extends java.lang.Object implements RandomVector
See comments in setParameters(java.lang.Object...) for options in
setting parameters.
| Modifier and Type | Field and Description |
|---|---|
private double |
angle |
private double |
cosAngle |
private double[] |
mean |
private RandomNumber |
rng |
private double |
sinAngle |
private double[] |
standardDeviation |
private Normal02Variate[] |
standardNormalsGenerator |
| Constructor and Description |
|---|
RotatedBivariateNormalVector()
Instantiate the underlying normals; set means to 0.0 and standard
deviations to 1.0, angle to 0.0 by default.
|
| Modifier and Type | Method and Description |
|---|---|
private static boolean |
checkParameters(java.lang.Object... params) |
double[] |
generate()
First generate two independent normals with zero mean and the specified
standard deviations.
|
double |
getAngle() |
double[] |
getMean() |
double |
getMean(int index) |
java.lang.Object[] |
getParameters()
Returns an array containing the parameters of this RandomVector.
|
RandomNumber |
getRandomNumber()
Gets the instance of the supporting RandomNumber.
|
double[] |
getStandardDeviation() |
double |
getStandardDeviation(int index) |
void |
setAngle(double angle) |
void |
setMean(double[] mean) |
void |
setMean(int index,
double mean) |
void |
setParameters(java.lang.Object... params)
The number of parameters can be 0-5, with 5 being the "complete" set.
|
void |
setRandomNumber(RandomNumber rng)
Sets the supporting RandomNumber.
|
void |
setStandardDeviation(double[] standardDeviation) |
void |
setStandardDeviation(int index,
double standardDeviation) |
java.lang.String |
toString() |
private RandomNumber rng
private double[] mean
private double[] standardDeviation
private double angle
private Normal02Variate[] standardNormalsGenerator
private double cosAngle
private double sinAngle
public RotatedBivariateNormalVector()
public double[] generate()
generate in interface RandomVectorpublic void setParameters(java.lang.Object... params)
setParameters in interface RandomVectorparams - Input parameters (see comments for options)java.lang.IllegalArgumentException - if any of the parameters are not
instances of Numberprivate static boolean checkParameters(java.lang.Object... params)
params - Parameters to checkpublic java.lang.Object[] getParameters()
RandomVectorgetParameters in interface RandomVectorpublic void setRandomNumber(RandomNumber rng)
RandomVectorsetRandomNumber in interface RandomVectorrng - The RandomNumber object to be used to generate the underlying Un(0,1)
random numbers.public RandomNumber getRandomNumber()
RandomVectorgetRandomNumber in interface RandomVectorpublic double[] getMean()
public double getMean(int index)
index - index of mean to getjava.lang.ArrayIndexOutOfBoundsException - if index < 0 or index > 1public void setMean(double[] mean)
mean - the mean to setpublic void setMean(int index,
double mean)
index - index of mean to setmean - mean[index]java.lang.ArrayIndexOutOfBoundsException - if index < 0 or index > 1public double[] getStandardDeviation()
public double getStandardDeviation(int index)
index - index of standard deviation to getjava.lang.ArrayIndexOutOfBoundsException - if index < 0 or index > 1public void setStandardDeviation(double[] standardDeviation)
standardDeviation - the standardDeviation to setjava.lang.IllegalArgumentException - if standardDeviation not of length 2java.lang.IllegalArgumentException - if either value is < 0.0public void setStandardDeviation(int index,
double standardDeviation)
index - index of standard deviation to setstandardDeviation - standardDeviatioon[index]java.lang.IllegalArgumentException - if index < 0 or index > 1.java.lang.IllegalArgumentException - if standardDeviatioon < 0.0public double getAngle()
public void setAngle(double angle)
angle - the angle to setpublic java.lang.String toString()
toString in class java.lang.Object