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

This class provides tools to plot the density and the cumulative probability of a continuous probability distribution. More...

Collaboration diagram for ContinuousDistChart:
[legend]

Public Member Functions

 ContinuousDistChart (ContinuousDistribution dist, double a, double b, int m)
 Constructor for a new ContinuousDistChart instance. More...
 
JFrame viewCdf (int width, int height)
 Displays a chart of the cumulative distribution function (cdf) on the screen using Swing. More...
 
JFrame viewDensity (int width, int height)
 Similar to viewCdf, but for the probability density instead of the cdf. More...
 
String toLatexCdf (int width, int height)
 Exports a chart of the cdf to a LaTeX source code using PGF/TikZ. More...
 
String toLatexDensity (int width, int height)
 Similar to toLatexCdf, but for the probability density instead of the cdf. More...
 
void setParam (double a, double b, int m)
 Sets the parameters \(a\), \(b\) and \(m\) for this object. More...
 

Protected Attributes

ContinuousDistribution dist
 
double a
 
int m
 
XYLineChart cdfChart
 
XYLineChart densityChart
 

Package Attributes

double b
 

Detailed Description

This class provides tools to plot the density and the cumulative probability of a continuous probability distribution.

Constructor & Destructor Documentation

◆ ContinuousDistChart()

ContinuousDistChart ( ContinuousDistribution  dist,
double  a,
double  b,
int  m 
)

Constructor for a new ContinuousDistChart instance.

It will plot the continuous distribution dist over the interval \([a,b]\), using \(m+1\) equidistant sample points.

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

Member Function Documentation

◆ setParam()

void setParam ( double  a,
double  b,
int  m 
)

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

Parameters
alower bound of interval
bupper bound of interval
mnumber of points in the plot minus one

◆ toLatexCdf()

String toLatexCdf ( int  width,
int  height 
)

Exports a chart of the cdf 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

◆ toLatexDensity()

String toLatexDensity ( int  width,
int  height 
)

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

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

◆ viewCdf()

JFrame viewCdf ( int  width,
int  height 
)

Displays a chart of the cumulative distribution function (cdf) 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
Returns
frame containing the chart

◆ viewDensity()

JFrame viewDensity ( int  width,
int  height 
)

Similar to viewCdf, but for the probability density instead of the cdf.

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: