SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
FisherFGen.java
1/*
2 * Class: FisherFGen
3 * Description: random variate generators for the Fisher F 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
43public class FisherFGen extends RandomVariateGen {
44 protected int n = -1;
45 protected int m = -1;
46
52 public FisherFGen(RandomStream s, int n, int m) {
53 super(s, new FisherFDist(n, m));
54 setParams(n, m);
55 }
56
61 super(s, dist);
62 if (dist != null)
63 setParams(dist.getN1(), dist.getN2());
64 }
65
70 public static double nextDouble(RandomStream s, int n, int m) {
71 return FisherFDist.inverseF(n, m, 15, s.nextDouble());
72 }
73
77 public int getN() {
78 return n;
79 }
80
84 public int getM() {
85 return m;
86 }
87
91 protected void setParams(int n, int m) {
92 if (m <= 0)
93 throw new IllegalArgumentException("m <= 0");
94 if (n <= 0)
95 throw new IllegalArgumentException("n <= 0");
96 this.m = m;
97 this.n = n;
98 }
99}
Extends the class ContinuousDistribution for the Fisher F distribution with and degrees of freedom,...
double inverseF(double u)
Returns the inverse distribution function .
int getM()
Returns the parameter of this object.
FisherFGen(RandomStream s, int n, int m)
Creates a Fisher F random variate generator with and.
FisherFGen(RandomStream s, FisherFDist dist)
Creates a new generator for the distribution dist, using stream s.
int getN()
Returns the parameter of this object.
void setParams(int n, int m)
Sets the parameters and of this object.
static double nextDouble(RandomStream s, int n, int m)
Generates a variate from the Fisher F distribution with and degrees of freedom, using stream s.
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,...