SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
LoglogisticGen.java
1/*
2 * Class: LoglogisticGen
3 * Description: random variate generators for the log-logistic 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 LoglogisticGen extends RandomVariateGen {
43 protected double alpha;
44 protected double beta;
45
51 public LoglogisticGen(RandomStream s, double alpha, double beta) {
52 super(s, new LoglogisticDist(alpha, beta));
53 setParams(alpha, beta);
54 }
55
60 super(s, dist);
61 if (dist != null)
62 setParams(dist.getAlpha(), dist.getBeta());
63 }
64
69 public static double nextDouble(RandomStream s, double alpha, double beta) {
70 return LoglogisticDist.inverseF(alpha, beta, s.nextDouble());
71 }
72
76 public double getAlpha() {
77 return alpha;
78 }
79
83 public double getBeta() {
84 return beta;
85 }
86
87 protected void setParams(double alpha, double beta) {
88 if (alpha <= 0.0)
89 throw new IllegalArgumentException("alpha <= 0");
90 if (beta <= 0.0)
91 throw new IllegalArgumentException("beta <= 0");
92 this.alpha = alpha;
93 this.beta = beta;
94 }
95}
Extends the class ContinuousDistribution for the Log-Logistic distribution with shape parameter and ...
double inverseF(double u)
Returns the inverse distribution function .
double getBeta()
Returns the parameter of this object.
LoglogisticGen(RandomStream s, double alpha, double beta)
Creates a log-logistic random variate generator with parameters.
double getAlpha()
Returns the parameter of this object.
LoglogisticGen(RandomStream s, LoglogisticDist dist)
Creates a new generator for the distribution dist, using stream s.
static double nextDouble(RandomStream s, double alpha, double beta)
Generates a variate from the log-logistic distribution with shape parameter and scale parameter .
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,...