Fitlm and regression equations

2 vues (au cours des 30 derniers jours)
John Good
John Good le 30 Nov 2020
I am tring to conduct a fitlm equation on two data sets. One is F which is my independant variables and the other is Rdec which is my dependant variable. I am using the equation:
for i=1:funds;
mdl=fitlm(F,Rdec(:,i));
alpha(i,:)=mdl.Coefficients.Estimate(1)
talpha(i,:)=mdl.Coefficients.tStat(1)
end;
But getting results full of NaN's. My Rdec contains cells that are NaN and I cannot figure out how to remove them, could this be the problem? Is it due to the difference in the size of F and Rdec? Or do I have to define certain parts of the equation before I try compute it?
Thanks
  2 commentaires
John Good
John Good le 30 Nov 2020
I am getting this error:
Warning: Regression design matrix is rank deficient to within machine precision.
> In classreg.regr/CompactTermsRegression/checkDesignRank (line 35)
In LinearModel.fit (line 1048)
In fitlm (line 121)
John Good
John Good le 30 Nov 2020
photo attached for context

Connectez-vous pour commenter.

Réponses (1)

Aditya Patil
Aditya Patil le 22 Déc 2020
As per my understanding, you are facing issue due to NaNs in the data.
You can consider replacing NaNs with a more appropriate value. Depending on the data, this might be zero, average/mean of rest of the values, or some other default value.

Community Treasure Hunt

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

Start Hunting!

Translated by