bijnum
Class BIJfit

java.lang.Object
  |
  +--bijnum.BIJfit

public class BIJfit
extends java.lang.Object

This class implements useful linear and polynomial regression from Press, Flannery, Teukolsky, Vetterling, Numerical Recipes in C 2nd ed, Cambridge University Press, 1986 Copyright implementation (c) 1999-2004, Michael Abramoff. All rights reserved.


Constructor Summary
BIJfit()
           
 
Method Summary
static double[] linear(float[] x, float[] y)
          Given a line with points x, y, fit a line y = a1 + a2x through them with linear least squares regression.
static double[] poly(float[] x, float[] y)
          Given a line with points x, y, fit a line y = bx + a through them with linear least squares regression.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BIJfit

public BIJfit()
Method Detail

linear

public static double[] linear(float[] x,
                              float[] y)
Given a line with points x, y, fit a line y = a1 + a2x through them with linear least squares regression.
Parameters:
x - a float array with x values.
y - a float array with y values.
Returns:
fit, a double[4] with fit[0] = a1, fit[1] = a2, fit[2] = var(a1), fit[3] = var(a2), where var(a) = STDEV(a)^2.

poly

public static double[] poly(float[] x,
                            float[] y)
Given a line with points x, y, fit a line y = bx + a through them with linear least squares regression.
Parameters:
x - a float array with x values.
y - a float array with y values.
Returns:
fit, a double[4] with fit[0] = a, fit[1] = b, fit[2] = var(a), fit[3] = var(b), where var(a) = STDEV(a)^2.