NMath Reference Guide

## Double |

Class DoubleIterativelyReweightedLeastSq solves a least squares problems by iteratively
applying a weighted least squares fit.

Inheritance Hierarchy

Syntax

The DoubleIterativelyReweightedLeastSq type exposes the following members.

Constructors

Name | Description | |
---|---|---|

DoubleIterativelyReweightedLeastSq | No argument constructor. Defaults will be used. | |

DoubleIterativelyReweightedLeastSq(Double) | Constructs a DoubleIterativelyReweightedLeastSq instance with the given maximum iterations and tolerance. | |

DoubleIterativelyReweightedLeastSq(IDoubleLeastSqWeightingFunction) | Constructs a DoubleIterativelyReweightedLeastSq instance with the given weighting function. | |

DoubleIterativelyReweightedLeastSq(Int32) | Constructs a DoubleIterativelyReweightedLeastSq instance with the given maximum iterations and tolerance. | |

DoubleIterativelyReweightedLeastSq(Int32, Double) | Constructs a DoubleIterativelyReweightedLeastSq instance with the given maximum iterations and tolerance. | |

DoubleIterativelyReweightedLeastSq(Int32, Double, IDoubleLeastSqWeightingFunction) | Constructs a DoubleIterativelyReweightedLeastSq instance from the given parameters. |

Properties

Name | Description | |
---|---|---|

AddIntercept | 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. | |

ConvergenceFunction | Gets and sets the delegate function used to determine convergence. The delegate should return true when the tolerance is met. | |

DefaultMaxIterations | Gets and sets the default maximum number of iterations. | |

DefaultTolerance | Gets and sets the default error tolerance. | |

Iterations | Gets the number of iterations performed in the most recent computation. | |

MaxIterations | 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. | |

MaxIterationsMet | Returns true if the minimum just computed stopped because the maximum number of iterations was reached; otherwise, false. | |

Residuals | Gets the residual vector from the most recent computation. | |

Tolerance | 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. | |

ToleranceMet | Returns true if the minimum just computed stopped because the error tolerance was reached; otherwise, false. | |

Weights | Gets the weights used in the final iteration of the most recent computation. | |

WeightsFunction | Gets and sets the weight function. |

Methods

Name | Description | |
---|---|---|

Clone | Creates a deep copy of this instance. | |

SolutionUnchanged | Default convergence function for IRLS. Can be made into a ToleranceMet delegate. | |

Solve(DoubleMatrix, DoubleVector) | Solves the least squares problem Ax = b for x using the method of iteratively Reweighted least squares. | |

Solve(DoubleMatrix, DoubleVector, Boolean) | Solves the least squares problem Ax = b for x using the method of iteratively Reweighted least squares. |

Fields

Name | Description | |
---|---|---|

DEFAULT_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. | |

DEFAULT_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. |

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.

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