g02hfc calculates an estimate of the asymptotic variance-covariance matrix for the bounded influence regression estimates (M-estimates). It is intended for use with g02hdc.
The function may be called by the names: g02hfc, nag_correg_robustm_user_varmat or nag_robust_m_regsn_param_var.
3Description
For a description of bounded influence regression see g02hdc. Let be the regression parameters and let be the asymptotic variance-covariance matrix of . Then for Huber type regression
g02hfc is based on routines in ROBETH; see Marazzi (1987).
4References
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) Subroutines for robust and bounded influence regression in ROBETH Cah. Rech. Doc. IUMSP, No. 3 ROB 2 Institut Universitaire de Médecine Sociale et Préventive, Lausanne
5Arguments
1: – Nag_OrderTypeInput
On entry: the order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by . See Section 3.1.3 in the Introduction to the NAG Library CL Interface for a more detailed explanation of the use of this argument.
Constraint:
or .
2: – function, supplied by the userExternal Function
psi must return the value of the function for a given value of its argument.
On entry: the argument for which psi must be evaluated.
2: – Nag_Comm *
Pointer to structure of type Nag_Comm; the following members are relevant to psi.
user – double *
iuser – Integer *
p – Pointer
The type Pointer will be void *. Before calling g02hfc you may allocate memory and initialize these pointers with various quantities for use by psi when called from g02hfc (see Section 3.1.1 in the Introduction to the NAG Library CL Interface).
Note:psi should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by g02hfc. If your code inadvertently does return any NaNs or infinities, g02hfc is likely to produce unexpected results.
3: – function, supplied by the userExternal Function
psp must return the value of for a given value of its argument.
On entry: the argument for which psp must be evaluated.
2: – Nag_Comm *
Pointer to structure of type Nag_Comm; the following members are relevant to psp.
user – double *
iuser – Integer *
p – Pointer
The type Pointer will be void *. Before calling g02hfc you may allocate memory and initialize these pointers with various quantities for use by psp when called from g02hfc (see Section 3.1.1 in the Introduction to the NAG Library CL Interface).
Note:psp should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by g02hfc. If your code inadvertently does return any NaNs or infinities, g02hfc is likely to produce unexpected results.
4: – Nag_RegTypeInput
On entry: the type of regression for which the asymptotic variance-covariance matrix is to be calculated.
Mallows type regression.
Huber type regression.
Schweppe type regression.
Constraint:
, or .
5: – Nag_CovMatrixEstInput
On entry: if , covmat_est must specify the approximation to be used.
Note: the dimension, dim, of the array
cov
must be at least
.
the th element of the matrix is stored in
when ;
when .
On exit: the estimate of the variance-covariance matrix.
14: – IntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array cov.
Constraint:
.
15: – doubleOutput
Note: the dimension, dim, of the array comm_arr
must be at least
.
On exit: if ,
, for , will contain the diagonal elements of the matrix and
, for , will contain the diagonal elements of matrix .
16: – Nag_Comm *
The NAG communication argument (see Section 3.1.1 in the Introduction to the NAG Library CL Interface).
17: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error Indicators and Warnings
NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
NE_BAD_PARAM
On entry, argument had an illegal value.
NE_CORRECTION_FACTOR
Either the value of ,
or ,
or .
In this situation g02hfc returns as .
NE_INT
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, . Constraint: .
On entry, . Constraint: .
NE_INT_2
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
NE_POS_DEF
matrix not positive definite.
NE_REAL
On entry, .
Constraint: .
NE_SINGULAR
matrix is singular or almost singular.
7Accuracy
In general, the accuracy of the variance-covariance matrix will depend primarily on the accuracy of the results from g02hdc.
8Parallelism and Performance
g02hfc is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
g02hfc makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the Users' Note for your implementation for any additional implementation-specific information.
9Further Comments
g02hfc is only for situations in which has full column rank.
Care has to be taken in the choice of the function since if for too wide a range then either the value of will not exist or too many values of will be zero and it will not be possible to calculate .
10Example
The asymptotic variance-covariance matrix is calculated for a Schweppe type regression. The values of , and the residuals and weights are read in. The averaging over residuals approximation is used.