Package nz.org.riskscape.defaults.curves
Class LinearFitter
java.lang.Object
nz.org.riskscape.defaults.curves.LinearFitter
- All Implemented Interfaces:
CurveFitter<double[]>,nz.org.riskscape.engine.Identified
Fits a linear 'curve' to the data.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionnz.org.riskscape.engine.bind.JavaParameterSet<LinearFitter.Params> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnz.org.riskscape.problem.ResultOrProblems<double[]>Bind any curve fitting parameters in to an object that is used for the fit function.FitCurve<double[]>fit(double[] startParams, ObservedPoints points) Attempt to fit the given points to this curve/function, using the given start parameters.Class<double[]>The type thatbindreturns andfitaccepts.nz.org.riskscape.engine.function.UntypedFunctiongetFunction(double[] coefficients) getId()nz.org.riskscape.engine.bind.JavaParameterSet<LinearFitter.Params>The parameters for this fitterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nz.org.riskscape.engine.Identified
getIdentifiedClass
-
Field Details
-
parameters
-
-
Constructor Details
-
LinearFitter
public LinearFitter()
-
-
Method Details
-
getId
- Specified by:
getIdin interfacenz.org.riskscape.engine.Identified
-
getBindingClass
Description copied from interface:CurveFitterThe type that
bindreturns andfitaccepts.- Specified by:
getBindingClassin interfaceCurveFitter<double[]>
-
bind
public nz.org.riskscape.problem.ResultOrProblems<double[]> bind(nz.org.riskscape.engine.bind.BindingContext context, Map<String, List<?>> unbound) Description copied from interface:CurveFitterBind any curve fitting parameters in to an object that is used for the fit function. This is done in this way (as opposed to passing in unbound to fit or even bound parameters) to allow each curve fitter to do any parameter binding and up-front computation once and then use this for many fits.
- Specified by:
bindin interfaceCurveFitter<double[]>
-
fit
Description copied from interface:CurveFitterAttempt to fit the given points to this curve/function, using the given start parameters.
- Specified by:
fitin interfaceCurveFitter<double[]>
-
getFunction
public nz.org.riskscape.engine.function.UntypedFunction getFunction(double[] coefficients) -
getParameters
Description copied from interface:CurveFitterThe parameters for this fitter
- Specified by:
getParametersin interfaceCurveFitter<double[]>
-