stella.math
Class LinearExtrapolation

java.lang.Object
  extended by stella.math.Extrapolation
      extended by stella.math.LinearExtrapolation

public class LinearExtrapolation
extends Extrapolation

Uses linear extrapolation to predict STELLA-sensor data.


Field Summary
private static int DEGREE
          The degree of the extrapolation polynom.
 
Fields inherited from class stella.math.Extrapolation
extrapolate, sum, yk, yk2sum
 
Constructor Summary
LinearExtrapolation()
          Constructs a new linear extrapolation object.
LinearExtrapolation(double[] data)
          Constructs a new linear extrapolation object.
 
Method Summary
protected  Polynom calcPolynom()
          Calculates the extrapolating polynom.
 double getChi2()
          Calculates the discrepancy as the sum of the squared residuals.
protected  Polynom updatePolynom()
          Updates the extrapolating polynom assuming that not only the data but also the data sums are correct.
 
Methods inherited from class stella.math.Extrapolation
calcSum, getN, getPolynom, predict, setData, shiftBackward, shiftForward
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEGREE

private static final int DEGREE
The degree of the extrapolation polynom.

See Also:
Constant Field Values
Constructor Detail

LinearExtrapolation

public LinearExtrapolation()
Constructs a new linear extrapolation object. Use Extrapolation.setData(double[]) to set the measurements.


LinearExtrapolation

public LinearExtrapolation(double[] data)
Constructs a new linear extrapolation object. The measurements are immediately set.

Method Detail

calcPolynom

protected Polynom calcPolynom()
Calculates the extrapolating polynom. To calculate the partial sums, the Extrapolation.calcSum(int) method of the abstract parent class is used.

Specified by:
calcPolynom in class Extrapolation

updatePolynom

protected Polynom updatePolynom()
Updates the extrapolating polynom assuming that not only the data but also the data sums are correct. This method can be used if a speed-up calculation of the sums was possible.

Specified by:
updatePolynom in class Extrapolation

getChi2

public double getChi2()
Calculates the discrepancy as the sum of the squared residuals.

Specified by:
getChi2 in class Extrapolation
Returns:
-1. if invalid.