Class LinearFitter

java.lang.Object
nz.org.riskscape.defaults.curves.LinearFitter
All Implemented Interfaces:
CurveFitter<double[]>, nz.org.riskscape.engine.Identified

public class LinearFitter extends Object implements CurveFitter<double[]>

Fits a linear 'curve' to the data.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    nz.org.riskscape.engine.bind.JavaParameterSet<LinearFitter.Params>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    nz.org.riskscape.problem.ResultOrProblems<double[]>
    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.
    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 that bind returns and fit accepts.
    nz.org.riskscape.engine.function.UntypedFunction
    getFunction(double[] coefficients)
     
     
    nz.org.riskscape.engine.bind.JavaParameterSet<LinearFitter.Params>
    The parameters for this fitter

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

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

    getIdentifiedClass
  • Field Details

    • parameters

      public nz.org.riskscape.engine.bind.JavaParameterSet<LinearFitter.Params> parameters
  • Constructor Details

    • LinearFitter

      public LinearFitter()
  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in interface nz.org.riskscape.engine.Identified
    • getBindingClass

      public Class<double[]> getBindingClass()
      Description copied from interface: CurveFitter

      The type that bind returns and fit accepts.

      Specified by:
      getBindingClass in interface CurveFitter<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: CurveFitter

      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.

      Specified by:
      bind in interface CurveFitter<double[]>
    • fit

      public FitCurve<double[]> fit(double[] startParams, ObservedPoints points)
      Description copied from interface: CurveFitter

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

      Specified by:
      fit in interface CurveFitter<double[]>
    • getFunction

      public nz.org.riskscape.engine.function.UntypedFunction getFunction(double[] coefficients)
    • getParameters

      public nz.org.riskscape.engine.bind.JavaParameterSet<LinearFitter.Params> getParameters()
      Description copied from interface: CurveFitter

      The parameters for this fitter

      Specified by:
      getParameters in interface CurveFitter<double[]>