|
SSJ V. labo. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectumontreal.iro.lecuyer.randvar.RandomVariateGen
umontreal.iro.lecuyer.randvar.UnuranEmpirical
public class UnuranEmpirical
This class permits one to create generators for empirical and quasi-empirical univariate distributions using UNURAN via its string interface. The empirical data can be read from a file, from an array, or simply encoded into the generator specification string. When reading from a file or an array, the generator specification string must not contain a distribution specification string.
| Constructor Summary | |
|---|---|
UnuranEmpirical(RandomStream s,
PiecewiseLinearEmpiricalDist dist,
String genStr)
Same as UnuranEmpirical(s, s, dist, genStr). |
|
UnuranEmpirical(RandomStream s,
RandomStream aux,
PiecewiseLinearEmpiricalDist dist,
String genStr)
Same as UnuranEmpirical(s, aux, genStr), but reading
the observations from the empirical distribution dist. |
|
UnuranEmpirical(RandomStream s,
RandomStream aux,
String genStr)
Constructs a new empirical univariate generator using the specification string genStr, with main stream s and auxiliary stream aux. |
|
UnuranEmpirical(RandomStream s,
String genStr)
Constructs a new empirical univariate generator using the specification string genStr and stream s. |
|
| Method Summary | |
|---|---|
RandomStream |
getAuxStream()
Returns the auxiliary random number stream. |
Distribution |
getDistribution()
Returns the Distribution used by this generator. |
RandomStream |
getStream()
Returns the RandomStream used by this generator. |
void |
nextArrayOfDouble(double[] v,
int start,
int n)
Generates n random numbers from the continuous distribution contained in this object. |
double |
nextDouble()
Generates a random number from the continuous distribution contained in this object. |
| Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen |
|---|
setStream, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UnuranEmpirical(RandomStream s,
String genStr)
public UnuranEmpirical(RandomStream s,
RandomStream aux,
String genStr)
public UnuranEmpirical(RandomStream s,
PiecewiseLinearEmpiricalDist dist,
String genStr)
UnuranEmpirical(s, s, dist, genStr).
public UnuranEmpirical(RandomStream s,
RandomStream aux,
PiecewiseLinearEmpiricalDist dist,
String genStr)
UnuranEmpirical(s, aux, genStr), but reading
the observations from the empirical distribution dist.
The genStr argument must not contain a distribution part
because the distribution will be generated from the input stream reader.
| Method Detail |
|---|
public double nextDouble()
RandomVariateGeninverseF
method of the distribution object.
Alternative generating methods are provided in subclasses.
nextDouble in class RandomVariateGen
public void nextArrayOfDouble(double[] v,
int start,
int n)
RandomVariateGennextDouble() n
times, but one can override it in subclasses for better efficiency.
nextArrayOfDouble in class RandomVariateGenv - array in which the variates will be storedstart - starting index, in v, of the new variatesn - number of variates to generatepublic Distribution getDistribution()
RandomVariateGenDistribution used by this generator.
getDistribution in class RandomVariateGenpublic RandomStream getStream()
RandomVariateGenRandomStream used by this generator.
getStream in class RandomVariateGenpublic RandomStream getAuxStream()
|
SSJ V. labo. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||