Syntax
C# |
---|
public static void g02hf( G02..::..G02HF_PSI psi, G02..::..G02HF_PSP psp, int indw, int indc, double sigma, int n, int m, double[,] x, double[] rs, double[] wgt, double[,] c, double[] diag_d, double[] diag_p, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g02hf ( _ psi As G02..::..G02HF_PSI, _ psp As G02..::..G02HF_PSP, _ indw As Integer, _ indc As Integer, _ sigma As Double, _ n As Integer, _ m As Integer, _ x As Double(,), _ rs As Double(), _ wgt As Double(), _ c As Double(,), _ diag_d As Double(), _ diag_p As Double(), _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g02hf( G02..::..G02HF_PSI^ psi, G02..::..G02HF_PSP^ psp, int indw, int indc, double sigma, int n, int m, array<double,2>^ x, array<double>^ rs, array<double>^ wgt, array<double,2>^ c, array<double>^ diag_d, array<double>^ diag_p, [OutAttribute] int% ifail ) |
F# |
---|
static member g02hf : psi : G02..::..G02HF_PSI * psp : G02..::..G02HF_PSP * indw : int * indc : int * sigma : float * n : int * m : int * x : float[,] * rs : float[] * wgt : float[] * c : float[,] * diag_d : float[] * diag_p : float[] * ifail : int byref -> unit |
Parameters
- psi
- Type: NagLibrary..::..G02..::..G02HF_PSIpsi must return the value of the function for a given value of its argument.
A delegate of type G02HF_PSI.
- psp
- Type: NagLibrary..::..G02..::..G02HF_PSPpsp must return the value of for a given value of its argument.
A delegate of type G02HF_PSP.
- indw
- Type: System..::..Int32On 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.
- indc
- Type: System..::..Int32
- sigma
- Type: System..::..DoubleOn entry: the value of , as given by g02hd.Constraint: .
- n
- Type: System..::..Int32On entry: , the number of observations.Constraint: .
- m
- Type: System..::..Int32On entry: , the number of independent variables.Constraint: .
- x
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, m]Note: dim1 must satisfy the constraint:On entry: the values of the matrix, i.e., the independent variables. must contain the th element of , for and .
- rs
- Type: array<System..::..Double>[]()[][]An array of size [n]On entry: the residuals from the bounded influence regression. These are given by g02hd.
- wgt
- Type: array<System..::..Double>[]()[][]An array of size [n]
- c
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, m]Note: dim1 must satisfy the constraint:On exit: the estimate of the variance-covariance matrix.
- diag_d
- Type: array<System..::..Double>[]()[][]An array of size [n]On exit: diag_d will contain the diagonal elements of the matrix _d
- diag_p
- Type: array<System..::..Double>[]()[][]An array of size [n]On exit: diag_p will contain the diagonal elements of the matrix _p
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
For a description of bounded influence regression see g02hd. 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 g02hf:
1. | Average over the
|
||
2. | Replace expected value by observed
|
See Hampel et al. (1986) and Marazzi (1987).
In all cases is a robust estimate of .
g02hf is based on routines in ROBETH; see Marazzi (1987).
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
Error Indicators and Warnings
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface
(LDX, LDC, WK) In these
cases, an error in another parameter has usually caused an incorrect value to be inferred.
On entry, , or , or ,
On entry, .
- 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 g02hf returns as .
Accuracy
In general, the accuracy of the variance-covariance matrix will depend primarily on the accuracy of the results from g02hd.
Parallelism and Performance
None.
Further Comments
g02hf 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 .
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.
Example program (C#): g02hfe.cs