Skip to content

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

1 message · Martin Maechler

#
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:

            
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.
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
    }