aalfons / robustHD

Robust methods for high-dimensional data, in particular linear model selection techniques based on least angle regression and sparse regression.
GNU General Public License v3.0
10 stars 6 forks source link

does rlars have to crash when not using 'fallback'? #33

Open firthunands opened 7 years ago

firthunands commented 7 years ago

Hi there

While trying this mock analysis, 'rlars' crashed

key library

require(robustHD)

fit robust LARS model

require(MASS) # for the dataset View(birthwt) rlars(bwt ~., data=birthwt)

Andreas explained to me what 'fallback' does in the case of this data (the data set has dummy variables). The issue is fixed when typed like this 'rlars(bwt ~., data=birthwt, fallback=T)'

However, this doesn't explain why R crashes when the fallback option isn't set

Comments?

Best

Fernando

aalfons commented 3 years ago

It has been a few years, but I never answered here (from what I remember we had a discussion via email).

The problem is that the MAD, which is used for robust standardization, can fail in some circumstances. The fallback option is to use nonrobust standardization. It is in general safer to give an error rather than using nonrobust standardization as a default fallback.

However, there could be an extra check if the MAD failed because of a dummy variable, which are safe to standardize in a nonrobust way.