Warning: Regression design matrix is rank deficient to within machine precision.

I'm getting this error when I'm trying to do a regression analysis with the function 'model_output = fitlim'. I read somewhere online that it may be due to too many variables (it's a lot in the thousands) but shouldn't Matlab be able to handle it? I'm very new to Matlab just this week so don't have a lot of experience with the software.
I tried to only using about 30 variables and then the function worked but I absolutely need to be able to do with all of my variables. The variables originate from Excel sheets which I only have done log function on beforehand.

4 Comments

Did you consider that the warning can be serious? If there is a problem with the rank of the matrix, than you might use the wrong approach to solve the problem. But perhaps a scalaing would solve the problem. Without knowing any details, this is hard to decide.
A warning is something I would consider serious absolutely. As I said, I have little experience with Matlab. I'm a student and trying to use code which my supervisor recommended but maybe we will have to revise and use something different then.
As Jan alludes to, the problem here is likely not Matlab but the underlying data. How many variables versus how many observations do you have? Does that tell you something?
Is it necessary to normalize all the design variables between 0 and 1 before trying to use fitglm?

Sign in to comment.

Answers (0)

Products

Asked:

on 25 Apr 2017

Commented:

on 27 Jul 2017

Community Treasure Hunt

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

Start Hunting!