3import umontreal.ssj.rng.*;
5import umontreal.ssj.charts.HistogramChart;
6import umontreal.ssj.probdist.*;
7import umontreal.ssj.randvar.*;
8import umontreal.ssj.stat.*;
25 public double simulate() {
32 for (j = 0; j < N; j++)
33 X += genY.nextDouble();
34 for (j = 0; j < M; j++)
35 X += genW.nextDouble();
40 public void simulateRuns(
int n,
TallyStore statX) {
41 for (
int i = 0; i < n; i++)
42 statX.
add(simulate());
45 public static void main(String[] args)
throws IOException {
49 System.out.println(statX.
report(0.95, 1));
54 System.out.printf(
" 0.10 quantile: %9.1f%n", data[(
int) (0.10 * n)]);
55 System.out.printf(
" 0.50 quantile: %9.1f%n", data[(
int) (0.50 * n)]);
56 System.out.printf(
" 0.90 quantile: %9.1f%n", data[(
int) (0.90 * n)]);
57 System.out.printf(
" 0.99 quantile: %9.1f%n", data[(
int) (0.99 * n)]);
62 double[] bounds = { 0, 4000, 0, 25000 };
68 String histLatex = hist.
toLatex(12.0, 8.0);
69 Writer file =
new FileWriter(
"src/main/docs/examples/tutorial/NonuniformHist.tex");
70 file.write(histLatex);
Provides tools to create and manage histograms.
HistogramSeriesCollection getSeriesCollection()
Returns the chart’s dataset.
JFrame view(int width, int height)
Displays chart on the screen using Swing.
String toLatex(double width, double height)
Exports the chart to a LaTeX source code using PGF/TikZ.
void setManualRange(double[] range)
Sets the and ranges of the chart using the format: range = [xmin, xmax, ymin, ymax].
Extends the class ContinuousDistribution for the gamma distribution tjoh95a (page 337) with shape pa...
Extends the class DiscreteDistributionInt for the geometric distribution slaw00a (page 322) with par...
static int inverseF(double p, double u)
Computes the inverse of the geometric distribution, given by ( FInvgeom ).
Extends the class ContinuousDistribution for the lognormal distribution tjoh95a .
Extends the class DiscreteDistributionInt for the Poisson distribution slaw00a (page 325) with mean.
This class implements gamma random variate generators using a method that combines acceptance-rejecti...
This is the base class for all generators of discrete random variates over the set of integers.
This is the base class for all random variate generators over the real line.
Extends RandomStreamBase using a composite linear feedback shift register (LFSR) (or Tausworthe) RNG ...
This class is a variant of Tally for which the individual observations are stored in a list implement...
void quickSort()
Sorts the elements of this probe using the quicksort from Colt.
double[] getArray()
Returns the observations stored in this probe.
void add(double x)
Adds one observation x to this probe.
String report()
Returns a formatted string that contains a report on this probe.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...