|
NAG[g02hkc] NAG[nag_robust_corr_estim] - Robust estimation of a correlation matrix, Huber's weight function
|
|
Calling Sequence
g02hkc(x, eps, cov, theta, print_iter, tol, iter, 'n'=n, 'm'=m, 'tdx'=tdx, 'max_iter'=max_iter, 'outfile'=outfile, 'fail'=fail)
nag_robust_corr_estim(. . .)
Parameters
|
x - Matrix(1..n, 1..tdx, datatype=float[8], order=C_order);
|
|
|
|
eps - float;
|
|
|
On entry: the expected fraction of gross errors expected in the sample, .
|
|
Constraint: . .
|
|
|
cov - Vector(1.., datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array cov must be at least .
|
|
|
theta - Vector(1..m, datatype=float[8]);
|
|
|
On exit: the robust estimate of the location arguments , for .
|
|
|
print_iter - integer;
|
|
|
On entry: indicates if the printing of information on the iterations is required and the rate at which printing is produced.
|
|
No iteration monitoring is printed.
|
|
|
tol - float;
|
|
|
On entry: the relative precision for the final estimates of the covariance matrix.
|
|
Constraint: . .
|
|
|
iter - assignable;
|
|
|
Note: On exit the variable iter will have a value of type integer.
|
|
On exit: the number of iterations performed.
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the first dimension of the array x.
|
|
On entry: the number of observations, .
|
|
Constraint: . .
|
|
|
'm'=m - integer; (optional)
|
|
|
Default value: the first dimension of the array theta and the second dimension of the array thetathe array x.
|
|
On entry: the number of columns of the matrix , i.e., number of independent variables, .
|
|
Constraint: . .
|
|
|
'tdx'=tdx - integer; (optional)
|
|
|
On entry: the second dimension of the array x as declared in the function from which nag_robust_corr_estim (g02hkc) is called.
|
|
Constraint: . .
|
|
|
'max_iter'=max_iter - integer; (optional)
|
|
|
On entry: the maximum number of iterations that will be used during the calculation of the covariance matrix.
|
|
Suggested value: (default: ) .
|
|
Constraint: . .
|
|
|
'outfile'=outfile - character; (optional)
|
|
|
On entry: The name of a file to which intermediate or diagnostic output should be appended. If a value is not provided for this parameter then the behaviour of this routine is platform dependent. Usually all output will be suppressed, however on some platforms output will be produced and will be displayed in the Maple session.
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_robust_corr_estim (g02hkc) computes a robust estimate of the covariance matrix for an expected fraction of gross errors.
|
|
Description
|
|
For a set observations on variables in a matrix , a robust estimate of the covariance matrix, , and a robust estimate of location, , are given by:
where is a correction factor and is a lower triangular matrix found as the solution to the following equations.
and
|
is a vector of length ,
|
|
is the identity matrix and 0 is the zero matrix,
|
|
and and are suitable functions.
|
nag_robust_corr_estim (g02hkc) uses weight functions:
and
for constants , and .
These functions solve a minimax problem considered by Huber (1981).
The values of , and are calculated from the expected fraction of gross errors, (see Huber (1981) and Marazzi (1987a)). The expected fraction of gross errors is the estimated proportion of outliers in the sample.
In order to make the estimate asymptotically unbiased under a Normal model a correction factor, , is calculated, (see Huber (1981) and Marazzi (1987a)).
Initial estimates of , for , are given by the median of the th column of and the initial value of is based on the median absolute deviation (see Marazzi (1987a)). nag_robust_corr_estim (g02hkc) is based on routines in ROBETH, (see Marazzi (1987a)).
|
|
Error Indicators and Warnings
|
|
"NE_2_INT_ARG_GT"
On entry, while . These arguments must satisfy .
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_C_ITER_UNSTABLE"
The iterative procedure to find has become unstable. This may happen if the value of eps is too large.
"NE_CONST_COL"
On entry, column of array x has constant value.
"NE_INT_ARG_LE"
On entry, max_iter must not be less than or equal to 0: .
"NE_INT_ARG_LT"
On entry, n must not be less than 2: .
"NE_NOT_APPEND_FILE"
Cannot open file for appending.
"NE_NOT_CLOSE_FILE"
Cannot close file .
"NE_REAL_ARG_GE"
On entry, eps must be not be greater than or equal to 1.0: .
"NE_REAL_ARG_LE"
On entry, tol must not be less than or equal to 0.0: .
"NE_REAL_ARG_LT"
On entry, eps must not be less than 0.0: .
"NE_TOO_MANY"
Too many iterations( ). The iterative procedure to find the co-variance matrix , has failed to converge in max_iter iterations.
|
|
Accuracy
|
|
On successful exit the accuracy of the results is related to the value of tol, see Section [Parameters]. At an iteration let
|
the maximum value of the absolute relative change in
|
|
the maximum absolute change in
|
|
the maximum absolute relative change in
|
and let . Then the iterative procedure is assumed to have converged when .
|
|
|
Examples
|
|
>
|
n := 10:
m := 3:
tdx := 3:
eps := 0.1:
max_iter := 100:
print_iter := 0:
tol := 5e-05:
x := Matrix([[3.4, 6.9, 12.2], [6.4, 2.5, 15.1], [4.9, 5.5, 14.2], [7.3, 1.9, 18.2], [8.800000000000001, 3.6, 11.7], [8.4, 1.3, 17.9], [5.3, 3.1, 15], [2.7, 8.1, 7.7], [6.1, 3, 21.9], [5.3, 2.2, 13.9]], datatype=float[8], order='C_order'):
cov := Vector(6, datatype=float[8]):
theta := Vector(3, datatype=float[8]):
NAG:-g02hkc(x, eps, cov, theta, print_iter, tol, iter, 'n' = n, 'm' = m, 'tdx' = tdx, 'max_iter' = max_iter):
|
|
|
See Also
|
|
Huber P J (1981) Robust Statistics Wiley
Marazzi A (1987a) 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
g02 Chapter Introduction.
NAG Toolbox Overview.
NAG Web Site.
|
|