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

g02hf calculates an estimate of the asymptotic variance-covariance matrix for the bounded influence regression estimates (M-estimates). It is intended for use with g02hd.

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 (Declaration)
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_PSI
psi 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_PSP
psp must return the value of ψt=ddt ψt for a given value of its argument.

A delegate of type G02HF_PSP.

indw
Type: System..::.Int32
On entry: the type of regression for which the asymptotic variance-covariance matrix is to be calculated.
indw<0 
Mallows type regression.
indw=0
Huber type regression.
indw>0 
Schweppe type regression.
indc
Type: System..::.Int32
On entry: if indw0, indc must specify the approximation to be used.
If indc=1, averaging over residuals.
If indc1 , replacing expected by observed.
If indw=0, indc is not referenced.
sigma
Type: System..::.Double
On entry: the value of σ^, as given by g02hd.
Constraint: sigma>0.
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: 1m<n.
x
Type: array< System..::.Double ,2>[,](,)[,]
An array of size [ldx, m]
Note: ldx must satisfy the constraint: ldxn
On entry: the values of the X matrix, i.e., the independent variables. x[i-1,j-1] must contain the ijth element of X, for i=1,2,,n, j=1,2,,m.
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]
On entry: if indw0, wgt must contain the vector of weights used by the bounded influence regression. These should be used with g02hd.
If indw=0, wgt is not referenced.
Constraint: if indw0, wgt[i-1]0.0 for i=1,2,,n.
c
Type: array< System..::.Double ,2>[,](,)[,]
An array of size [ldc, m]
Note: ldc must satisfy the constraint: ldcm
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: ifail=0 unless the method detects an error (see [Error Indicators and Warnings]).

Description

For a description of bounded influence regression see g02hd. Let θ be the regression parameters and let C be the asymptotic variance-covariance matrix of θ^. Then for Huber type regression
C=fHXTX-1σ^2,
where
fH=1n-m i= 1nψ2 ri/σ^ 1nψ riσ^ 2 κ2
κ2=1+mn 1n i=1n ψ ri/σ^-1ni=1nψ ri/σ^ 2 1n i=1nψ riσ^ 2 ,
see Huber (1981) and Marazzi (1987).
For Mallows and Schweppe type regressions, C is of the form
σ^n2S1-1S2S1-1,
where S1=1nXTDX and S2=1nXTPX.
D is a diagonal matrix such that the ith element approximates Eψri/σwi in the Schweppe case and Eψri/σwi in the Mallows case.
P is a diagonal matrix such that the ith element approximates Eψ2ri/σwiwi2 in the Schweppe case and Eψ2ri/σwi2 in the Mallows case.
Two approximations are available in g02hf:
  1. Average over the ri 
    Schweppe Mallows Di=1nj=1nψ rjσ^wi wi Di=1nj=1nψ rjσ^ wi Pi=1nj=1nψ2 rjσ^wi wi2 Pi=1nj=1nψ2 rjσ^ wi2
  2. Replace expected value by observed
    Schweppe Mallows Di=ψ riσ ^wi wi Di=ψ riσ ^ wi Pi=ψ2 riσ ^wi wi2 Pi=ψ2 riσ ^ wi2
In all cases σ^ is a robust estimate of σ.
g02hf is based on routines in ROBETH; see Marazzi (1987).

References

Error Indicators and Warnings

Accuracy

Further Comments

g02hf is only for situations in which X has full column rank.
Care has to be taken in the choice of the ψ function since if ψt=0 for too wide a range then either the value of fH will not exist or too many values of Di will be zero and it will not be possible to calculate C.

Example

See Also