Package xal.extension.fit
Class PolyLeastsquares
java.lang.Object
xal.extension.fit.PolyLeastsquares
- Author:
- jdg This is taken from M. Abdallah & J. Wang, U. Md., 1999 LEAST SQUARES ANALYSIS This program will input a series of m 2-D points and create a best fit polynomial equation. The governing equation is of the form: y = co + c1*x + ... + ck*x^k The system of equations becomes: Y= A*C The least square normal equation looks like: A'AC = AY; where, C = (c0, c1, ..., ck)' The least squares result is computed through the normal equation: A'*A*C = A*Y; where the equation is represented by AC=Y. and : (dX, dY)- coordinate arrays for data points m- int for number of data points k- int for order of poly equation mC- Matrix for the constant coefficients of equation dR- correlation coefficient getValue(dx)- returns value of y coordinate from equation Correlation()- returns the correlation coefficient as a String Equation()- returns the characteristic equation as a String
-
Constructor Details
-
PolyLeastsquares
constructor- Throws:
PolyLeastsquaresException
-
-
Method Details
-
getValue
public double getValue(double dX) Calculate the predicted y value for an inputed x -
correlation
Find the correlation coefficient for the fit -
equation
Return the characteristic equation as a String
-