This class provides tools to plot the mass function and the cumulative probability of a discrete probability distribution over the integers. More...
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. | |
| 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]\). | |
| 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 | viewCdf (int width, int height) |
| Similar to method viewCdf above. | |
| JFrame | viewProb (int width, int height, int a, int b) |
| Displays a chart of the probability mass function over the interval. | |
| JFrame | viewProb (int width, int height) |
| Similar to method viewProb above. | |
| 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) |
| Similar to toLatexCdf, but for the probability instead of the cdf. | |
| XYLineChart | getCdf () |
| Returns the chart of the cdf. | |
| XYLineChart | getProb () |
| Returns the chart of the probability. | |
This class provides tools to plot the mass function and the cumulative probability of a discrete probability distribution over the integers.
Definition at line 38 of file DiscreteDistIntChart.java.
| umontreal.ssj.charts.DiscreteDistIntChart.DiscreteDistIntChart | ( | DiscreteDistributionInt | dist | ) |
Constructor for a new DiscreteDistIntChart instance used to plot the probabilities of the discrete distribution dist over the integers.
| dist | discrete distribution to plot |
Definition at line 50 of file DiscreteDistIntChart.java.
| umontreal.ssj.charts.DiscreteDistIntChart.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]\).
| dist | continuous distribution to plot |
| a | lower bound of interval |
| b | upper bound of interval |
Definition at line 65 of file DiscreteDistIntChart.java.
| XYLineChart umontreal.ssj.charts.DiscreteDistIntChart.getCdf | ( | ) |
Returns the chart of the cdf.
Definition at line 240 of file DiscreteDistIntChart.java.
| XYLineChart umontreal.ssj.charts.DiscreteDistIntChart.getProb | ( | ) |
Returns the chart of the probability.
Definition at line 249 of file DiscreteDistIntChart.java.
| void umontreal.ssj.charts.DiscreteDistIntChart.setParam | ( | int | a, |
| int | b ) |
Sets the parameters \(a\) and \(b\) for this object.
| a | lower bound of interval |
| b | upper bound of interval |
Definition at line 198 of file DiscreteDistIntChart.java.
| String umontreal.ssj.charts.DiscreteDistIntChart.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.
| width | Chart’s width in centimeters |
| height | Chart’s height in centimeters |
Definition at line 218 of file DiscreteDistIntChart.java.
| String umontreal.ssj.charts.DiscreteDistIntChart.toLatexProb | ( | int | width, |
| int | height ) |
Similar to toLatexCdf, but for the probability instead of the cdf.
| width | Chart’s width in centimeters |
| height | Chart’s height in centimeters |
Definition at line 230 of file DiscreteDistIntChart.java.
| JFrame umontreal.ssj.charts.DiscreteDistIntChart.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.
| width | frame width in pixels |
| height | frame height in pixels |
Definition at line 154 of file DiscreteDistIntChart.java.
| JFrame umontreal.ssj.charts.DiscreteDistIntChart.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.
| width | frame width in pixels. |
| height | frame height in pixels. |
| a | lower bound of interval |
| b | upper bound of interval |
Definition at line 139 of file DiscreteDistIntChart.java.
| JFrame umontreal.ssj.charts.DiscreteDistIntChart.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.
| width | frame width in pixels. |
| height | frame height in pixels. |
Definition at line 187 of file DiscreteDistIntChart.java.
| JFrame umontreal.ssj.charts.DiscreteDistIntChart.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.
| width | frame width in pixels. |
| height | frame height in pixels. |
| a | lower bound of interval |
| b | upper bound of interval |
Definition at line 172 of file DiscreteDistIntChart.java.