g02hb Method
関数リスト一覧   NagLibrary Namespaceへ  ライブラリイントロダクション  本ヘルプドキュメントのchm形式版

g02hb finds, for a real matrix X of full column rank, a lower triangular matrix A such that ATA-1 is proportional to a robust estimate of the covariance of the variables. g02hb is intended for the calculation of weights of bounded influence regression using g02hd.

Syntax

C#
public static void g02hb(
	G02..::.G02HB_UCV ucv,
	int n,
	int m,
	double[,] x,
	double[] a,
	double[] z,
	double bl,
	double bd,
	double tol,
	int maxit,
	int nitmon,
	out int nit,
	out int ifail
)
Visual Basic (Declaration)
Public Shared Sub g02hb ( _
	ucv As G02..::.G02HB_UCV, _
	n As Integer, _
	m As Integer, _
	x As Double(,), _
	a As Double(), _
	z As Double(), _
	bl As Double, _
	bd As Double, _
	tol As Double, _
	maxit As Integer, _
	nitmon As Integer, _
	<OutAttribute> ByRef nit As Integer, _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void g02hb(
	G02..::.G02HB_UCV^ ucv, 
	int n, 
	int m, 
	array<double,2>^ x, 
	array<double>^ a, 
	array<double>^ z, 
	double bl, 
	double bd, 
	double tol, 
	int maxit, 
	int nitmon, 
	[OutAttribute] int% nit, 
	[OutAttribute] int% ifail
)
F#
static member g02hb : 
        ucv:G02..::.G02HB_UCV * 
        n:int * 
        m:int * 
        x:float[,] * 
        a:float[] * 
        z:float[] * 
        bl:float * 
        bd:float * 
        tol:float * 
        maxit:int * 
        nitmon:int * 
        nit:int byref * 
        ifail:int byref -> unit 

Parameters

ucv
Type: NagLibrary..::.G02..::.G02HB_UCV
ucv must return the value of the function u for a given value of its argument. The value of u must be non-negative.

A delegate of type G02HB_UCV.

n
Type: System..::.Int32
On entry: n, the number of observations.
Constraint: n>1.
m
Type: System..::.Int32
On entry: m, the number of independent variables.
Constraint: 1mn.
x
Type: array< System..::.Double ,2>[,](,)[,]
An array of size [ldx, m]
Note: ldx must satisfy the constraint: ldxn
On entry: the real matrix X, i.e., the independent variables. x[i-1,j-1] must contain the ijth element of x, for i=1,2,n and j=1,2,,m.
a
Type: array< System..::.Double >[]()[]
An array of size [m×m+1/2]
On entry: an initial estimate of the lower triangular real matrix A. Only the lower triangular elements must be given and these should be stored row-wise in the array.
The diagonal elements must be 0, although in practice will usually be >0. If the magnitudes of the columns of X are of the same order the identity matrix will often provide a suitable initial value for A. If the columns of X are of different magnitudes, the diagonal elements of the initial value of A should be approximately inversely proportional to the magnitude of the columns of X.
On exit: the lower triangular elements of the matrix A, stored row-wise.
z
Type: array< System..::.Double >[]()[]
An array of size [n]
On exit: the value zi2, for i=1,2,,n.
bl
Type: System..::.Double
On entry: the magnitude of the bound for the off-diagonal elements of Sk.
Suggested value: bl=0.9.
Constraint: bl>0.
bd
Type: System..::.Double
On entry: the magnitude of the bound for the diagonal elements of Sk.
Suggested value: bd=0.9.
Constraint: bd>0.
tol
Type: System..::.Double
On entry: the relative precision for the final value of A. Iteration will stop when the maximum value of sjl is less than tol.
Constraint: tol>0.0.
maxit
Type: System..::.Int32
On entry: the maximum number of iterations that will be used during the calculation of A.
A value of maxit=50 will often be adequate.
Constraint: maxit>0.
nitmon
Type: System..::.Int32
On entry: determines the amount of information that is printed on each iteration.
nitmon>0
The value of A and the maximum value of sjl will be printed at the first and every nitmon iterations.
nitmon0
No iteration monitoring is printed.
nit
Type: System..::.Int32 %
On exit: the number of iterations performed.
ifail
Type: System..::.Int32 %
On exit: ifail=0 unless the method detects an error (see [Error Indicators and Warnings]).

Description

In fitting the linear regression model
y=Xθ+ε,
where y is a vector of length n of the dependent variable,
X is an n by m matrix of independent variables,
θ is a vector of length m of unknown parameters,
and ε is a vector of length n of unknown errors,
it may be desirable to bound the influence of rows of the X matrix. This can be achieved by calculating a weight for each observation. Several schemes for calculating weights have been proposed (see
Hampel et al. (1986) and Marazzi (1987)). As the different independent variables may be measured on different scales one group of proposed weights aims to bound a standardized measure of influence. To obtain such weights the matrix A has to be found such that
1ni=1nuzi2zi ziT =I​  I​ is the identity matrix
and
zi=Axi,
where xi is a vector of length m containing the elements of the ith row of X,
A is an m by m lower triangular matrix,
zi is a vector of length m,
and u is a suitable function.
The weights for use with g02hd may then be computed using
wi=fzi2
for a suitable user function f.
g02hb finds A using the iterative procedure
Ak=Sk+IAk-1,
where Sk=sjl, for j and l=1,2,,m, is a lower triangular matrix such that
  • sjl= -minmaxhjl/n,-BL,BL, j>l -minmax12hjj/n-1,-BD,BD, j=l
  • hjl=i=1nuzi2zijzil
and BD and BL are suitable bounds.
In addition the values of zi2, for i=1,2,,n, are calculated.
g02hb is based on routines in ROBETH; see Marazzi (1987).

References

Error Indicators and Warnings

Accuracy

Further Comments

The existence of A will depend upon the function u; (see Hampel et al. (1986) and Marazzi (1987)), also if X is not of full rank a value of A will not be found. If the columns of X are almost linearly related then convergence will be slow.

Example

See Also