Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add an option to skip remove.lindep() #225

Closed
shangzhi-hong opened this issue Mar 14, 2020 · 7 comments
Closed

Please add an option to skip remove.lindep() #225

shangzhi-hong opened this issue Mar 14, 2020 · 7 comments

Comments

@shangzhi-hong
Copy link

Please add option to skip the call to remove.lindep() in the sampler.univ() function.
I understand it is necessary for most models, but for methods like random-forest-based ones, it may not be necessary.
It causes errors when I do simulations, and I found it impossible to skip it.

Thanks.

@stefvanbuuren
Copy link
Member

Did you already try something like mice(data, maxcor = 1.0, eps = 0)?

This will set the maxcor and eps arguments of remove.lindep() to its extremes, and hence all variables will pass.

This is a dangerous option. The setting could crash mice() due to numerical difficulties if collinearity is not properly handled.

@gerkovink
Copy link
Member

For many such numerical difficulties, the estimation will fall back to ridge regression for at least the default methods. If this happens, the logged events will notify the users about this expected behaviour.

@shangzhi-hong
Copy link
Author

Did you already try something like mice(data, maxcor = 1.0, eps = 0)?

This will set the maxcor and eps arguments of remove.lindep() to its extremes, and hence all variables will pass.

This is a dangerous option. The setting could crash mice() due to numerical difficulties if collinearity is not properly handled.

Thanks, I am not aware of this combination of paramters (did not see the ... in the function call), sorry
I am aware of the consequences, but I am doing experiments with machine-learning-based methods (like CART, RF, etc.), I believe that the are robust against collinearity

@shangzhi-hong
Copy link
Author

It seems that the remove.lindep function has following lines:

  if (eps <= 0)
    stop("\n Argument 'eps' must be positive.")

that eps = 0 would not pass this check

@shangzhi-hong
Copy link
Author

I am wondering whether eps = .Machine$double.xmin or eps = .Machine$double.eps would do the trick

@stefvanbuuren
Copy link
Member

stefvanbuuren commented May 7, 2020

mice 3.8.4 tweaks remove.lindep() as follows.

  # setting eps = 0 bypasses remove.lindep()
  if (eps == 0) 
    return(rep.int(TRUE, ncol(x)))
  if (eps < 0)
    stop("\n Argument 'eps' must be positive."

You should now be able to bypass remove.lindep() by setting mice(..., eps = 0).

@shangzhi-hong
Copy link
Author

Thanks, I will change my code accordingly

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants