Interface CurveFitter<T>

Record Components:
T - the type of object returned from bind.

TODO remove the generics from here as they help more than hinder. Collections of generic things like the curve fitter that have different types really upset Java's generics and results in a lot of raw types to make things compile. We can always add a TypeSafeCurveFitter base class to improve things

All Superinterfaces:
nz.org.riskscape.engine.Identified
All Known Implementing Classes:
ContinuousLinearFitter, LinearFitter, PowerLawFitter

public interface CurveFitter<T> extends nz.org.riskscape.engine.Identified

Interface for some code that can fit a function to a set of 2d data points

  • Method Summary

    Modifier and Type
    Method
    Description
    nz.org.riskscape.problem.ResultOrProblems<T>
    bind(nz.org.riskscape.engine.bind.BindingContext context, Map<String,List<?>> unbound)
    Bind any curve fitting parameters in to an object that is used for the fit function.
    static <T> double
    Compute the r2 value of a FitCurve https://en.wikipedia.org/wiki/Coefficientofdetermination
    fit(T parameters, ObservedPoints points)
    Attempt to fit the given points to this curve/function, using the given start parameters.
    The type that bind returns and fit accepts.
    nz.org.riskscape.engine.bind.ParameterSet
    The parameters for this fitter

    Methods inherited from interface nz.org.riskscape.engine.Identified

    getId, getIdentifiedClass
  • Method Details

    • computeRSquared

      static <T> double computeRSquared(FitCurve<T> curve)

      Compute the r2 value of a FitCurve https://en.wikipedia.org/wiki/Coefficientofdetermination

    • getParameters

      nz.org.riskscape.engine.bind.ParameterSet getParameters()

      The parameters for this fitter

    • bind

      nz.org.riskscape.problem.ResultOrProblems<T> bind(nz.org.riskscape.engine.bind.BindingContext context, Map<String,List<?>> unbound)

      Bind 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.

    • getBindingClass

      Class<T> getBindingClass()

      The type that bind returns and fit accepts.

    • fit

      FitCurve<T> fit(T parameters, ObservedPoints points)

      Attempt to fit the given points to this curve/function, using the given start parameters.