SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
ExponentialInverseFromDensityGen.java
1/*
2 * Class: ExponentialInverseFromDensityGen
3 * Description: exponential random variate generators using numerical
4 inversion of the exponential density
5 * Environment: Java
6 * Software: SSJ
7 * Copyright (C) 2001 Pierre L'Ecuyer and Universite de Montreal
8 * Organization: DIRO, Universite de Montreal
9 * @author Richard Simard
10 * @since
11 *
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *
25 */
26package umontreal.ssj.randvar;
27
28import umontreal.ssj.rng.*;
29import umontreal.ssj.probdist.*;
30
48
57 public ExponentialInverseFromDensityGen(RandomStream stream, double lambda, double ueps, int order) {
58 // dist is the exponential distribution
59 super(stream, lambda);
60 double xc = Math.min(1.0, 0.5 / lambda);
61
62 // Member (ExponentialDist) dist is replaced by
63 // (InverseDistFromDensity) dist
64 dist = new InverseDistFromDensity((ContinuousDistribution) dist, xc, ueps, order);
65 }
66
70 public ExponentialInverseFromDensityGen(RandomStream stream, ExponentialDist dist, double ueps, int order) {
71 super(stream, dist);
72 double xc = Math.min(1.0, 0.5 / lambda);
73
74 // Member (ExponentialDist) dist is replaced by
75 // (InverseDistFromDensity) dist
76 this.dist = new InverseDistFromDensity(dist, xc, ueps, order);
77 }
78
91 super(stream, null);
92 lambda = -1; // don't know its explicit value; it is inside dist
93 this.dist = dist;
94 }
95
99 public double getUepsilon() {
100 return ((InverseDistFromDensity) dist).getEpsilon();
101 }
102
106 public int getOrder() {
107 return ((InverseDistFromDensity) dist).getOrder();
108 }
109}
Classes implementing continuous distributions should inherit from this base class.
Extends the class ContinuousDistribution for the exponential distribution tjoh95a  (page 494) with me...
Implements a method for computing the inverse of an arbitrary continuous distribution function when o...
ExponentialGen(RandomStream s, double lambda)
Creates an exponential random variate generator with parameter.
ExponentialInverseFromDensityGen(RandomStream stream, double lambda, double ueps, int order)
Creates an exponential random variate generator with parameter.
ExponentialInverseFromDensityGen(RandomStream stream, InverseDistFromDensity dist)
Creates a new exponential generator using the exponential distribution dist and stream stream.
ExponentialInverseFromDensityGen(RandomStream stream, ExponentialDist dist, double ueps, int order)
Similar to the above constructor, with the exponential distribution dist.
int getOrder()
Returns the order of the interpolating polynomial.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...