net.aerith.misao.util
Class RegressionEquation

java.lang.Object
  |
  +--net.aerith.misao.util.RegressionEquation

public class RegressionEquation
extends java.lang.Object

The RegressionEquation represents a regression equation:

     y = gradient * x + constant
 


Field Summary
private  double constant
          The constant.
private  int data_count
          The number of (x,y) data to solve the simultaneous equation.
private  double gradient
          The gradient.
private  SimultaneousEquation se
          The simultaneous equation to solve this regression equation.
 
Constructor Summary
RegressionEquation()
          Constructs an empty RegressionEquation.
 
Method Summary
 java.lang.String getOutputString()
          Returns a string representation of the state of this object.
 double getValue(double x)
          Gets y value of the specified x.
 void setData(double x, double y)
          Adds a (x,y) data to solve the simultaneous equation.
 void solve()
          Solves the simultaneous equation and calculates this regression equation in the least square method.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

constant

private double constant
The constant.

gradient

private double gradient
The gradient.

se

private SimultaneousEquation se
The simultaneous equation to solve this regression equation.

data_count

private int data_count
The number of (x,y) data to solve the simultaneous equation.
Constructor Detail

RegressionEquation

public RegressionEquation()
Constructs an empty RegressionEquation.
Method Detail

getValue

public double getValue(double x)
Gets y value of the specified x.
Parameters:
x - the x value.
Returns:
y value of the specified x.

setData

public void setData(double x,
                    double y)
Adds a (x,y) data to solve the simultaneous equation.
Parameters:
x - the x value.
y - the y value.

solve

public void solve()
Solves the simultaneous equation and calculates this regression equation in the least square method.

getOutputString

public java.lang.String getOutputString()
Returns a string representation of the state of this object.
Returns:
a string representation of the state of this object.