[RsR] nlrob()'s vcov() ?

Martin Maechler m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Sat Apr 19 21:11:11 CEST 2014


I'm answering in public ... in the hope this help the next person googling ...

On Fri, Apr 18, 2014 at 4:57 PM, Chris K..........  wrote:

> Dear Dr Maechler - I want to use the nlrob iterativelt
> reweighted facility to perform nonlinear regression on
> heteroscedastic data. I want to find out about the
> covariance matrix calculated by the software - does
> doCov simply call the vcov facility?

well, doCov is an argument of nlrob() and when TRUE does the same
computations that vcov(<nlrob result>)
would do.  Note that  summary(<nlrob>) also uses the same
variance-covariance matrix for
the standard errors.


> Are the loss function
> corrections of the forms given in e.g. Huber 1973 (Ann.Stats.
> 1, 799-821) implemented?

> I would appreciate knowing the actual  mathematical forms used.

Well, I don't have any ready, nor an electronic version of  Huber (1973),
but yes, it does use one version of Huber's correction formulas.

Note that in the nonlinear case, the resulting vcov matrix is double
approximate:
the *non*linear regression will use a linear approximation at the minimum,
the same that  vcov(nls( .. )) uses, and that's already not unproblematic.

In addition, we use Huber's approximate formula for the correction factor tau,

tau =  ave_i psi( r_i /  s )  /  [ ave_i  psi'( r_i/d ) ] ^2
 where  ave_i  f(i) =   1/n sum_{i=1}^n   f(i)

The R code is

    ## --- Estimated asymptotic covariance of the robust estimator
    rw <- psi(res.sc <- resid/Scale)
    asCov <- if(!converged || !doCov) NA else {
        ## a version of  .vcov.m(.) below
    AtWAinv <- chol2inv(out$m$Rmat())
    dimnames(AtWAinv) <- list(names(coef), names(coef))
    tau <- mean(rw^2) / mean(psi(res.sc, d=TRUE))^2
    AtWAinv * Scale^2 * tau
    }




More information about the R-SIG-Robust mailing list