Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 88C5B178CA for ; Sat, 18 Oct 2014 20:12:21 +0000 (UTC) Received: (qmail 52748 invoked by uid 500); 18 Oct 2014 20:12:21 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 52670 invoked by uid 500); 18 Oct 2014 20:12:21 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 52660 invoked by uid 99); 18 Oct 2014 20:12:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Oct 2014 20:12:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Oct 2014 20:12:16 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id EA4ED2388C9D for ; Sat, 18 Oct 2014 20:10:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r926176 [29/31] - in /websites/production/commons/content/proper/commons-math: apidocs/org/apache/commons/math3/analysis/interpolation/ apidocs/org/apache/commons/math3/analysis/interpolation/class-use/ apidocs/org/apache/commons/math3/dist... Date: Sat, 18 Oct 2014 20:10:40 -0000 To: commits@commons.apache.org From: luc@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20141018201048.EA4ED2388C9D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/LaplaceDistribution.html ============================================================================== --- websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/LaplaceDistribution.html (added) +++ websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/LaplaceDistribution.html Sat Oct 18 20:10:38 2014 @@ -0,0 +1,166 @@ + + + +LaplaceDistribution xref + + + +
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one or more
+3    * contributor license agreements.  See the NOTICE file distributed with
+4    * this work for additional information regarding copyright ownership.
+5    * The ASF licenses this file to You under the Apache License, Version 2.0
+6    * (the "License"); you may not use this file except in compliance with
+7    * the License.  You may obtain a copy of the License at
+8    *
+9    *      http://www.apache.org/licenses/LICENSE-2.0
+10   *
+11   * Unless required by applicable law or agreed to in writing, software
+12   * distributed under the License is distributed on an "AS IS" BASIS,
+13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+14   * See the License for the specific language governing permissions and
+15   * limitations under the License.
+16   */
+17  package org.apache.commons.math3.distribution;
+18  
+19  import org.apache.commons.math3.exception.NotStrictlyPositiveException;
+20  import org.apache.commons.math3.exception.OutOfRangeException;
+21  import org.apache.commons.math3.exception.util.LocalizedFormats;
+22  import org.apache.commons.math3.random.RandomGenerator;
+23  import org.apache.commons.math3.random.Well19937c;
+24  import org.apache.commons.math3.util.FastMath;
+25  
+26  /**
+27   * This class implements the Laplace distribution.
+28   *
+29   * @see <a href="http://en.wikipedia.org/wiki/Laplace_distribution">Laplace distribution (Wikipedia)</a>
+30   *
+31   * @since 3.4
+32   */
+33  public class LaplaceDistribution extends AbstractRealDistribution {
+34  
+35      /** Serializable version identifier. */
+36      private static final long serialVersionUID = 20141003;
+37  
+38      /** The location parameter. */
+39      private final double mu;
+40      /** The scale parameter. */
+41      private final double beta;
+42  
+43      /**
+44       * Build a new instance.
+45       *
+46       * @param mu location parameter
+47       * @param beta scale parameter (must be positive)
+48       * @throws NotStrictlyPositiveException if {@code beta <= 0}
+49       */
+50      public LaplaceDistribution(double mu, double beta) {
+51          this(new Well19937c(), mu, beta);
+52      }
+53  
+54      /**
+55       * Build a new instance.
+56       *
+57       * @param rng Random number generator
+58       * @param mu location parameter
+59       * @param beta scale parameter (must be positive)
+60       * @throws NotStrictlyPositiveException if {@code beta <= 0}
+61       */
+62      public LaplaceDistribution(RandomGenerator rng, double mu, double beta) {
+63          super(rng);
+64  
+65          if (beta <= 0.0) {
+66              throw new NotStrictlyPositiveException(LocalizedFormats.NOT_POSITIVE_SCALE, beta);
+67          }
+68  
+69          this.mu = mu;
+70          this.beta = beta;
+71      }
+72  
+73      /**
+74       * Access the location parameter, {@code mu}.
+75       *
+76       * @return the location parameter.
+77       */
+78      public double getLocation() {
+79          return mu;
+80      }
+81  
+82      /**
+83       * Access the scale parameter, {@code beta}.
+84       *
+85       * @return the scale parameter.
+86       */
+87      public double getScale() {
+88          return beta;
+89      }
+90  
+91      /** {@inheritDoc} */
+92      public double density(double x) {
+93          return FastMath.exp(-FastMath.abs(x - mu) / beta) / (2.0 * beta);
+94      }
+95  
+96      /** {@inheritDoc} */
+97      public double cumulativeProbability(double x) {
+98          if (x <= mu) {
+99              return FastMath.exp((x - mu) / beta) / 2.0;
+100         } else {
+101             return 1.0 - FastMath.exp((mu - x) / beta) / 2.0;
+102         }
+103     }
+104 
+105     @Override
+106     public double inverseCumulativeProbability(double p) throws OutOfRangeException {
+107         if (p < 0.0 || p > 1.0) {
+108             throw new OutOfRangeException(p, 0.0, 1.0);
+109         } else if (p == 0) {
+110             return 0.0;
+111         } else if (p == 1) {
+112             return Double.POSITIVE_INFINITY;
+113         }
+114         double x = (p > 0.5) ? -Math.log(2.0 - 2.0 * p) : Math.log(2.0 * p);
+115         return mu + beta * x;
+116     }
+117 
+118     /** {@inheritDoc} */
+119     public double getNumericalMean() {
+120         return mu;
+121     }
+122 
+123     /** {@inheritDoc} */
+124     public double getNumericalVariance() {
+125         return 2.0 * beta * beta;
+126     }
+127 
+128     /** {@inheritDoc} */
+129     public double getSupportLowerBound() {
+130         return Double.NEGATIVE_INFINITY;
+131     }
+132 
+133     /** {@inheritDoc} */
+134     public double getSupportUpperBound() {
+135         return Double.POSITIVE_INFINITY;
+136     }
+137 
+138     /** {@inheritDoc} */
+139     public boolean isSupportLowerBoundInclusive() {
+140         return false;
+141     }
+142 
+143     /** {@inheritDoc} */
+144     public boolean isSupportUpperBoundInclusive() {
+145         return false;
+146     }
+147 
+148     /** {@inheritDoc} */
+149     public boolean isSupportConnected() {
+150         return true;
+151     }
+152 
+153 }
+
+
+ + + Propchange: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/LaplaceDistribution.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/LaplaceDistribution.html ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/LogisticDistribution.html ============================================================================== --- websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/LogisticDistribution.html (added) +++ websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/LogisticDistribution.html Sat Oct 18 20:10:38 2014 @@ -0,0 +1,166 @@ + + + +LogisticDistribution xref + + + +
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one or more
+3    * contributor license agreements.  See the NOTICE file distributed with
+4    * this work for additional information regarding copyright ownership.
+5    * The ASF licenses this file to You under the Apache License, Version 2.0
+6    * (the "License"); you may not use this file except in compliance with
+7    * the License.  You may obtain a copy of the License at
+8    *
+9    *      http://www.apache.org/licenses/LICENSE-2.0
+10   *
+11   * Unless required by applicable law or agreed to in writing, software
+12   * distributed under the License is distributed on an "AS IS" BASIS,
+13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+14   * See the License for the specific language governing permissions and
+15   * limitations under the License.
+16   */
+17  package org.apache.commons.math3.distribution;
+18  
+19  import org.apache.commons.math3.exception.NotStrictlyPositiveException;
+20  import org.apache.commons.math3.exception.OutOfRangeException;
+21  import org.apache.commons.math3.exception.util.LocalizedFormats;
+22  import org.apache.commons.math3.random.RandomGenerator;
+23  import org.apache.commons.math3.random.Well19937c;
+24  import org.apache.commons.math3.util.FastMath;
+25  import org.apache.commons.math3.util.MathUtils;
+26  
+27  /**
+28   * This class implements the Logistic distribution.
+29   *
+30   * @see <a href="http://en.wikipedia.org/wiki/Logistic_distribution">Logistic Distribution (Wikipedia)</a>
+31   * @see <a href="http://mathworld.wolfram.com/LogisticDistribution.html">Logistic Distribution (Mathworld)</a>
+32   *
+33   * @since 3.4
+34   */
+35  public class LogisticDistribution extends AbstractRealDistribution {
+36  
+37      /** Serializable version identifier. */
+38      private static final long serialVersionUID = 20141003;
+39  
+40      /** The location parameter. */
+41      private final double mu;
+42      /** The scale parameter. */
+43      private final double s;
+44  
+45      /**
+46       * Build a new instance.
+47       *
+48       * @param mu location parameter
+49       * @param s scale parameter (must be positive)
+50       * @throws NotStrictlyPositiveException if {@code beta <= 0}
+51       */
+52      public LogisticDistribution(double mu, double s) {
+53          this(new Well19937c(), mu, s);
+54      }
+55  
+56      /**
+57       * Build a new instance.
+58       *
+59       * @param rng Random number generator
+60       * @param mu location parameter
+61       * @param s scale parameter (must be positive)
+62       * @throws NotStrictlyPositiveException if {@code beta <= 0}
+63       */
+64      public LogisticDistribution(RandomGenerator rng, double mu, double s) {
+65          super(rng);
+66  
+67          if (s <= 0.0) {
+68              throw new NotStrictlyPositiveException(LocalizedFormats.NOT_POSITIVE_SCALE, s);
+69          }
+70  
+71          this.mu = mu;
+72          this.s = s;
+73      }
+74  
+75      /**
+76       * Access the location parameter, {@code mu}.
+77       *
+78       * @return the location parameter.
+79       */
+80      public double getLocation() {
+81          return mu;
+82      }
+83  
+84      /**
+85       * Access the scale parameter, {@code s}.
+86       *
+87       * @return the scale parameter.
+88       */
+89      public double getScale() {
+90          return s;
+91      }
+92  
+93      /** {@inheritDoc} */
+94      public double density(double x) {
+95          double z = (x - mu) / s;
+96          double v = FastMath.exp(-z);
+97          return 1 / s * v / ((1.0 + v) * (1.0 + v));
+98      }
+99  
+100     /** {@inheritDoc} */
+101     public double cumulativeProbability(double x) {
+102         double z = 1 / s * (x - mu);
+103         return 1.0 / (1.0 + FastMath.exp(-z));
+104     }
+105 
+106     @Override
+107     public double inverseCumulativeProbability(double p) throws OutOfRangeException {
+108         if (p < 0.0 || p > 1.0) {
+109             throw new OutOfRangeException(p, 0.0, 1.0);
+110         } else if (p == 0) {
+111             return 0.0;
+112         } else if (p == 1) {
+113             return Double.POSITIVE_INFINITY;
+114         }
+115         return s * Math.log(p / (1.0 - p)) + mu;
+116     }
+117 
+118     /** {@inheritDoc} */
+119     public double getNumericalMean() {
+120         return mu;
+121     }
+122 
+123     /** {@inheritDoc} */
+124     public double getNumericalVariance() {
+125         return (MathUtils.PI_SQUARED / 3.0) * (1.0 / (s * s));
+126     }
+127 
+128     /** {@inheritDoc} */
+129     public double getSupportLowerBound() {
+130         return Double.NEGATIVE_INFINITY;
+131     }
+132 
+133     /** {@inheritDoc} */
+134     public double getSupportUpperBound() {
+135         return Double.POSITIVE_INFINITY;
+136     }
+137 
+138     /** {@inheritDoc} */
+139     public boolean isSupportLowerBoundInclusive() {
+140         return false;
+141     }
+142 
+143     /** {@inheritDoc} */
+144     public boolean isSupportUpperBoundInclusive() {
+145         return false;
+146     }
+147 
+148     /** {@inheritDoc} */
+149     public boolean isSupportConnected() {
+150         return true;
+151     }
+152 
+153 }
+
+
+ + + Propchange: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/LogisticDistribution.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/LogisticDistribution.html ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/NakagamiDistribution.html ============================================================================== --- websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/NakagamiDistribution.html (added) +++ websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/NakagamiDistribution.html Sat Oct 18 20:10:38 2014 @@ -0,0 +1,187 @@ + + + +NakagamiDistribution xref + + + +
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one or more
+3    * contributor license agreements.  See the NOTICE file distributed with
+4    * this work for additional information regarding copyright ownership.
+5    * The ASF licenses this file to You under the Apache License, Version 2.0
+6    * (the "License"); you may not use this file except in compliance with
+7    * the License.  You may obtain a copy of the License at
+8    *
+9    *      http://www.apache.org/licenses/LICENSE-2.0
+10   *
+11   * Unless required by applicable law or agreed to in writing, software
+12   * distributed under the License is distributed on an "AS IS" BASIS,
+13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+14   * See the License for the specific language governing permissions and
+15   * limitations under the License.
+16   */
+17  package org.apache.commons.math3.distribution;
+18  
+19  import org.apache.commons.math3.exception.NotStrictlyPositiveException;
+20  import org.apache.commons.math3.exception.NumberIsTooSmallException;
+21  import org.apache.commons.math3.exception.util.LocalizedFormats;
+22  import org.apache.commons.math3.random.RandomGenerator;
+23  import org.apache.commons.math3.random.Well19937c;
+24  import org.apache.commons.math3.special.Gamma;
+25  import org.apache.commons.math3.util.FastMath;
+26  
+27  /**
+28   * This class implements the Nakagami distribution.
+29   *
+30   * @see <a href="http://en.wikipedia.org/wiki/Nakagami_distribution">Nakagami Distribution (Wikipedia)</a>
+31   *
+32   * @since 3.4
+33   */
+34  public class NakagamiDistribution extends AbstractRealDistribution {
+35  
+36      /** Default inverse cumulative probability accuracy. */
+37      public static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY = 1e-9;
+38  
+39      /** Serializable version identifier. */
+40      private static final long serialVersionUID = 20141003;
+41  
+42      /** The shape parameter. */
+43      private final double mu;
+44      /** The scale parameter. */
+45      private final double omega;
+46      /** Inverse cumulative probability accuracy. */
+47      private final double inverseAbsoluteAccuracy;
+48  
+49      /**
+50       * Build a new instance.
+51       *
+52       * @param mu shape parameter
+53       * @param omega scale parameter (must be positive)
+54       * @throws NumberIsTooSmallException if {@code mu < 0.5}
+55       * @throws NotStrictlyPositiveException if {@code omega <= 0}
+56       */
+57      public NakagamiDistribution(double mu, double omega) {
+58          this(mu, omega, DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
+59      }
+60  
+61      /**
+62       * Build a new instance.
+63       *
+64       * @param mu shape parameter
+65       * @param omega scale parameter (must be positive)
+66       * @param inverseAbsoluteAccuracy the maximum absolute error in inverse
+67       * cumulative probability estimates (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY}).
+68       * @throws NumberIsTooSmallException if {@code mu < 0.5}
+69       * @throws NotStrictlyPositiveException if {@code omega <= 0}
+70       */
+71      public NakagamiDistribution(double mu, double omega, double inverseAbsoluteAccuracy) {
+72          this(new Well19937c(), mu, omega, inverseAbsoluteAccuracy);
+73      }
+74  
+75      /**
+76       * Build a new instance.
+77       *
+78       * @param rng Random number generator
+79       * @param mu shape parameter
+80       * @param omega scale parameter (must be positive)
+81       * @param inverseAbsoluteAccuracy the maximum absolute error in inverse
+82       * cumulative probability estimates (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY}).
+83       * @throws NumberIsTooSmallException if {@code mu < 0.5}
+84       * @throws NotStrictlyPositiveException if {@code omega <= 0}
+85       */
+86      public NakagamiDistribution(RandomGenerator rng, double mu, double omega, double inverseAbsoluteAccuracy) {
+87          super(rng);
+88  
+89          if (mu < 0.5) {
+90              throw new NumberIsTooSmallException(mu, 0.5, true);
+91          }
+92          if (omega <= 0) {
+93              throw new NotStrictlyPositiveException(LocalizedFormats.NOT_POSITIVE_SCALE, omega);
+94          }
+95  
+96          this.mu = mu;
+97          this.omega = omega;
+98          this.inverseAbsoluteAccuracy = inverseAbsoluteAccuracy;
+99      }
+100 
+101     /**
+102      * Access the shape parameter, {@code mu}.
+103      *
+104      * @return the shape parameter.
+105      */
+106     public double getShape() {
+107         return mu;
+108     }
+109 
+110     /**
+111      * Access the scale parameter, {@code omega}.
+112      *
+113      * @return the scale parameter.
+114      */
+115     public double getScale() {
+116         return omega;
+117     }
+118 
+119     @Override
+120     protected double getSolverAbsoluteAccuracy() {
+121         return inverseAbsoluteAccuracy;
+122     }
+123 
+124     /** {@inheritDoc} */
+125     public double density(double x) {
+126         if (x <= 0) {
+127             return 0.0;
+128         }
+129         return 2.0 * FastMath.pow(mu, mu) / (Gamma.gamma(mu) * FastMath.pow(omega, mu)) *
+130                      FastMath.pow(x, 2 * mu - 1) * FastMath.exp(-mu * x * x / omega);
+131     }
+132 
+133     /** {@inheritDoc} */
+134     public double cumulativeProbability(double x) {
+135         return Gamma.regularizedGammaP(mu, mu * x * x / omega);
+136     }
+137 
+138     /** {@inheritDoc} */
+139     public double getNumericalMean() {
+140         return Gamma.gamma(mu + 0.5) / Gamma.gamma(mu) * FastMath.sqrt(omega / mu);
+141     }
+142 
+143     /** {@inheritDoc} */
+144     public double getNumericalVariance() {
+145         double v = Gamma.gamma(mu + 0.5) / Gamma.gamma(mu);
+146         return omega * (1 - 1 / mu * v * v);
+147     }
+148 
+149     /** {@inheritDoc} */
+150     public double getSupportLowerBound() {
+151         return 0;
+152     }
+153 
+154     /** {@inheritDoc} */
+155     public double getSupportUpperBound() {
+156         return Double.POSITIVE_INFINITY;
+157     }
+158 
+159     /** {@inheritDoc} */
+160     public boolean isSupportLowerBoundInclusive() {
+161         return true;
+162     }
+163 
+164     /** {@inheritDoc} */
+165     public boolean isSupportUpperBoundInclusive() {
+166         return false;
+167     }
+168 
+169     /** {@inheritDoc} */
+170     public boolean isSupportConnected() {
+171         return true;
+172     }
+173 
+174 }
+
+
+ + + Propchange: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/NakagamiDistribution.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/distribution/NakagamiDistribution.html ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/fitting/leastsquares/EvaluationRmsChecker.html ============================================================================== --- websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/fitting/leastsquares/EvaluationRmsChecker.html (added) +++ websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/fitting/leastsquares/EvaluationRmsChecker.html Sat Oct 18 20:10:38 2014 @@ -0,0 +1,88 @@ + + + +EvaluationRmsChecker xref + + + +
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one or more
+3    * contributor license agreements.  See the NOTICE file distributed with
+4    * this work for additional information regarding copyright ownership.
+5    * The ASF licenses this file to You under the Apache License, Version 2.0
+6    * (the "License"); you may not use this file except in compliance with
+7    * the License.  You may obtain a copy of the License at
+8    *
+9    *      http://www.apache.org/licenses/LICENSE-2.0
+10   *
+11   * Unless required by applicable law or agreed to in writing, software
+12   * distributed under the License is distributed on an "AS IS" BASIS,
+13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+14   * See the License for the specific language governing permissions and
+15   * limitations under the License.
+16   */
+17  package org.apache.commons.math3.fitting.leastsquares;
+18  
+19  import org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation;
+20  import org.apache.commons.math3.optim.ConvergenceChecker;
+21  import org.apache.commons.math3.util.Precision;
+22  
+23  /**
+24   * Check if an optimization has converged based on the change in computed RMS.
+25   *
+26   * @since 3.4
+27   */
+28  public class EvaluationRmsChecker implements ConvergenceChecker<Evaluation> {
+29  
+30      /** relative tolerance for comparisons. */
+31      private final double relTol;
+32      /** absolute tolerance for comparisons. */
+33      private final double absTol;
+34  
+35      /**
+36       * Create a convergence checker for the RMS with the same relative and absolute
+37       * tolerance.
+38       *
+39       * <p>Convenience constructor for when the relative and absolute tolerances are the
+40       * same. Same as {@code new EvaluationRmsChecker(tol, tol)}.
+41       *
+42       * @param tol the relative and absolute tolerance.
+43       * @see #EvaluationRmsChecker(double, double)
+44       */
+45      public EvaluationRmsChecker(final double tol) {
+46          this(tol, tol);
+47      }
+48  
+49      /**
+50       * Create a convergence checker for the RMS with a relative and absolute tolerance.
+51       *
+52       * <p>The optimization has converged when the RMS of consecutive evaluations are equal
+53       * to within the given relative tolerance or absolute tolerance.
+54       *
+55       * @param relTol the relative tolerance.
+56       * @param absTol the absolute tolerance.
+57       * @see Precision#equals(double, double, double)
+58       * @see Precision#equalsWithRelativeTolerance(double, double, double)
+59       */
+60      public EvaluationRmsChecker(final double relTol, final double absTol) {
+61          this.relTol = relTol;
+62          this.absTol = absTol;
+63      }
+64  
+65      /** {@inheritDoc} */
+66      public boolean converged(final int iteration,
+67                               final Evaluation previous,
+68                               final Evaluation current) {
+69          final double prevRms = previous.getRMS();
+70          final double currRms = current.getRMS();
+71          return Precision.equals(prevRms, currRms, this.absTol) ||
+72                  Precision.equalsWithRelativeTolerance(prevRms, currRms, this.relTol);
+73      }
+74  
+75  }
+
+
+ + + Propchange: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/fitting/leastsquares/EvaluationRmsChecker.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/fitting/leastsquares/EvaluationRmsChecker.html ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/fitting/leastsquares/ValueAndJacobianFunction.html ============================================================================== --- websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/fitting/leastsquares/ValueAndJacobianFunction.html (added) +++ websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/fitting/leastsquares/ValueAndJacobianFunction.html Sat Oct 18 20:10:38 2014 @@ -0,0 +1,57 @@ + + + +ValueAndJacobianFunction xref + + + +
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one or more
+3    * contributor license agreements.  See the NOTICE file distributed with
+4    * this work for additional information regarding copyright ownership.
+5    * The ASF licenses this file to You under the Apache License, Version 2.0
+6    * (the "License"); you may not use this file except in compliance with
+7    * the License.  You may obtain a copy of the License at
+8    *
+9    *      http://www.apache.org/licenses/LICENSE-2.0
+10   *
+11   * Unless required by applicable law or agreed to in writing, software
+12   * distributed under the License is distributed on an "AS IS" BASIS,
+13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+14   * See the License for the specific language governing permissions and
+15   * limitations under the License.
+16   */
+17  package org.apache.commons.math3.fitting.leastsquares;
+18  
+19  import org.apache.commons.math3.linear.RealMatrix;
+20  import org.apache.commons.math3.linear.RealVector;
+21  
+22  /**
+23   * A interface for functions that compute a vector of values and can compute their
+24   * derivatives (Jacobian).
+25   *
+26   * @since 3.3
+27   */
+28  public interface ValueAndJacobianFunction extends MultivariateJacobianFunction {
+29      /**
+30       * Compute the value.
+31       *
+32       * @param params Point.
+33       * @return the value at the given point.
+34       */
+35      RealVector computeValue(final double[] params);
+36  
+37      /**
+38       * Compute the Jacobian.
+39       *
+40       * @param params Point.
+41       * @return the Jacobian at the given point.
+42       */
+43      RealMatrix computeJacobian(final double[] params);
+44  }
+
+
+ + + Propchange: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/fitting/leastsquares/ValueAndJacobianFunction.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: websites/production/commons/content/proper/commons-math/xref/org/apache/commons/math3/fitting/leastsquares/ValueAndJacobianFunction.html ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision