|
NAG[g02hfc] NAG[nag_robust_m_regsn_param_var] - Robust regression, variance-covariance matrix following g02hdc (nag_robust_m_regsn_user_fn)
|
|
Calling Sequence
g02hfc(psi, psp, regtype, covmat_est, sigma, m, x, rs, wgt, cov, comm_arr, 'n'=n, 'comm'=comm, 'fail'=fail)
nag_robust_m_regsn_param_var(. . .)
Parameters
|
psi - procedure;
|
|
|
psi must return the value of the function for a given value of its argument.
|
|
t - float;
|
|
|
On entry: the argument for which psi must be evaluated.
|
|
|
comm - table;
|
|
|
A Maple table, which should be generated using NAG[Nag_Comm], corresponding to the Nag_Comm structure.
|
|
Before calling nag_robust_m_regsn_param_var (g02hfc) this field may be initialized for use by psi when called from nag_robust_m_regsn_param_var (g02hfc).
|
|
|
|
psp - procedure;
|
|
|
psp must return the value of for a given value of its argument.
|
|
t - float;
|
|
|
On entry: the argument for which psp must be evaluated.
|
|
|
comm - table;
|
|
|
A Maple table, which should be generated using NAG[Nag_Comm], corresponding to the Nag_Comm structure.
|
|
Before calling nag_robust_m_regsn_param_var (g02hfc) this field may be initialized for use by psp when called from nag_robust_m_regsn_param_var (g02hfc).
|
|
|
|
regtype - String;
|
|
|
On entry: the type of regression for which the asymptotic variance-covariance matrix is to be calculated.
|
|
Huber type regression.
|
|
Mallows type regression.
|
|
Schweppe type regression.
|
|
|
covmat_est - String;
|
|
|
On entry: if , covmat_est must specify the approximation to be used.
|
|
If , averaging over residuals.
|
|
If , replacing expected by observed.
|
|
If , covmat_est is not referenced.
|
|
|
sigma - float;
|
|
|
Constraint: . .
|
|
|
m - integer;
|
|
|
On entry: , the number of independent variables.
|
|
Constraint: . .
|
|
|
x - Matrix(1..dim1, 1..m, datatype=float[8], order=order);
|
|
|
Note: this array may be supplied in Fortran_order or C_order , as specified by order. All array parameters must use a consistent order.
|
|
|
rs - Vector(1..n, datatype=float[8]);
|
|
|
|
wgt - Vector(1..n, datatype=float[8]);
|
|
|
If , wgt is not referenced.
|
|
|
cov - Matrix(1..dim1, 1..m, datatype=float[8], order=order);
|
|
|
Note: this array may be supplied in Fortran_order or C_order , as specified by order. All array parameters must use a consistent order.
|
|
On exit: the estimate of the variance-covariance matrix.
|
|
|
comm_arr - Vector(1.., datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array comm_arr must be at least .
|
|
|
'n'=n - integer; (optional)
|
|
|
On entry: , the number of observations.
|
|
Constraint: . .
|
|
|
'comm'=comm - table; (optional)
|
|
|
A Maple table, which should be generated using NAG[Nag_Comm], corresponding to the Nag_Comm structure.
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_robust_m_regsn_param_var (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 (nag_robust_m_regsn_user_fn).
|
|
Description
|
|
For a description of bounded influence regression see g02hdc (nag_robust_m_regsn_user_fn). Let be the regression arguments and let be the asymptotic variance-covariance matrix of . Then for Huber type regression
where
see Huber (1981) and Marazzi (1987b).
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 nag_robust_m_regsn_param_var (g02hfc):
|
Average over the
|
|
Replace expected value by observed
|
See Hampel et al. (1986) and Marazzi (1987b).
In all cases is a robust estimate of .
nag_robust_m_regsn_param_var (g02hfc) is based on routines in ROBETH; see Marazzi (1987b).
|
|
Error Indicators and Warnings
|
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_BAD_PARAM"
On entry, argument had an illegal value.
"NE_CORRECTION_FACTOR"
Correction factor = 0 (Huber type regression).
"NE_INT"
On entry, . Constraint: .
On entry, . Constraint: .
"NE_INT_2"
On entry, , . Constraint: .
On entry, : , .
"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 consult NAG for assistance.
"NE_POS_DEF"
matrix not positive-definite.
"NE_REAL"
On entry, . Constraint: .
"NE_REAL_ARRAY_ELEM_CONS"
On entry, an element of .
"NE_SINGULAR"
matrix is singular or almost singular.
|
|
|
Examples
|
|
>
|
psi := proc(t, comm)
if (t <= -1.5) then
-1.5:
elif (t >= 1.5) then
1.5:
else
t:
end if:
end proc:
psp := proc(t, comm)
if (abs(t) < 1.5) then
1.0:
else
0.0:
end if:
end proc:
regtype := "Nag_SchweppeReg":
covmat_est := "Nag_CovMatAve":
sigma := 20.7783:
n := 5:
m := 3:
comm := NAG:-Nag_Comm():
x := Matrix([[1, -1, -1], [1, -1, 1], [1, 1, -1], [1, 1, 1], [1, 0, 3]], datatype=float[8]):
rs := Vector([0.5643, -1.1286, 0.5643, -1.1286, 1.1286], datatype=float[8]):
wgt := Vector([0.4039, 0.5012, 0.4039, 0.5012, 0.3862], datatype=float[8]):
cov := Matrix(3, 3, datatype=float[8]):
comm_arr := Vector(37, datatype=float[8]):
NAG:-g02hfc(psi, psp, regtype, covmat_est, sigma, m, x, rs, wgt, cov, comm_arr, 'n' = n, 'comm' = comm):
|
|
|
See Also
|
|
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 (1987b) 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
g02 Chapter Introduction.
NAG Toolbox Overview.
NAG Web Site.
|
|