datan

## Class LsqPol

- java.lang.Object
- - datan.LsqPol

-     public final class LsqPol
      extends java.lang.Object

  A class porforming the least-squares fit of a polynomial to a set of data.
  Author:
    Siegmund Brandt.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LsqPol(DatanVector t, DatanVector y, DatanVector deltay, int r)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getChiSquare()`
    `DatanMatrix` | `getCovarianceMatrix()`
    `DatanVector` | `getResult()`
    `boolean` | `hasConverged()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LsqPol

          public LsqPol(DatanVector t,
                DatanVector y,
                DatanVector deltay,
                int r)

      Parameters:
        `t` - vector of controlled variables
        `y` - vector of the corresponding measured values.
        `deltay` - vector of measurement errors.
        `r` - number of unknowns (=1 for polynomial of order 0, =2 for order 1, etc.).

  - ### Method Detail

    - #### getResult

          public DatanVector getResult()

      Returns:
        the vector of fitted polynomial coefficients.

    - #### getCovarianceMatrix

          public DatanMatrix getCovarianceMatrix()

      Returns:
        the covariance matrix of the polynomial coefficients.

    - #### getChiSquare

          public double getChiSquare()

      Returns:
        the value of the minimum function.

    - #### hasConverged

          public boolean hasConverged()

      Returns:
        true if iteration successful, false otherwise.