Click or drag to resize

DoubleIterativelyReweightedLeastSq Class

Class DoubleIterativelyReweightedLeastSq solves a least squares problems by iteratively applying a weighted least squares fit.
Inheritance Hierarchy
SystemObject
  CenterSpace.NMath.CoreDoubleIterativelyReweightedLeastSq

Namespace:  CenterSpace.NMath.Core
Assembly:  NMath (in NMath.dll) Version: 7.3
Syntax
public class DoubleIterativelyReweightedLeastSq : ICloneable

The DoubleIterativelyReweightedLeastSq type exposes the following members.

Constructors
  NameDescription
Public methodDoubleIterativelyReweightedLeastSq
No argument constructor. Defaults will be used.
Public methodDoubleIterativelyReweightedLeastSq(Double)
Constructs a DoubleIterativelyReweightedLeastSq instance with the given maximum iterations and tolerance.
Public methodDoubleIterativelyReweightedLeastSq(Int32)
Constructs a DoubleIterativelyReweightedLeastSq instance with the given maximum iterations and tolerance.
Public methodDoubleIterativelyReweightedLeastSq(IDoubleLeastSqWeightingFunction)
Constructs a DoubleIterativelyReweightedLeastSq instance with the given weighting function.
Public methodDoubleIterativelyReweightedLeastSq(Int32, Double)
Constructs a DoubleIterativelyReweightedLeastSq instance with the given maximum iterations and tolerance.
Public methodDoubleIterativelyReweightedLeastSq(Int32, Double, IDoubleLeastSqWeightingFunction)
Constructs a DoubleIterativelyReweightedLeastSq instance from the given parameters.
Top
Properties
  NameDescription
Public propertyAddIntercept
Gets the add intercept option. If AddIntercept is true then a column of ones was prepended to the input matrix, representing a constant term in the model.
Public propertyConvergenceFunction
Gets and sets the delegate function used to determine convergence. The delegate should return true when the tolerance is met.
Public propertyStatic memberDefaultMaxIterations
Gets and sets the default maximum number of iterations.
Public propertyStatic memberDefaultTolerance
Gets and sets the default error tolerance.
Public propertyIterations
Gets the number of iterations performed in the most recent computation.
Public propertyMaxIterations
Gest and set the maximum number of iterations. The algorithm will be terminated when it converges or the maximum number of iterations has been reached, which ever comes first.
Public propertyMaxIterationsMet
Returns true if the minimum just computed stopped because the maximum number of iterations was reached; otherwise, false.
Public propertyResiduals
Gets the residual vector from the most recent computation.
Public propertyTolerance
Gets and sets the tolerance. The tolerance is given to the ToleranceMet function. If using the default ToleranceMet function, the tolerance should be a relative one since the difference between successive solutions will be a relative one, that is the difference will be divided by the larger of the two solutions producing a value between 0 and 1.
Public propertyToleranceMet
Returns true if the minimum just computed stopped because the error tolerance was reached; otherwise, false.
Public propertyWeights
Gets the weights used in the final iteration of the most recent computation.
Public propertyWeightsFunction
Gets and sets the weight function.
Top
Methods
  NameDescription
Public methodClone
Creates a deep copy of this instance.
Public methodStatic memberSolutionUnchanged
Default convergence function for IRLS. Can be made into a ToleranceMet delegate.
Public methodSolve(DoubleMatrix, DoubleVector)
Solves the least squares problem Ax = b for x using the method of iteratively Reweighted least squares.
Public methodSolve(DoubleMatrix, DoubleVector, Boolean)
Solves the least squares problem Ax = b for x using the method of iteratively Reweighted least squares.
Top
Fields
  NameDescription
Public fieldStatic memberDEFAULT_MAX_ITER
The default maximum number of iterations to be performed before the algorithm terminated shared by all instances of DoubleIterativelyReweightedLeastSq. Instance where maximum iterations is not explicitly set by the user will use this value.
Public fieldStatic memberDEFAULT_TOLERANCE
The default tolerance used to determine convergence of the algorithm shared by all instances of DoubleIterativelyReweightedLeastSq. Instance where the tolerance is not explicitly set by the user will use this value.
Top
Remarks
On each iteration a weighted least squares fit is performed, one weight per observation. The weightes are constructed by specifying a weighting function from the current residuals and are updated from iteration to iteration. The iterative process terminates when a user specified ToleranceMetFunction returns true. Typically this is when the residuals or the solution are unchanged on successive iterations.
The default weighting function used is a bisquare weighting function and the default tolerance met function returns true when the solutions do not change, within tolerance, on successive iterations. Both these may by changed by the user.
See Also