edu.rit.numeric
Class XYSeries
- java.lang.Object
-
- edu.rit.numeric.XYSeries
-
- Direct Known Subclasses:
- AggregateXYSeries, ArrayXYSeries, ListXYSeries, SampledXYSeries, TransformedXYSeries
public abstract class XYSeries extends java.lang.ObjectClass XYSeries is the abstract base class for a series of (x,y) pairs of real values (type double).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classXYSeries.RegressionClass XYSeries.Regression holds the results of a regression on an XYSeries.
-
Constructor Summary
Constructors Constructor and Description XYSeries()Construct a new XY series.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description booleanisEmpty()Determine if this series is empty.abstract intlength()Returns the number of values in this series.XYSeries.RegressionlinearRegression()Returns the linear regression of the (x,y) values in this XY series.doublemaxX()Returns the maximum X value in this series.doublemaxY()Returns the maximum Y value in this series.doubleminX()Returns the minimum X value in this series.doubleminY()Returns the minimum Y value in this series.voidprint()Print this XY series on the standard output.voidprint(java.io.PrintStream theStream)Print this XY series on the given print stream.voidprint(java.io.PrintWriter theWriter)Print this XY series on the given print writer.abstract doublex(int i)Returns the given X value in this series.SeriesxSeries()Returns a Series view of the X values in this XY series.abstract doubley(int i)Returns the given Y value in this series.SeriesySeries()Returns a Series view of the Y values in this XY series.
-
-
-
Method Detail
-
length
public abstract int length()
Returns the number of values in this series.- Returns:
- Length.
-
isEmpty
public boolean isEmpty()
Determine if this series is empty.- Returns:
- True if this series is empty (length = 0), false otherwise.
-
x
public abstract double x(int i)
Returns the given X value in this series.- Parameters:
i- Index.- Returns:
- The X value in this series at index i.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- (unchecked exception) Thrown if i is not in the range 0 .. length()-1.
-
y
public abstract double y(int i)
Returns the given Y value in this series.- Parameters:
i- Index.- Returns:
- The Y value in this series at index i.
- Throws:
java.lang.ArrayIndexOutOfBoundsException- (unchecked exception) Thrown if i is not in the range 0 .. length()-1.
-
minX
public double minX()
Returns the minimum X value in this series.- Returns:
- Minimum X value.
-
maxX
public double maxX()
Returns the maximum X value in this series.- Returns:
- Maximum X value.
-
minY
public double minY()
Returns the minimum Y value in this series.- Returns:
- Minimum Y value.
-
maxY
public double maxY()
Returns the maximum Y value in this series.- Returns:
- Maximum Y value.
-
linearRegression
public XYSeries.Regression linearRegression()
Returns the linear regression of the (x,y) values in this XY series. The linear function y = a + bx is fitted to the data. The return value is a Regression object containing the intercept a, the slope b, and the correlation, respectively.Note: The returned object contains the regression of a snapshot of this series at the time linearRegression() was called. Changing the data in this series will not change the contents of the returned object.
- Returns:
- Regression.
-
xSeries
public Series xSeries()
Returns a Series view of the X values in this XY series.Note: The returned Series object is backed by this XY series object. Changing the contents of this XY series object will change the contents of the returned Series object.
- Returns:
- Series of X values.
-
ySeries
public Series ySeries()
Returns a Series view of the Y values in this XY series.Note: The returned Series object is backed by this XY series object. Changing the contents of this XY series object will change the contents of the returned Series object.
- Returns:
- Series of Y values.
-
print
public void print()
Print this XY series on the standard output. Each line of output consists of the index, the x value, and the y value, separated by tabs.
-
print
public void print(java.io.PrintStream theStream)
Print this XY series on the given print stream. Each line of output consists of the index, the x value, and the y value, separated by tabs.- Parameters:
theStream- Print stream.
-
print
public void print(java.io.PrintWriter theWriter)
Print this XY series on the given print writer. Each line of output consists of the index, the x value, and the y value, separated by tabs.- Parameters:
theWriter- Print writer.
-
-
DMelt 3.0 © DataMelt by jWork.ORG