필터 지우기
필터 지우기

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 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