public class LinearRegressionFitter extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LinearRegressionFitter.REG_METHOD |
| Modifier and Type | Field and Description |
|---|---|
static boolean |
USE_SVD |
| Constructor and Description |
|---|
LinearRegressionFitter() |
| Modifier and Type | Method and Description |
|---|---|
double[][] |
fit(Function func,
double[] xValues,
double[] yValues)
Local linear regression fitter using standard SVD-type or Tikhonov regularisation The linear gradient matrix is
calculated using the provided @param func function template and for the given @param xValues vector.
|
void |
fit(Function func,
Function returnFunction,
double[] xValues,
double[] yValues)
Local linear regression fitter using standard SVD-type or Tikhonov regularisation The linear gradient matrix is
calculated using the provided @param func function template and for the given @param xValues vector.
|
double[] |
getBestEstimates()
Get the best estimates of the unknown parameters.
|
double[] |
getBestEstimatesErrors()
Get the estimates of the standard deviations of the best estimates of the unknown parameters.
|
double |
getChiSquared() |
long |
getLastFitDuration() |
long |
getLastPrepareDuration() |
double |
getParameter(int index)
Value of fitted parameter.
|
double |
getParError(int index)
Error estimate of fitted parameter N.B.
|
LinearRegressionFitter.REG_METHOD |
getRegularisationMethod() |
double |
getSVDCutOff() |
double |
getTikhonovRegularisation()
1/lambda_i -> lambda_i/(lambda_i^2+mu^2) for |1/lambda_i| > 1e-16
1/lambda_i -> 0 (for numerical stability) |
boolean |
isConverged() |
boolean |
isErrorWeighting() |
boolean |
isSilent()
Fitter verbosity (local print-out) is enabled...
|
static void |
main(String[] args) |
void |
setErrorWeighting(boolean state) |
void |
setRegularisationMethod(LinearRegressionFitter.REG_METHOD method)
KStandard: standard SVD-type cut
1/lambda_i -> 1/lambda_i for (|lambda_i/lambda_0| > getSVDCutOff & |1/lambda_i| > 1e-16 1/lambda_i -> 0 otherwise (numerical stability) Tikhonov type regularisation: 1/lambda_i -> lambda_i/(lambda_i^2+mu^2) for |1/lambda_i| > 1e-16 1/lambda_i |
void |
setSVDCutOff(double cutOff)
SVD cut off threshold for ill-conditioned systems, default: 1e-16
|
void |
setTikhonovRegularisation(double cutOff)
Tikhonov regularisation parameter mu, default:
1.0 1/lambda_i -> lambda_i/(lambda_i^2+mu^2) for |1/lambda_i| > 1e-16 1/lambda_i -> 0 (for numerical stability) |
void |
setVerbosity(boolean state)
Fitter verbosity (local print-out) is enabled...
|
public double[][] fit(Function func, double[] xValues, double[] yValues)
func - the prototype function to fit the data toxValues - horizontal data coordinatesyValues - vertical data coordinatespublic void fit(Function func, Function returnFunction, double[] xValues, double[] yValues)
func - the prototype function to fit the data toxValues - horizontal data coordinatesyValues - vertical data coordinatesreturnFunction - copy with the adjusted fitted parameter functionpublic double[] getBestEstimates()
public double[] getBestEstimatesErrors()
public double getChiSquared()
public long getLastFitDuration()
public long getLastPrepareDuration()
public double getParameter(int index)
index - of parameterpublic double getParError(int index)
index - of parameterpublic LinearRegressionFitter.REG_METHOD getRegularisationMethod()
public double getSVDCutOff()
public double getTikhonovRegularisation()
public boolean isConverged()
public boolean isErrorWeighting()
public boolean isSilent()
public void setErrorWeighting(boolean state)
state - true: use errors as fitting weightspublic void setRegularisationMethod(LinearRegressionFitter.REG_METHOD method)
method - regularisation method to be used
the paramater mu can be read set via function getTikhonovRegularisationParameter, or function
setTikhonovRegularisationParameterpublic void setSVDCutOff(double cutOff)
cutOff - minimum eigenvalue cut-offpublic void setTikhonovRegularisation(double cutOff)
cutOff - minimum eigenvalue cutt-offpublic void setVerbosity(boolean state)
state - true <-> 'on', false <-> 'off'public static void main(String[] args)
Copyright © 2020 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.