Multiple Linear Regression using fitlm function
古いコメントを表示
Hello Sir, why i am not getting the intercept for the other variables?
>> lm=fitlm(X,TAG)
Warning: Regression design matrix is rank deficient to within machine precision.
> In classreg.regr.CompactTermsRegression/checkDesignRank (line 35)
In LinearModel.fit (line 1237)
In fitlm (line 121)
lm =
Linear regression model:
y ~ 1 + x1 + x2 + x3 + x4 + x5 + x6 + x7
Estimated Coefficients:
Estimate SE tStat pValue
__________ __ _____ ______
(Intercept) 0 0 NaN NaN
x1 0 0 NaN NaN
x2 0.00037516 0 Inf NaN
x3 0.00021467 0 Inf NaN
x4 -0.16078 0 -Inf NaN
x5 0.68268 0 Inf NaN
x6 -0.0013354 0 -Inf NaN
x7 0 0 NaN NaN
Number of observations: 5, Error degrees of freedom: 0
R-squared: 1, Adjusted R-Squared: NaN
F-statistic vs. constant model: NaN, p-value = NaN
採用された回答
その他の回答 (2 件)
Image Analyst
2020 年 1 月 18 日
Why not do
coefficients = y \ x;
where y and x are tall matrices that have your observation values listed? (Or maybe it's y/x - I don't know which off the top of my head.)
andres santiago
2025 年 2 月 28 日
0 投票
Undefined function 'fitlm' for input arguments of type 'double'. buenos dias me sale lo anterior como podria solucionar
1 件のコメント
Star Strider
2025 年 2 月 28 日
編集済み: Star Strider
2025 年 2 月 28 日
@andres santiago — It’s a Statistics and Machine Learning Toolbox function. You have to have it licensed and installed in order to use its functions.
If you have it licensed and installed, you may have a path problem. In that instance, run these:
restoredefaultpath
rehash toolboxcache
A Vote would be appreciated!
.
EDIT — Corrected typographical errors.
カテゴリ
ヘルプ センター および File Exchange で Linear Predictive Coding についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!