public class ResampleVariate extends RandomVariateBase
Modifier and Type | Field and Description |
---|---|
private double[] |
data
The array of data from which to sample.
|
rng
Constructor and Description |
---|
ResampleVariate() |
Modifier and Type | Method and Description |
---|---|
double |
generate()
Generates the next value by sampling with equal likelihood from the data
array.
|
double[] |
getData() |
java.lang.Object[] |
getParameters()
Returns a single element array that contains a copy of the data array.
|
void |
setData(double[] data) |
void |
setParameters(java.lang.Object... params)
Sets the contents of the array from which to sample.
|
java.lang.String |
toString() |
getRandomNumber, setRandomNumber
public double generate()
public java.lang.Object[] getParameters()
public void setParameters(java.lang.Object... params)
params
- array with one element containing the double[] data values
to be resampled.java.lang.IllegalArgumentException
- If the array does not have exactly 1
element or if the element is not an array of doubles
.public void setData(double[] data)
public double[] getData()
public java.lang.String toString()
toString
in class java.lang.Object