public class LeastSquareParameterFitting
extends java.lang.Object
implements java.lang.Runnable
| Modifier and Type | Field and Description |
|---|---|
static DifferentiableVariable |
INDEPENDENT_VARIABLE
independent (sampled) variable (typically "x")
|
| Constructor and Description |
|---|
LeastSquareParameterFitting(DifferentiableOperation model,
BoundedDifferentiableVariable... parameters)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSample(double x,
double y)
Add a data sample without specifying statistical error (either all or none must specify error)
|
void |
addSample(double x,
double y,
double sigma)
Add a data sample including statistical error (either all or none must specify error)
|
void |
clear()
clear samples
|
double |
getFitPenalty()
get the penalty for the best fit found
|
double |
getFitValueForParameter(BoundedDifferentiableVariable parameter)
get the value of the parameter for the best fit found
|
int |
getMaxEvaluations()
get the maximum number of model evaluations for a run
|
void |
run()
run the minimizer to find the best parameter fit for the model to the samples
|
void |
runFor(int evaluations)
set the maximum evaluations and run
|
void |
setMaxEvaluations(int evaluations)
set the maximum number of model evaluations for a run
|
public static final DifferentiableVariable INDEPENDENT_VARIABLE
public LeastSquareParameterFitting(DifferentiableOperation model, BoundedDifferentiableVariable... parameters)
public void addSample(double x,
double y,
double sigma)
x - independent variable valuey - dependent (measured) variable valuesigma - statistical measurement errorpublic void addSample(double x,
double y)
x - independent variable valuey - dependent (measured) variable valuepublic void clear()
public int getMaxEvaluations()
public void setMaxEvaluations(int evaluations)
public void run()
throws java.lang.IllegalStateException
run in interface java.lang.Runnablejava.lang.IllegalStateExceptionpublic void runFor(int evaluations)
public double getFitPenalty()
public double getFitValueForParameter(BoundedDifferentiableVariable parameter)