The estimation package provides classes to fit some non-linear model to available observations depending on it. These problems are commonly called estimation problems.
The estimation problems considered here are parametric problems where a user-provided model depends on initially unknown scalar parameters and several measurements made on values that depend on the model are available. As examples, one can consider the center and radius of a circle given points approximately lying on a ring, or a satellite orbit given range, range-rate and angular measurements from various ground stations.
One important class of estimation problems is weighted least squares problems. They basically consist in finding the values for some parameters pk such that a cost function J = sum(wi ri2) is minimized. The various ri terms represent the deviation ri = mesi - modi between the measurements and the parameterized models. The wi factors are the measurements weights, they are often chosen either all equal to 1.0 or proportional to the inverse of the variance of the measurement type. The solver adjusts the values of the estimated parameters pk which are not bound (i.e. the free parameters). It does not touch the parameters which have been put in a bound state by the user.
The aim of this package is similar to the aim of the optimization package, but the algorithms are entirely differents as:
The org.apache.commons.math.estimation.EstimatedParameter class to represent each estimated parameter. The parameters are set up with a guessed value which will be adjusted by the solver until a best fit is achieved. It is possible to change which parameters are modified and which are preserved thanks to a bound property. Such settings are often needed by expert users to handle contingency cases with very low observability.
The user extends the org.apache.commons.math.estimation.WeightedMeasurement abstract class to define its own measurements. Each measurement types should have its own implementing class, for example in the satellite example above , the user should define three classes, one for range measurements, one for range-rates measurements and one for angular measurements. Each measurement would correspond to an instance of the appropriate class, set up with the date, a reference to the ground station, the weight and the measured value.
The package provides two common org.apache.commons.math.estimation.Estimator implementations to solve weighted least squares problems. The first one is based on the Gauss-Newton method. The second one is based on the Levenberg-Marquardt method. The first one is best suited when a good approximation of the parameters is known while the second one is more robust and can handle starting points far from the solution.