26package umontreal.ssj.randvar;
28import umontreal.ssj.rng.*;
29import umontreal.ssj.probdist.BetaSymmetricalDist;
54 private double afactor;
55 private static final double TWOPI = 2.0 * Math.PI;
70 afactor = 1.0 / alpha;
71 setParams(alpha, alpha, 0.0, 1.0);
83 this(s1, s1, s1, alpha);
96 afactor = 1.0 / dist.getAlpha();
98 setParams(dist.getAlpha(), dist.getAlpha(), dist.getA(), dist.getB());
106 this(s1, s1, s1, dist);
114 double cos, temp, v, S;
116 temp = 1.0 / Math.pow(s1.
nextDouble(), 1.0 / alpha) - 1.0;
117 v = Math.sqrt(1.0 + 1.0 / (temp * cos * cos));
120 return 0.5 - 0.5 / v;
122 return 0.5 + 0.5 / v;
135 double cos, temp, v, S;
136 cos = Math.cos(TWOPI * stream2.nextDouble());
137 temp = 1.0 / Math.pow(stream.nextDouble(), afactor) - 1.0;
138 v = Math.sqrt(1.0 + 1.0 / (temp * cos * cos));
139 S = stream3.nextDouble();
141 return 0.5 - 0.5 / v;
143 return 0.5 + 0.5 / v;
Specializes the class BetaDist to the case of a symmetrical beta distribution over the interval ,...
static double nextDouble(RandomStream s1, RandomStream s2, RandomStream s3, double alpha)
Generates a random number using Devroye’s one-liner method.
static double nextDouble(RandomStream s, double alpha)
Generates a random number using Devroye’s one-liner method with only one stream s.
BetaSymmetricalBestGen(RandomStream s1, BetaSymmetricalDist dist)
Creates a new generator for the distribution dist, using only one stream s1.
BetaSymmetricalBestGen(RandomStream s1, RandomStream s2, RandomStream s3, BetaSymmetricalDist dist)
Creates a new generator for the distribution dist, using stream s1 to generate , stream s2 to generat...
RandomStream getStream2()
Returns stream s2 associated with this object.
RandomStream getStream3()
Returns stream s3 associated with this object.
BetaSymmetricalBestGen(RandomStream s1, RandomStream s2, RandomStream s3, double alpha)
Creates a symmetrical beta random variate generator with parameter.
double nextDouble()
Generates a random number from the continuous distribution contained in this object.
BetaSymmetricalBestGen(RandomStream s1, double alpha)
Creates a symmetrical beta random variate generator with parameter.
BetaSymmetricalGen(RandomStream s, double alpha)
Creates a new symmetrical beta generator with parameters.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...
double nextDouble()
Returns a (pseudo)random number from the uniform distribution over the interval , using this stream,...