

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.jscience.mathematics.analysis.estimation.LeastSquaresEstimator
public class LeastSquaresEstimator
This class implements a solver for estimation problems.
This class solves estimation problems using a weighted least squares criterion on the measurement residuals. It uses a GaussNewton algorithm.
Constructor Summary  

LeastSquaresEstimator(int maxIterations,
double convergence,
double steadyStateThreshold,
double epsilon)
Simple constructor. 
Method Summary  

void 
estimate(EstimationProblem problem)
Solve an estimation problem using a least squares criterion. 
double 
getRMS(EstimationProblem problem)
Get the Root Mean Square value. 
void 
linearEstimate(EstimationProblem problem)
Estimate the solution of a linear least square problem. 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 

public LeastSquaresEstimator(int maxIterations, double convergence, double steadyStateThreshold, double epsilon)
This constructor build an estimator and store its convergence characteristics.
An estimator is considered to have converge whenever either the criterion goes below a physical threshold under which improvement are considered useless or when the algorithm is unable to improve it (even if it is still high). The first condition that is met stops the iterations.
The fact an estimator has converged does not mean that the model accurately fit the measurements. It only means no better solution can be found, it does not mean this one is good. Such an analysis belong to the caller.
If neither condition is fulfilled before a given number of
iterations, the algorithm is considered to have failed and an
EstimationException
will be thrown.
maxIterations
 maximum number of iterations allowedconvergence
 criterion threshold below which we do not need
to improve the criterion anymoresteadyStateThreshold
 steady state detection threshold, the
problem has converged has reached a steady state if
Math.abs (Jn  Jn1) < Jn * convergence
, where
Jn
and Jn1
are the current and
preceding criterion value (square sum of the weighted residuals
of considered measurements).epsilon
 threshold under which the matrix of the linearized
problem is considered singular (see SquareMatrix.solve
).Method Detail 

public void estimate(EstimationProblem problem) throws EstimationException
This method set the unbound parameters of the given problem starting from their current values through several iterations. At each step, the unbound parameters are changed in order to minimize a weighted least square criterion based on the measurements of the problem.
The iterations are stopped either when the criterion goes
below a physical threshold under which improvement are considered
useless or when the algorithm is unable to improve it (even if it
is still high). The first condition that is met stops the
iterations. If the convergence it nos reached before the maximum
number of iterations, an EstimationException
is
thrown.
estimate
in interface Estimator
problem
 estimation problem to solve
EstimationException
 if the problem cannot be solvedEstimationProblem
public void linearEstimate(EstimationProblem problem)
The GaussNewton algorithm is iterative. Each iteration consist in solving a linearized least square problem. Several iterations are needed for general problems since the linearization is only an approximation of the problem behaviour. However, for linear problems one iteration is enough to get the solution. This method is provided in the public interface in order to handle more efficiently these linear problems.
problem
 estimation problem to solvepublic double getRMS(EstimationProblem problem)
problem
 estimation problem


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 