フィルターのクリア

Fitlm results not obtainable

29 ビュー (過去 30 日間)
John Good
John Good 2020 年 11 月 30 日
コメント済み: Walter Roberson 2020 年 12 月 1 日
When I try to run the equation with two variables, one 83x370 (Rdec) and the other 83x8 (F) I get this error:
>> mdl=fitlm(F,Rdec)
Error using classreg.regr.FitObject/selectVariables (line 351)
Response variable must be a numeric vector.
Error in classreg.regr.TermsRegression/selectVariables (line 259)
model = selectVariables@classreg.regr.ParametricRegression(model);
Error in classreg.regr.FitObject/doFit (line 91)
model = selectVariables(model);
Error in LinearModel.fit (line 1043)
model = doFit(model);
Error in fitlm (line 121)
model = LinearModel.fit(X,varargin{:});
I have NaN values in my 83x370 but cant remove them whilst maitining the shape of the matrix. I have loaded the F and Rdec as numeric matrixes. Any help would be appreciated.
  4 件のコメント
John Good
John Good 2020 年 11 月 30 日
My F is my factor data of managers of 83 funds. My Rdec is the fund returns over 25 years for those 83 funds
Jeff Miller
Jeff Miller 2020 年 12 月 1 日
What are the 370 variables in Rdec? Are these fund returns at various time points within the 25 years?

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 11 月 30 日
The response variable must be a vector . Not a matrix.
If your intention is that you want to fit the 370 different responses for the same data, then you need to do so one response (column) at a time.
  4 件のコメント
Jeff Miller
Jeff Miller 2020 年 12 月 1 日
I think your 'for' loop would basically work, assuming 'i' would go from 1 to 370 (though I'm not sure what these 370 represent).
However, I would think that you would want to save coefficients for all 8 factors, not just the first one.
Given what you want to do, it seems to me that your best bet is to form some kind of composite measure of fund performance combining across all 370 variables, and then just look at a single regression predicting that composite from your 8 fund manager factors.
Walter Roberson
Walter Roberson 2020 年 12 月 1 日
The loop looks plausible.

サインインしてコメントする。

カテゴリ

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