public class LinearFitter extends Object implements Fitter
| Constructor and Description |
|---|
LinearFitter(Function funct) |
| Modifier and Type | Method and Description |
|---|---|
double |
calculateDerivative(int k,
double[] x)
Given a set of parameters, and inputs, calculates the derivative
of the k'th parameter
d/d a_k (F)
The function is linear in parameters eg:
f(x) = params[0]* f0(x) + params[1]*f1(x) + ...
|
void |
calculateDerivatives()
Creates an array of derivatives since each one is used 3x's
|
double |
calculateErrors()
returns the cumulative error for current values
|
void |
createAlphaMatrix() |
void |
createBetaMatrix() |
void |
fitData()
Main routine, call this and the Parameters are iterated one time because
the equations are assumed to be linear in parameter space.
|
double[][] |
getCovarianceMatrix() |
double[] |
getParameters()
Gets the current set of parameters values.
|
double[] |
getUncertainty()
Get an uncertainty value, similar to the way gnuplot does it.
|
void |
initializeWorkspace() |
void |
iterateValues()
Takes the current error, and the current parameter set and calculates the
changes, then returns the maximum changed value
|
void |
printMatrix() |
void |
setData(double[][] xvalues,
double[] zvalues)
Sets the values of of the original data points that are going to be fit.
|
void |
setParameters(double[] parameters) |
public LinearFitter(Function funct)
public void setData(double[][] xvalues,
double[] zvalues)
public void setParameters(double[] parameters)
setParameters in interface Fitterpublic double calculateErrors()
calculateErrors in interface Fitterpublic double calculateDerivative(int k,
double[] x)
k - - index of the parameter that the derivative is being taken ofx - - set of values to use.public void calculateDerivatives()
public void createBetaMatrix()
public void createAlphaMatrix()
public void iterateValues()
public void printMatrix()
public void initializeWorkspace()
public void fitData()
public double[] getParameters()
getParameters in interface Fitterpublic double[] getUncertainty()
getUncertainty in interface Fitterpublic double[][] getCovarianceMatrix()
Copyright © 2016. All rights reserved.