NAG Library Routine Document
G02HFF
1 Purpose
G02HFF calculates an estimate of the asymptotic variance-covariance matrix for the bounded influence regression estimates (M-estimates). It is intended for use with
G02HDF.
2 Specification
SUBROUTINE G02HFF ( |
PSI, PSP, INDW, INDC, SIGMA, N, M, X, LDX, RS, WGT, C, LDC, WK, IFAIL) |
INTEGER |
INDW, INDC, N, M, LDX, LDC, IFAIL |
REAL (KIND=nag_wp) |
PSI, PSP, SIGMA, X(LDX,M), RS(N), WGT(N), C(LDC,M), WK(M*(N+M+1)+2*N) |
EXTERNAL |
PSI, PSP |
|
3 Description
For a description of bounded influence regression see
G02HDF. Let
be the regression parameters and let
be the asymptotic variance-covariance matrix of
. Then for Huber type regression
where
see
Huber (1981) and
Marazzi (1987).
For Mallows and Schweppe type regressions,
is of the form
where
and
.
is a diagonal matrix such that the th element approximates in the Schweppe case and in the Mallows case.
is a diagonal matrix such that the th element approximates in the Schweppe case and in the Mallows case.
Two approximations are available in G02HFF:
- Average over the
- Replace expected value by observed
In all cases is a robust estimate of .
G02HFF is based on routines in ROBETH; see
Marazzi (1987).
4 References
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
5 Parameters
- 1: PSI – REAL (KIND=nag_wp) FUNCTION, supplied by the user.External Procedure
PSI must return the value of the
function for a given value of its argument.
The specification of
PSI is:
- 1: T – REAL (KIND=nag_wp)Input
On entry: the argument for which
PSI must be evaluated.
PSI must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which G02HFF is called. Parameters denoted as
Input must
not be changed by this procedure.
- 2: PSP – REAL (KIND=nag_wp) FUNCTION, supplied by the user.External Procedure
PSP must return the value of
for a given value of its argument.
The specification of
PSP is:
- 1: T – REAL (KIND=nag_wp)Input
On entry: the argument for which
PSP must be evaluated.
PSP must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which G02HFF is called. Parameters denoted as
Input must
not be changed by this procedure.
- 3: INDW – INTEGERInput
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.
- 4: INDC – INTEGERInput
On entry: if
,
INDC must specify the approximation to be used.
If , averaging over residuals.
If , replacing expected by observed.
If
,
INDC is not referenced.
- 5: SIGMA – REAL (KIND=nag_wp)Input
On entry: the value of
, as given by
G02HDF.
Constraint:
.
- 6: N – INTEGERInput
On entry: , the number of observations.
Constraint:
.
- 7: M – INTEGERInput
On entry: , the number of independent variables.
Constraint:
.
- 8: X(LDX,M) – REAL (KIND=nag_wp) arrayInput
On entry: the values of the matrix, i.e., the independent variables.
must contain the th element of , for and .
- 9: LDX – INTEGERInput
On entry: the first dimension of the array
X as declared in the (sub)program from which G02HFF is called.
Constraint:
.
- 10: RS(N) – REAL (KIND=nag_wp) arrayInput
On entry: the residuals from the bounded influence regression. These are given by
G02HDF.
- 11: WGT(N) – REAL (KIND=nag_wp) arrayInput
On entry: if
,
WGT must contain the vector of weights used by the bounded influence regression. These should be used with
G02HDF.
If
,
WGT is not referenced.
- 12: C(LDC,M) – REAL (KIND=nag_wp) arrayOutput
On exit: the estimate of the variance-covariance matrix.
- 13: LDC – INTEGERInput
On entry: the first dimension of the array
C as declared in the (sub)program from which G02HFF is called.
Constraint:
.
- 14: WK() – REAL (KIND=nag_wp) arrayOutput
On exit: if
,
, for
, will contain the diagonal elements of the matrix
and
, for
, will contain the diagonal elements of matrix
.
The rest of the array is used as workspace.
- 15: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
On entry, | , |
or | , |
or | , |
or | , |
or | . |
If then the matrix is either not positive definite, possibly due to rounding errors, or is ill-conditioned.
If then the matrix is singular or almost singular. This may be due to many elements of being zero.
Either the value of ,
or ,
or .
In this situation G02HFF returns as .
7 Accuracy
In general, the accuracy of the variance-covariance matrix will depend primarily on the accuracy of the results from
G02HDF.
G02HFF 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 .
9 Example
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.
9.1 Program Text
Program Text (g02hffe.f90)
9.2 Program Data
Program Data (g02hffe.d)
9.3 Program Results
Program Results (g02hffe.r)