Public Shared Sub g02hb ( _ ucv As G02..::..G02HB_UCV, _ n As Integer, _ m As Integer, _ x As Double(,), _ a As Double(), _ z As Double(), _ bl As Double, _ bd As Double, _ tol As Double, _ maxit As Integer, _ nitmon As Integer, _ <OutAttribute> ByRef nit As Integer, _ <OutAttribute> ByRef ifail As Integer _ )
public: static void g02hb( G02..::..G02HB_UCV^ ucv, int n, int m, array<double,2>^ x, array<double>^ a, array<double>^ z, double bl, double bd, double tol, int maxit, int nitmon, [OutAttribute] int% nit, [OutAttribute] int% ifail )
- Type: NagLibrary..::..G02..::..G02HB_UCVucv must return the value of the function for a given value of its argument. The value of must be non-negative.
A delegate of type G02HB_UCV.
- Type: System..::..Int32On entry: , the number of observations.Constraint: .
- Type: System..::..Int32On entry: , the number of independent variables.Constraint: .
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, m]Note: dim1 must satisfy the constraint:On entry: the real matrix , i.e., the independent variables. must contain the th element of , for and .
- Type: array<System..::..Double>()An array of size On entry: an initial estimate of the lower triangular real matrix . Only the lower triangular elements must be given and these should be stored row-wise in the array.The diagonal elements must be , although in practice will usually be . If the magnitudes of the columns of are of the same order the identity matrix will often provide a suitable initial value for . If the columns of are of different magnitudes, the diagonal elements of the initial value of should be approximately inversely proportional to the magnitude of the columns of .On exit: the lower triangular elements of the matrix , stored row-wise.
- Type: System..::..DoubleOn entry: the magnitude of the bound for the off-diagonal elements of .Suggested value: .Constraint: .
- Type: System..::..DoubleOn entry: the magnitude of the bound for the diagonal elements of .Suggested value: .Constraint: .
- Type: System..::..DoubleOn entry: the relative precision for the final value of . Iteration will stop when the maximum value of is less than tol.Constraint: .
- Type: System..::..Int32On entry: the maximum number of iterations that will be used during the calculation of .A value of will often be adequate.Constraint: .
- Type: System..::..Int32On entry: determines the amount of information that is printed on each iteration.
When printing occurs the output is directed to the current advisory message unit (see (X04ABF not in this release)).
- The value of and the maximum value of will be printed at the first and every nitmon iterations.
- No iteration monitoring is printed.
- Type: System..::..Int32%On exit: the number of iterations performed.
In fitting the linear regression model
it may be desirable to bound the influence of rows of the matrix. This can be achieved by calculating a weight for each observation. Several schemes for calculating weights have been proposed (see Hampel et al. (1986) and Marazzi (1987)). As the different independent variables may be measured on different scales one group of proposed weights aims to bound a standardized measure of influence. To obtain such weights the matrix has to be found such that
|where||is a vector of length of the dependent variable,|
|is an by matrix of independent variables,|
|is a vector of length of unknown parameters,|
|and||is a vector of length of unknown errors,|
|where||is a vector of length containing the elements of the th row of ,|
|is an by lower triangular matrix,|
|is a vector of length ,|
|and||is a suitable function.|
The weights for use with g02hd may then be computed using
for a suitable user-supplied function .
g02hb finds using the iterative procedure
where , for and , is a lower triangular matrix such that
In addition the values of , for , are calculated.
Hampel F R, Ronchetti E M, Rousseeuw P J and Stahel W A (1986) Robust Statistics. The Approach Based on Influence Functions Wiley
Huber P J (1981) Robust Statistics Wiley
Marazzi A (1987) Weights for bounded influence regression in ROBETH Cah. Rech. Doc. IUMSP, No. 3 ROB 3 Institut Universitaire de Médecine Sociale et Préventive, Lausanne
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (LDX) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
On entry, , or , or , On entry, , or , or diagonal element of , or , or .
- Value returned by .
- The method has failed to converge in maxit iterations.
This example reads in a matrix of real numbers and computes the Krasker–Welsch weights (see Marazzi (1987)). The matrix and the weights are then printed.