1 /* 2 * PolynomialFit.java 3 * 4 * Created on March 20, 2006, 3:40 PM 5 * 6 * 7 */ 8 9 package org.lcsim.fit.polynomial; 10 11 import Jama.Matrix; 12 13 /** 14 * Encapsulates the behavior of a least-squares polynomial fit to 15 * two-dimensional data points. 16 * @author Norman A. Graf 17 * @version 1.0 18 */ 19 public class PolynomialFit 20 { 21 private Matrix _parameters; 22 private Matrix _covariance; 23 /** 24 * Creates a new instance of PolynomialFit 25 * @param p The vector of fit parameters. 26 * @param c The covariance matrix of the fit parameters. 27 */ 28 public PolynomialFit(Matrix p, Matrix c) 29 { 30 _parameters = p; 31 _covariance = c; 32 } 33 34 /** 35 * Return the fit parameters. 36 * @return The vector of fit parameters as a (nX1) Matrix 37 */ 38 public Matrix parameters() 39 { 40 return _parameters; 41 } 42 43 /** 44 * Return the covariance matrix 45 * @return The covariance matrix as an (nxn) Matrix. 46 */ 47 public Matrix covariance() 48 { 49 return _covariance; 50 } 51 52 }