SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.charts.PPPlot Class Reference

Provides PP-plot (probability-probability plot) objects that compare two probability distributions. More...

Inheritance diagram for umontreal.ssj.charts.PPPlot:
umontreal.ssj.charts.XYLineChart umontreal.ssj.charts.XYChart

Public Member Functions

 PPPlot (String title, String XLabel, String YLabel, ContinuousDistribution dist, double[] X)
 Initializes a new PPPlot instance using the points X.
 PPPlot (String title, String XLabel, String YLabel, ContinuousDistribution dist, double[] X, int numPoints)
 Similar to the constructor PPPlot(title, XLabel, YLabel, dist, X) above, except that only the first numPoints of X are plotted.
 PPPlot (String title, String XLabel, String YLabel, ContinuousDistribution dist, double[][] data, int r)
 Initializes a new PPPlot instance.
Public Member Functions inherited from umontreal.ssj.charts.XYLineChart
 XYLineChart ()
 Initializes a new XYLineChart instance with an empty data set.
 XYLineChart (String title, String XLabel, String YLabel, double[][]... data)
 Initializes a new XYLineChart instance with sets of points data.
 XYLineChart (String title, String XLabel, String YLabel, double[][] data, int numPoints)
 Initializes a new XYLineChart instance with sets of points data.
 XYLineChart (String title, String XLabel, String YLabel, double[][] data, int x, int y)
 Initializes a new XYLineChart instance using subsets of data.
 XYLineChart (String title, String XLabel, String YLabel, DoubleArrayList... data)
 Initializes a new XYLineChart instance with data data.
 XYLineChart (String title, String XLabel, String YLabel, XYSeriesCollection data)
 Initializes a new XYLineChart instance with data data.
int add (double[] x, double[] y, String name, String plotStyle)
 Adds a data series into the series collection.
int add (double[] x, double[] y)
 Adds a data series into the series collection.
int add (double[] x, double[] y, int numPoints)
 Adds a data series into the series collection.
int add (double[][] data)
 Adds the new collection of data series data into the series collection.
int add (double[][] data, int numPoints)
 Adds the new collection of data series data into the series collection.
XYListSeriesCollection getSeriesCollection ()
 Returns the chart’s dataset.
void setSeriesCollection (XYListSeriesCollection dataset)
 Links a new dataset to the current chart.
void setTicksSynchro (int s)
 Synchronizes \(X\)-axis ticks to the \(s\)-th series.
JFrame view (int width, int height)
 Displays chart on the screen using Swing.
JFrame viewBar (int width, int height)
 Displays bar chart on the screen using Swing.
String toLatex (double width, double height)
 Exports the chart to a LaTeX source code using PGF/TikZ.
Public Member Functions inherited from umontreal.ssj.charts.XYChart
JFreeChart getJFreeChart ()
 Returns the JFreeChart object associated with this chart.
Axis getXAxis ()
 Returns the chart’s domain axis ( \(x\)-axis) object.
Axis getYAxis ()
 Returns the chart’s range axis ( \(y\)-axis) object.
String getTitle ()
 Gets the current chart title.
void setTitle (String title)
 Sets a title to this chart.
void setprobFlag (boolean flag)
 Must be set true when plotting probabilities, false otherwise.
void setAutoRange ()
 The \(x\) and the \(y\) ranges of the chart are set automatically.
void setAutoRange (boolean right, boolean top)
 The \(x\) and the \(y\) ranges of the chart are set automatically.
void setAutoRange00 (boolean xZero, boolean yZero)
 The \(x\) and the \(y\) ranges of the chart are set automatically.
void setManualRange (double[] range)
 Sets the \(x\) and \(y\) ranges of the chart using the format: range = [xmin, xmax, ymin, ymax].
void setManualRange (double[] range, boolean right, boolean top)
 Sets the \(x\) and \(y\) ranges of the chart using the format: range = [xmin, xmax, ymin, ymax].
void setManualRange00 (double[] range, boolean xZero, boolean yZero)
 Sets the \(x\) and \(y\) ranges of the chart using the format: range = [xmin, xmax, ymin, ymax].
double getChartMargin ()
 Returns the chart margin, which is the fraction by which the chart is enlarged on its borders.
void setChartMargin (double margin)
 Sets the chart margin to margin.
void drawVerticalLine (double x, String name, double yfrac, boolean right)
 Draws a vertical line on the chart at \(x\)-coordinate x.
void enableGrid (double xstep, double ystep)
 Puts a grid on the background.
void disableGrid ()
 Disables the background grid.
void toLatexFile (String fileName, double width, double height)
 Transforms the chart to LaTeX form and writes it in file fileName.
void setLatexDocFlag (boolean flag)
 Flag to remove the \documentclass (and other) commands in the created LaTeX files.

Additional Inherited Members

Detailed Description

Provides PP-plot (probability-probability plot) objects that compare two probability distributions.

The data is given as a list of \(x\)-coordinates \((x_1, x_2, …, x_n)\), and one is given a reference continuous probability distribution \(F(x)\). One first sorts the \(x_i\) in ascending order, then noted \(x_{(i)}\), and plots the points \((i/n, F(x_{(i)}))\), \(i= 1, 2, ..., n\), to see if the data \(x_i\) comes from the reference distribution \(F(x)\). The graph of the straight line \(y=x\) is also plotted for comparison.

Definition at line 42 of file PPPlot.java.

Constructor & Destructor Documentation

◆ PPPlot() [1/3]

umontreal.ssj.charts.PPPlot.PPPlot ( String title,
String XLabel,
String YLabel,
ContinuousDistribution dist,
double[] X )

Initializes a new PPPlot instance using the points X.

title is a title, XLabel is a short description of the \(x\)-axis, and YLabel a short description of the \(y\)-axis. The plot is a PP-plot of the points \((i/n, F(x_{(i)})\), \(i= 1, 2, …, n\), where \(x_i = \) X[ \(i\)-1], \(x_{(i)}\) are the sorted points, and \(F(x) = \) dist.cdf( \(x\)). The points X are not sorted.

Parameters
titlechart title.
XLabelLabel on \(x\)-axis.
YLabelLabel on \(y\)-axis.
distReference distribution
Xpoints.

Definition at line 81 of file PPPlot.java.

◆ PPPlot() [2/3]

umontreal.ssj.charts.PPPlot.PPPlot ( String title,
String XLabel,
String YLabel,
ContinuousDistribution dist,
double[] X,
int numPoints )

Similar to the constructor PPPlot(title, XLabel, YLabel, dist, X) above, except that only the first numPoints of X are plotted.

Parameters
titlechart title.
XLabelLabel on \(x\)-axis.
YLabelLabel on \(y\)-axis.
distReference distribution
Xpoint set.
numPointsnumber of points to plot

Definition at line 98 of file PPPlot.java.

◆ PPPlot() [3/3]

umontreal.ssj.charts.PPPlot.PPPlot ( String title,
String XLabel,
String YLabel,
ContinuousDistribution dist,
double data[][],
int r )

Initializes a new PPPlot instance.

title is a title, XLabel is a short description of the \(x\)-axis, and YLabel a short description of the \(y\)-axis. The input vectors in data represents several sets of \(x\)-points. \(r\) determine the set of points to be plotted in the PP-plot, that is, one will plot only the points data[r][i], for \(i=0, 1, …, (n-1)\) and a given

\(r\), where \(n\) is the number of points in set \(r\). The points are assumed to follow the distribution dist.

Parameters
titlechart title.
XLabelLabel on \(x\)-axis.
YLabelLabel on \(y\)-axis.
distReference distribution
dataseries of point sets.
rset of points to plot

Definition at line 125 of file PPPlot.java.


The documentation for this class was generated from the following file: