フィルターのクリア

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 Center および File ExchangeDimensionality 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