• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
18 package org.apache.commons.math.estimation;
19 
20 /**
21  * This interface represents solvers for estimation problems.
22  *
23  * <p>The classes which are devoted to solve estimation problems
24  * should implement this interface. The problems which can be handled
25  * should implement the {@link EstimationProblem} interface which
26  * gather all the information needed by the solver.</p>
27  *
28  * <p>The interface is composed only of the {@link #estimate estimate}
29  * method.</p>
30  *
31  * @see EstimationProblem
32  *
33  * @version $Revision: 811786 $ $Date: 2009-09-06 11:36:08 +0200 (dim. 06 sept. 2009) $
34  * @since 1.2
35  * @deprecated as of 2.0, everything in package org.apache.commons.math.estimation has
36  * been deprecated and replaced by package org.apache.commons.math.optimization.general
37  *
38  */
39 @Deprecated
40 public interface Estimator {
41 
42   /**
43    * Solve an estimation problem.
44    *
45    * <p>The method should set the parameters of the problem to several
46    * trial values until it reaches convergence. If this method returns
47    * normally (i.e. without throwing an exception), then the best
48    * estimate of the parameters can be retrieved from the problem
49    * itself, through the {@link EstimationProblem#getAllParameters
50    * EstimationProblem.getAllParameters} method.</p>
51    *
52    * @param problem estimation problem to solve
53    * @exception EstimationException if the problem cannot be solved
54    *
55    */
estimate(EstimationProblem problem)56   void estimate(EstimationProblem problem) throws EstimationException;
57 
58   /**
59    * Get the Root Mean Square value.
60    * Get the Root Mean Square value, i.e. the root of the arithmetic
61    * mean of the square of all weighted residuals. This is related to the
62    * criterion that is minimized by the estimator as follows: if
63    * <em>c</em> is the criterion, and <em>n</em> is the number of
64    * measurements, then the RMS is <em>sqrt (c/n)</em>.
65    * @see #guessParametersErrors(EstimationProblem)
66    *
67    * @param problem estimation problem
68    * @return RMS value
69    */
getRMS(EstimationProblem problem)70   double getRMS(EstimationProblem problem);
71 
72   /**
73    * Get the covariance matrix of estimated parameters.
74    * @param problem estimation problem
75    * @return covariance matrix
76    * @exception EstimationException if the covariance matrix
77    * cannot be computed (singular problem)
78    */
getCovariances(EstimationProblem problem)79   double[][] getCovariances(EstimationProblem problem) throws EstimationException;
80 
81   /**
82    * Guess the errors in estimated parameters.
83    * @see #getRMS(EstimationProblem)
84    * @param problem estimation problem
85    * @return errors in estimated parameters
86      * @exception EstimationException if the error cannot be guessed
87    */
guessParametersErrors(EstimationProblem problem)88   double[] guessParametersErrors(EstimationProblem problem) throws EstimationException;
89 
90 }
91