Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-165

Simplify use of "EstimationProblem"

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.2
    • None
    • None

    Description

      The use of the "EstimationProblem" interface could be simplified by providing a helper (abstract) class that would implement
      the "getMeasurements" "getAllParameters" and "getUnboundParameters" methods. Currently, each new implementation of the interface has to do it even if they are typically only called from the "Estimator" class (and not by the user code).
      That same helper class could also take care of storing the partial derivatives.

      A skeleton for the requested class could be as follows:

      public abstract class SimpleEstimationProblem
      implements EstimationProblem {

      // ... storage for measurements and partial derivatives ...

      protected void addParameter(EstimatedParameter p,
      ComputableFunction partial,
      boolean isBound)

      { // ... }

      protected void addParameter(EstimatedParameter p,
      ComputableFunction partial)

      { addParameter(p, partial, false); }

      protected double getPartial(EstimatedParameter p,
      double x)

      { // ... }
      protected void addMeasurement(WeightedMeasurement m) { _observations.add(m); }
      public WeightedMeasurement[] getMeasurements() { // ... }

      public EstimatedParameter[] getAllParameters()

      { // ... }
      public EstimatedParameter[] getUnboundParameters() { // ... }

      }

      Best,
      Gilles

      Attachments

        Activity

          People

            luc Luc Maisonobe
            erans Gilles Sadowski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: