R: robust package -- lmRob how to find the psi function used in the calculations

811 views Asked by At

I am using lmRob.

require(robust)
stack.rob.int <- lmRob(Loss ~.*., data = stack.dat)

Fine but, I was wondering how I could obtain the psi-function that is used by the lmRob function in the actual fitting. Thanks in advance for any help!

If I were to use the lmrob function in robustbase, is it possible to change the psi function to subtract it by a constant. I am trying to implement the bootstrap as per Lahiri (Annals of Statistics, 1992) where the way to still keep the bootstrap valid is mentioned to be to replace the psi() with the originalpsi() minus the mean ot the residuals while fitting the bootstrap for the robust linear model.

1

There are 1 answers

3
coatless On BEST ANSWER

So, there is no way to access the psi function directly for robust::lmRob().

Simply put, lmRob() calls lmRob.fit() (or lmRob.wfit() if you supply weights) which subsequently calls lmRob.fit.compute() that then sets initial values for a Fortran version depending on the lmRob.control() set to either "bisquare" or "optimal".

As a result of the above discussion, if you need access to the psi functions, you may wish to use robustbase as it has easy access to many psi functions (c.f. the biweights)

Edit 1

Regarding:

psi function evaluated at the residuals in lmRob

No. The details of what is available after running lmRob is available in the lmRob.object. The documentation is accessible via ?lmRob.object. Regarding residuals, the following are available in the lmRob object.

  • residuals: the residual vector corresponding to the estimates returned in coefficients.
  • T.residuals: the residual vector corresponding to the estimates returned in T.coefficients.
  • M.weights: the robust estimate weights corresponding to the final MM-estimates in coefficients, if applies.
  • T.M.weights: the robust estimate weights corresponding to the initial S-estimates in T.coefficients, if applies.

Regarding

what does "optimal" do in lmRob?

Optimal refers to the following psi function:

sign(x)*(- (phi'(|x|) + c) / (phi(|x|) )

For other traditional psi functions, you may wish to look at robustbase's vignette or a robust textbook.