SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
FrechetGen.java
1/*
2 * Class: FrechetGen
3 * Description: generator of random variates from the Fréchet distribution
4 * Environment: Java
5 * Software: SSJ
6 * Copyright (C) 2001 Pierre L'Ecuyer and Universite de Montreal
7 * Organization: DIRO, Universite de Montreal
8 * @author
9 * @since
10 *
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 */
25package umontreal.ssj.randvar;
26
27import umontreal.ssj.rng.*;
28import umontreal.ssj.probdist.*;
29
42public class FrechetGen extends RandomVariateGen {
43 private double delta;
44 private double beta;
45 private double alpha;
46
52 public FrechetGen(RandomStream s, double alpha) {
53 this(s, alpha, 1.0, 0.0);
54 }
55
62 public FrechetGen(RandomStream s, double alpha, double beta, double delta) {
63 super(s, new FrechetDist(alpha, beta, delta));
64 setParams(alpha, beta, delta);
65 }
66
72 super(s, dist);
73 if (dist != null)
74 setParams(dist.getAlpha(), dist.getBeta(), dist.getDelta());
75 }
76
83 public static double nextDouble(RandomStream s, double alpha, double beta, double delta) {
84 return FrechetDist.inverseF(alpha, beta, delta, s.nextDouble());
85 }
86
90 public double getAlpha() {
91 return alpha;
92 }
93
97 public double getBeta() {
98 return beta;
99 }
100
104 public double getDelta() {
105 return delta;
106 }
107
112 protected void setParams(double alpha, double beta, double delta) {
113 if (beta <= 0.0)
114 throw new IllegalArgumentException("beta <= 0");
115 if (alpha <= 0.0)
116 throw new IllegalArgumentException("alpha <= 0");
117 this.delta = delta;
118 this.beta = beta;
119 this.alpha = alpha;
120 }
121}
Extends the class ContinuousDistribution for the Fréchet distribution tjoh95b  (page 3),...
double inverseF(double u)
Returns the inverse distribution function .
FrechetGen(RandomStream s, FrechetDist dist)
Creates a new generator for the Fréchet distribution dist and stream s.
FrechetGen(RandomStream s, double alpha)
Creates a Fréchet random number generator with.
FrechetGen(RandomStream s, double alpha, double beta, double delta)
Creates a Fréchet random number generator with parameters.
double getBeta()
Returns the parameter .
static double nextDouble(RandomStream s, double alpha, double beta, double delta)
Generates a new variate from the Fréchet distribution with parameters alpha, &#160;beta and.
double getDelta()
Returns the parameter .
double getAlpha()
Returns the parameter .
void setParams(double alpha, double beta, double delta)
Sets the parameters , and of this object.
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,...