Click or drag to resize

DoubleLeastSqWeightingFunction Class

Abstract base class for least squares weighting functions used in the Iteratively Reweighted Least Squares algorithm.
Inheritance Hierarchy

Namespace: CenterSpace.NMath.Core
Assembly: NMath (in NMath.dll) Version: 7.4
Syntax
[SerializableAttribute]
public abstract class DoubleLeastSqWeightingFunction : IDoubleLeastSqWeightingFunction, 
	ICloneable

The DoubleLeastSqWeightingFunction type exposes the following members.

Constructors
 NameDescription
Public methodDoubleLeastSqWeightingFunction Constructs an empty DoubleLeastSqWeighting instance. Behavior is undefined unitil the Initialize method is called.
Public methodDoubleLeastSqWeightingFunction(Double) Constructs DoubleLeastSqWeightingFunction instance with the specified tuning constant.
Protected methodDoubleLeastSqWeightingFunction(DoubleLeastSqWeightingFunction) Copy constructor. Creates an instance of DoubleLeastSqWeightingFunction that is a deep copy of other.
Public methodDoubleLeastSqWeightingFunction(DoubleMatrix) Constructs a DoubleLeastSqWeighting instance for the given least square matrix and intercept option.
Top
Properties
 NameDescription
Public propertyTuningConstant Gets and sets the tuning constant.
Top
Methods
 NameDescription
Public methodAdjustedResiduals Returns a vector of adjusted residuals for the weighted least squares problem: Ax = b.
Public methodClone Creates a deep copy of this weighting.
Public methodGetWeights Computes weights from residuals.
Public methodInitialize Performs initialization of the weighting function based on the matrix A in the weighted least squares problem: Ax - b.
Public methodMedianAbsDeviation Returns the Mean Absolute Deviation of a vector of values. The mean absolute deviation is an estimate of the standard deviation of the vector of residuals normalized to make the estimate unbiased for the normal distribution.
Top
Fields
 NameDescription
Protected fieldadjFactor_ Adjustment factor used in computing the adjusted residuals. It is given by the formula: 1.0 / sqrt(1 - h). Where, h is the vector of leverage values. The leverage values are the main diagonal of the hat matrix H = A((A'A)^-1)A'.
Protected fieldcols_ Number of columns in the matrix A in the least squares problem. Ax = b.
Protected fieldrows_ Number of rows in the matrix A in the least squares problem. Ax = b.
Protected fieldtuningConstant_ Tuning constant used in the weighting function. Implementing classes should provide this value.
Top
Remarks
Consider a least square problem of the form Ax = b that is is to be solved using iteratively Reweighted least squares. Typical weighting functions used in iteratively Reweighted least squares are a function of the residuals from the previous iteration which have been adjusted. The base class DoubleLeastSqWeightingFunction provides methods for calculating the adjusted residual from the matrix A and actual residuals according to the following formula: adjustedResiduals = residuals / (tuningConstant*s*sqrt(1 - h)). Where, h is the vector of leverage values. The leverage values are the main diagonal of the hat matrix H = A((A'A)^-1)A'. s is an estimate of the standard deviation of the error term given by: s = MAD / 0.6745 where MAD is the median absolute deviation of the residuals from their median. The constant 0.6745 makes the estimate unbiased for the normal distribution. tuningConstant is a tuning constant by which the residuals are divided before computing weights. Decreasing the tuning constant increases the downweight assigned to large residuals and increasing the tuning constant decreases the downweight assigned to large residuals.
See Also