필터 지우기
필터 지우기

Fitlm and regression equations

조회 수: 3 (최근 30일)
John Good
John Good 2020년 11월 30일
답변: Aditya Patil 2020년 12월 22일
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
John Good
John Good 2020년 11월 30일
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 2020년 11월 30일
photo attached for context

댓글을 달려면 로그인하십시오.

답변 (1개)

Aditya Patil
Aditya Patil 2020년 12월 22일
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.

카테고리

Help CenterFile Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by