Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.charts
Class DiscreteDistIntChart

    java.lang.Object
      umontreal.iro.lecuyer.charts.DiscreteDistIntChart

    public class DiscreteDistIntChart

extends Object

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

Constructor Summary
`DiscreteDistIntChart(DiscreteDistributionInt dist)` Constructor for a new `DiscreteDistIntChart` instance used to plot the probabilities of the discrete distribution `dist` over the integers.
`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].

Method Summary
`XYLineChart` | `getCdf()` Returns the chart of the cdf.
`XYLineChart` | `getProb()` Returns the chart of the probability.
`void` | `setParam(int a, int b)` Sets the parameters a and b for this object.
`String` | `toLatexCdf(int width, int height)` Exports a chart of the cumulative probability to a LATEX source code using PGF/TikZ.
`String` | `toLatexProb(int width, int height)` Exports a chart of the probability mass to a LATEX source code using PGF/TikZ.
`JFrame` | `viewCdf(int width, int height)` Displays a chart of the cumulative distribution function (cdf) on the screen using Swing.
`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.
`JFrame` | `viewProb(int width, int height)` Displays a chart of the probability mass function on the screen using Swing.
`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.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DiscreteDistIntChart

    public DiscreteDistIntChart(DiscreteDistributionInt dist)

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

  Parameters:
    `dist` - discrete distribution to plot

### DiscreteDistIntChart

    public 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:
    `dist` - continuous distribution to plot
    `a` - lower bound of interval
    `b` - upper bound of interval

Method Detail

### viewCdf

    public JFrame viewCdf(int width,
                          int height)

  Displays a chart of the cumulative distribution function (cdf) on the screen using Swing. If the bounds are not defined, they will be automatically set to [μ -3σ, μ +3σ], where μ and σ are the mean and the variance of the distribution. 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.

  Parameters:
    `width` - frame width in pixels
    `height` - frame height in pixels
  Returns:
    frame containing the chart

### viewCdf

    public 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:
    `width` - frame width in pixels.
    `height` - frame height in pixels.
    `a` - lower bound of interval
    `b` - upper bound of interval
  Returns:
    frame containing the chart

### viewProb

    public JFrame viewProb(int width,
                           int height)

  Displays a chart of the probability mass function on the screen using Swing. If the bounds are not defined, they will be automatically set to [μ -3σ, μ +3σ], where μ and σ are the mean and the variance of the distribution. 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:
    `width` - frame width in pixels.
    `height` - frame height in pixels.
  Returns:
    frame containing the chart

### viewProb

    public 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:
    `width` - frame width in pixels.
    `height` - frame height in pixels.
    `a` - lower bound of interval
    `b` - upper bound of interval
  Returns:
    frame containing the chart

### toLatexCdf

    public 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:
    `width` - Chart's width in centimeters
    `height` - Chart's height in centimeters
  Returns:
    LaTeX source code

### toLatexProb

    public String toLatexProb(int width,
                              int height)

  Exports a chart of the probability mass 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:
    `width` - Chart's width in centimeters
    `height` - Chart's height in centimeters
  Returns:
    LaTeX source code

### setParam

    public void setParam(int a,
                         int b)

  Sets the parameters a and b for this object.

  Parameters:
    `a` - lower bound of interval
    `b` - upper bound of interval

### getCdf

    public XYLineChart getCdf()

  Returns the chart of the cdf.

  Returns:
    the chart of the cdf.

### getProb

    public XYLineChart getProb()

  Returns the chart of the probability.

  Returns:
    the chart of the probability.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.