How to avoid mnrfit errors (line 117) and eps?

2 views (last 30 days)
Sina Famili
Sina Famili on 21 May 2018
Answered: Benjamin Brennan on 24 Oct 2018
I defined my predictor variables and response one. When I want to do a multinomial regression fit (mnrfit), I face these error:
Error using eps Class must be 'single' or 'double'.
Error in mnrfit (line 117) tolpos = eps(class(x))^(3/4);
What should I do?

Answers (2)

Walter Roberson
Walter Roberson on 21 May 2018
What is class() of the first parameter you passed into mnrfit() ? If it was logical() then you will need to pass in double() of the variable.
  1 Comment
Sina Famili
Sina Famili on 21 May 2018
The class was Categorical. I just changed it to Numbers (double), still the same problem.

Sign in to comment.

Benjamin Brennan
Benjamin Brennan on 24 Oct 2018
Why is all the advice on this problem awful? The X variables I'm passing to mnrfit is a matrix of nothing but doubles. The Y variable is categorical, which is exactly what the Matlab documentation on the function says it should be.





Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!