필터 지우기
필터 지우기

Fitlm error with predictor and response variables

조회 수: 7 (최근 30일)
John Good
John Good 2020년 12월 4일
댓글: Ive J 2020년 12월 19일
I am trying to run a regression model on 83 funds and their returns. I have started by dividing them by 100 then subtracting the risk free rate. I am using fama french 6 factor model. I have attached photos for context, R1 is my returns, ff5 is my factor model, Rf is my risk free rate. Any help in understanding why I am getting the error regardign predictor and resposne variables would be apprecaited, when using the fama french 6 model factor how do I integreate this into my analysis. Thanks
  댓글 수: 6
John Good
John Good 2020년 12월 5일
any ideas Ive Ive?
Ive J
Ive J 2020년 12월 19일
Sorry I haven't received any MATLAB notification on this post.
Please share your data properly (not as image). Show you code also and the output you get from MATLAB. For instance,
x = rand(10, 2); % test predictor
y = rand(10, 1); % test reponse
mdl = fitlm(x, y)
Linear regression model:
y ~ 1 + x1 + x2
Estimated Coefficients:
Estimate SE tStat pValue
_________ _______ ________ _______
(Intercept) 0.4717 0.25349 1.8609 0.10508
x1 -0.087938 0.33145 -0.26532 0.79841
x2 0.010793 0.31584 0.034172 0.97369
Number of observations: 10, Error degrees of freedom: 7
Root Mean Squared Error: 0.27
R-squared: 0.0112, Adjusted R-Squared: -0.271
F-statistic vs. constant model: 0.0397, p-value = 0.961
Your image simply shows your design matrix is rank deficient (test stats are NaN or Inf), so either your data is problematic or the way you process them. That's why it's crucial to show all details/information you can when you ask a question.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Multivariate Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by