SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
NormalInverseFromDensityGen.java
1/*
2 * Class: NormalInverseFromDensityGen
3 * Description: random variate generators using numerical inversion of
4 the normal 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
46
56 public NormalInverseFromDensityGen(RandomStream stream, double mu, double sigma, double ueps, int order) {
57 // dist is the normal distribution
58 super(stream, mu, sigma);
59 double xc = mu;
60
61 // member (NormalDist) dist is replaced by
62 // (InverseDistFromDensity) dist
63 dist = new InverseDistFromDensity((ContinuousDistribution) dist, xc, ueps, order);
64 }
65
69 public NormalInverseFromDensityGen(RandomStream stream, NormalDist dist, double ueps, int order) {
70 super(stream, dist);
71 double xc = mu;
72
73 // member (NormalDist) dist is replaced by
74 // (InverseDistFromDensity) dist
75 this.dist = new InverseDistFromDensity(dist, xc, ueps, order);
76 }
77
91 super(stream, null);
92 mu = dist.getXc();
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.
Implements a method for computing the inverse of an arbitrary continuous distribution function when o...
Extends the class ContinuousDistribution for the normal distribution (e.g., tjoh95a  (page 80)).
NormalGen(RandomStream s, double mu, double sigma)
Creates a normal random variate generator with mean mu and standard deviation sigma,...
NormalInverseFromDensityGen(RandomStream stream, NormalDist dist, double ueps, int order)
Similar to the first constructor, with the normal distribution dist.
int getOrder()
Returns the order of the interpolating polynomial.
NormalInverseFromDensityGen(RandomStream stream, InverseDistFromDensity dist)
Creates a new normal generator using the normal distribution dist and stream stream.
NormalInverseFromDensityGen(RandomStream stream, double mu, double sigma, double ueps, int order)
Creates a normal random variate generator with parameters.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...