sistm / LongituRF

Random forests for longitudinal data using stochastic semiparametric miced-model
10 stars 5 forks source link

REEMForest() 'Error in solve.default(S1) : Lapack routine dgesv: system is exactly singular:' #3

Open JustGettinStarted opened 3 years ago

JustGettinStarted commented 3 years ago

REEMForest() consistently produces an error with with several different datasets. Seems to be coming from solve() in moy() functions. This appears to be common problem. See https://stackoverflow.com/questions/66188123/implementing-longitudinal-random-forest-with-longiturf-package-in-r and answer 1 to https://stats.stackexchange.com/questions/103730/how-can-i-include-random-effects-or-repeated-measures-into-a-randomforest

Chhr1s commented 3 years ago

Hi @JustGettinStarted,

I've been working with LongituRF for a project over the past week and had the same problem as you.

I modified the function and had it print in-between steps. It seems (for me) the issue was with the output from calling the internal function LongituRF:::logV().

I looked at the data from the simulated case, as that was working just fine for me. I tried centering and scaling the continuous predictors and everything worked for me! Try applying that.

If you're trying to be very rigorous, care should be taken to prevent leakage of information between training and test sets during the scaling process.

More helpful warning messages would be a big improvement here.

Chhr1s commented 3 years ago

I'm going to come back to this and say I got REEMforest() to work in really specific cases, but I've run into this many more (if not most) times as I keep working with it. Same error @JustGettinStarted described above.

MERF() appears to have fewer problems.

isaactpetersen commented 1 month ago

I run into this issue every time as well, including with MERF().