Class EF


public class EF extends ErrorCalculationMethod
Methods for calculating the model efficiency See D. Wallach, Working with Dynamic Crop Models, p. 22
Author:
Gunther Krauss
  • Field Summary

    Fields inherited from class ErrorCalculationMethod

    count, sum
  • Constructor Summary

    Constructors
    Constructor
    Description
    EF()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addDataPair(double observed, double calculated)
    Adds a pair of observed and calculated values.
     
     
    double
    Calculates the measure from the added pairs.
    double
    Returns the value that is considered worst by the error calculation method (the start value when searching the best value).
    void
    Resets the accumulated data for a new calculation.
    boolean
    isBetter(double better, double worse)
    Checks if the first value is better than the second one with respect to the calculation method (e.g.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EF

      public EF()
  • Method Details

    • init

      public void init()
      Description copied from class: ErrorCalculationMethod
      Resets the accumulated data for a new calculation.
      Overrides:
      init in class ErrorCalculationMethod
    • getWorstValue

      public double getWorstValue()
      Description copied from class: ErrorCalculationMethod
      Returns the value that is considered worst by the error calculation method (the start value when searching the best value).
      Overrides:
      getWorstValue in class ErrorCalculationMethod
      Returns:
      the worst value, Double.MAX_VALUE by default
    • addDataPair

      public void addDataPair(double observed, double calculated)
      Description copied from class: ErrorCalculationMethod
      Adds a pair of observed and calculated values.
      Specified by:
      addDataPair in class ErrorCalculationMethod
      Parameters:
      observed - the observed (measured) value
      calculated - the calculated (simulated) value
    • getValue

      public double getValue()
      Description copied from class: ErrorCalculationMethod
      Calculates the measure from the added pairs.
      Specified by:
      getValue in class ErrorCalculationMethod
      Returns:
      the value of the measure (the worst value if no pairs were added)
    • isBetter

      public boolean isBetter(double better, double worse)
      Description copied from class: ErrorCalculationMethod
      Checks if the first value is better than the second one with respect to the calculation method (e.g. smaller for errors, closer to 1 for model efficiency).
      Specified by:
      isBetter in class ErrorCalculationMethod
      Parameters:
      better - the value that is checked to be better
      worse - the value to compare with
      Returns:
      true if the first value is better than the second
    • getLabel

      public String getLabel()
      Specified by:
      getLabel in class ErrorCalculationMethod
      Returns:
      the label (abbreviation) of the calculation method, e.g. RMSE
    • getDescription

      public String getDescription()
      Overrides:
      getDescription in class ErrorCalculationMethod
      Returns:
      the full name or a short description of the method (empty by default)