SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | Protected Attributes | Package Attributes | List of all members
DiscreteDistIntChart Class Reference

This class provides tools to plot the mass function and the cumulative probability of a discrete probability distribution over the integers. More...

Collaboration diagram for DiscreteDistIntChart:
[legend]

Public Member Functions

 DiscreteDistIntChart (DiscreteDistributionInt dist)
 Constructor for a new DiscreteDistIntChart instance used to plot the probabilities of the discrete distribution dist over the integers. More...
 
 DiscreteDistIntChart (DiscreteDistributionInt dist, int a, int b)
 Constructor for a new DiscreteDistIntChart instance used to plot the probabilities of the discrete distribution dist over the interval \([a,b]\). More...
 
JFrame viewCdf (int width, int height, int a, int b)
 Displays a chart of the cumulative distribution function (cdf) over the interval \([a,b]\) on the screen using Swing. More...
 
JFrame viewCdf (int width, int height)
 Similar to method viewCdf above. More...
 
JFrame viewProb (int width, int height, int a, int b)
 Displays a chart of the probability mass function over the interval \([a,b]\) on the screen using Swing. More...
 
JFrame viewProb (int width, int height)
 Similar to method viewProb above. More...
 
void setParam (int a, int b)
 Sets the parameters \(a\) and \(b\) for this object. More...
 
String toLatexCdf (int width, int height)
 Exports a chart of the cumulative probability to a LaTeX source code using PGF/TikZ. More...
 
String toLatexProb (int width, int height)
 Similar to toLatexCdf, but for the probability instead of the cdf. More...
 
XYLineChart getCdf ()
 Returns the chart of the cdf. More...
 
XYLineChart getProb ()
 Returns the chart of the probability. More...
 

Protected Attributes

DiscreteDistributionInt dist
 
int a
 
XYLineChart cdfChart
 
XYLineChart probChart
 

Package Attributes

int b
 

Detailed Description

This class provides tools to plot the mass function and the cumulative probability of a discrete probability distribution over the integers.

Constructor & Destructor Documentation

◆ DiscreteDistIntChart() [1/2]

Constructor for a new DiscreteDistIntChart instance used to plot the probabilities of the discrete distribution dist over the integers.

Parameters
distdiscrete distribution to plot

◆ DiscreteDistIntChart() [2/2]

DiscreteDistIntChart ( DiscreteDistributionInt  dist,
int  a,
int  b 
)

Constructor for a new DiscreteDistIntChart instance used to plot the probabilities of the discrete distribution dist over the interval \([a,b]\).

Parameters
distcontinuous distribution to plot
alower bound of interval
bupper bound of interval

Member Function Documentation

◆ getCdf()

XYLineChart getCdf ( )

Returns the chart of the cdf.

Returns
the chart of the cdf.

◆ getProb()

XYLineChart getProb ( )

Returns the chart of the probability.

Returns
the chart of the probability.

◆ setParam()

void setParam ( int  a,
int  b 
)

Sets the parameters \(a\) and \(b\) for this object.

Parameters
alower bound of interval
bupper bound of interval

◆ toLatexCdf()

String toLatexCdf ( int  width,
int  height 
)

Exports a chart of the cumulative probability to a LaTeX source code using PGF/TikZ.

This method constructs and returns a string that can be written to a LaTeX document to render the plot. width and height represents the width and the height of the produced chart. These dimensions do not take into account the axes and labels extra space. The width and the height of the chart are measured in centimeters.

Parameters
widthChart’s width in centimeters
heightChart’s height in centimeters
Returns
LaTeX source code

◆ toLatexProb()

String toLatexProb ( int  width,
int  height 
)

Similar to toLatexCdf, but for the probability instead of the cdf.

Parameters
widthChart’s width in centimeters
heightChart’s height in centimeters
Returns
LaTeX source code

◆ viewCdf() [1/2]

JFrame viewCdf ( int  width,
int  height,
int  a,
int  b 
)

Displays a chart of the cumulative distribution function (cdf) over the interval \([a,b]\) on the screen using Swing.

This method creates an application containing a chart panel displaying the chart. The created frame is positioned on-screen, and displayed before it is returned. The width and the height of the chart are measured in pixels.

Parameters
widthframe width in pixels.
heightframe height in pixels.
alower bound of interval
bupper bound of interval
Returns
frame containing the chart

◆ viewCdf() [2/2]

JFrame viewCdf ( int  width,
int  height 
)

Similar to method viewCdf above.

If the interval \([a,b]\) for the graph is not defined, it will be set automatically to \([\mu- 3\sigma, \mu+ 3\sigma]\), where \(\mu\) and \(\sigma\) are the mean and the variance of the distribution.

Parameters
widthframe width in pixels
heightframe height in pixels
Returns
frame containing the chart

◆ viewProb() [1/2]

JFrame viewProb ( int  width,
int  height,
int  a,
int  b 
)

Displays a chart of the probability mass function over the interval \([a,b]\) on the screen using Swing.

This method creates an application containing a chart panel displaying the chart. The created frame is positioned on-screen, and displayed before it is returned. The width and the height of the chart are measured in pixels.

Parameters
widthframe width in pixels.
heightframe height in pixels.
alower bound of interval
bupper bound of interval
Returns
frame containing the chart

◆ viewProb() [2/2]

JFrame viewProb ( int  width,
int  height 
)

Similar to method viewProb above.

If the interval \([a,b]\) for the graph is not defined, it will be set automatically to \([\mu- 3\sigma, \mu+ 3\sigma]\), where \(\mu\) and \(\sigma\) are the mean and the variance of the distribution.

Parameters
widthframe width in pixels.
heightframe height in pixels.
Returns
frame containing the chart

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