|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--jsc.swt.plot2d.PlotPanel
|
+--jsc.swt.plot2d.AxesPlot
|
+--jsc.swt.plot2d.FunctionPlot2D
|
+--jsc.swt.plot2d.CdfPlot
This class represents the plot of a cumulative distribution function (often simply called the distribution function). Methods are provided for adding any number of curves representing continuous or discrete distributions. Curves representing sample distribution functions and confidence bands can also be added to the plot.
The addStepFunction() method adds the curve of a general step function f(x) to the plot.
This plot is ideal for graphically representing a Kolmogorov type goodness-of-fit test.
| Field Summary |
| Fields inherited from class jsc.swt.plot2d.AxesPlot |
horizontalAxis, title, verticalAxis |
| Fields inherited from class jsc.swt.plot2d.PlotPanel |
componentBounds, hints, objects, SEE_THRU, virtualSpace, vt |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
CdfPlot(String title,
AxisModel X)
Creates the plot with given title and X Axis object. |
|
CdfPlot(String title,
AxisModel X,
AxisModel Y)
Creates the plot with given title and Axis objects. |
|
| Method Summary | |
PlotObject |
addCdf(Distribution F,
double xMin,
double xMax,
int n,
Color colour,
Stroke stroke)
Add the curve of cdf(x) of a continuous distribution to the plot. |
PlotObject |
addCdf(Distribution F,
int xMin,
int xMax,
Color colour,
Stroke stroke)
Add the curve of cdf(x) of a discrete distribution to the plot. |
PlotObject[] |
addConfidenceBand(ConfidenceBand band,
Color colour,
Stroke stroke)
Add curves representing a confidence band to the plot. |
PlotObject |
addSampleDistributionFunction(SampleDistributionFunction sdf,
Color colour,
Stroke stroke)
Add the curve of a sample distribution function to the plot. |
PlotObject |
addStepFunction(double[] x,
double[] f,
boolean extendSteps,
Color colour,
Stroke stroke)
Add the curve of a step function f(x) to the plot. |
Object |
clone()
Clone the plot object. |
double |
getOrdinate(double x)
Returns y = f(x). |
| Methods inherited from class jsc.swt.plot2d.FunctionPlot2D |
addFunction, addFunction, addFunction, addFunction, addFunction, addFunction |
| Methods inherited from class jsc.swt.plot2d.AxesPlot |
addVerticalLine, addVerticalLine, copy, getHorizontalAxis, getTitle, getVerticalAxis, outsideAxes, paintComponent, rescaleHorizontal, rescaleVertical, setClipping, setPaintXaxis, setPaintYaxis, setTitle |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public CdfPlot(String title,
AxisModel X)
title - the title of the plot.X - the horizontal axis.
public CdfPlot(String title,
AxisModel X,
AxisModel Y)
title - the title of the plot.X - the horizontal axis.Y - the vertical axis.| Method Detail |
public PlotObject addCdf(Distribution F,
double xMin,
double xMax,
int n,
Color colour,
Stroke stroke)
Redraws the plot. Returns the PlotObject that was added to the plot.
F - a continuous distribution.xMin - the minimum x value.xMax - the maximum x value.n - the number of points used to draw the curve.colour - the colour of the curve.stroke - the stroke style of the curve.
public PlotObject addCdf(Distribution F,
int xMin,
int xMax,
Color colour,
Stroke stroke)
Redraws the plot. Returns the PlotObject that was added to the plot.
F - a continuous distribution.xMin - the minimum x value.xMax - the maximum x value.colour - the colour of the curve.stroke - the stroke style of the curve.
public PlotObject[] addConfidenceBand(ConfidenceBand band,
Color colour,
Stroke stroke)
Redraws the plot. Returns a PlotObject 2-element array referring to the two objects that were added to the plot: elements [0] and [1] refer to the lower and upper limit curves respectively.
band - the confidence band.colour - the colour of the curve.stroke - the stroke style of the curve.
public PlotObject addSampleDistributionFunction(SampleDistributionFunction sdf,
Color colour,
Stroke stroke)
Redraws the plot. Returns the PlotObject that was added to the plot.
sdf - the sample distribution function.colour - the colour of the curve.stroke - the stroke style of the curve.
public PlotObject addStepFunction(double[] x,
double[] f,
boolean extendSteps,
Color colour,
Stroke stroke)
If extendSteps is true, a further vertical straight line is drawn from the first point to y = 0, and a further horizontal straight line is drawn from the last point to the maximum of the X-axis.
Redraws the plot. Returns the PlotObject that was added to the plot.
x - the ordered array of x values.f - the corresponding array of f(x) values.extendSteps - if true, first and last points are extended.colour - the colour of the curve.stroke - the stroke style of the curve.
public Object clone()
AxesPlot
clone in class AxesPlotpublic double getOrdinate(double x)
PlotFunctionDouble.NaN if f(x)
cannot be calculated at x.
getOrdinate in interface PlotFunctionx - the value of x.
Double.NaN if f(x) does not exist.
|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||