**'joptima.ChiSquaredFitter'**Java class

joptima

## Class ChiSquaredFitter

- java.lang.Object
- joptima.Fitter
- joptima.ChiSquaredFitter

- All Implemented Interfaces:
- Function, Minimizable

public class ChiSquaredFitterextends Fitter

χ² fitter. This class can be passed to a

`Minimizer`

to minimize χ² of a sum of one or more functions fit to the given data set. Error bars may be provided for the data points if the data has compounded errors that are Gaussian. sqrt(y) errors are assumed otherwise. For different likelihood functions you can extend the`calculate()`

method on this class.A typical usage of this class would go as follows:

// The data points. double[] x = new double[]{ 1, 2, 3, 4, 5}; double[] y = new double[]{1.1, 4.0, 8.7, 15.4, 26}; // The

`Function`

to fit to the data points. Function f = new Quadratic(); ChiSquaredFitter fitter = new ChiSquaredFitter(); fitter.setData(x, y); fitter.addFunction(f); Minimizer.minimize(fitter); // At this point, if the fit converged, the`Function`

f will have // its`Parameter`

s set to the optimal values.

**Warning:**You cannot see the full API documentation of this class since the access to the DatMelt documentation for third-party Java classes is denied. Guests can only view jhplot Java API. To view the complete description of this class and its methods, please request the full DataMelt membership.

If you are already a full member, please login to the DataMelt member area before visiting this documentation.