| 5 | 1/1 | 返回列表 |
| 查看: 6311 | 回復: 9 | ||||
| 當前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | ||||
[求助]
求助 用matlab擬合三元線性回歸方程及分析
|
||||
|
用matlab擬合三元線性回歸方程,我自己弄了一個如下 x1=[23.00 23.00 23.00 23.00 23.00 28.00 28.00 28.00 28.00 28.00]'; x2=[0.30 0.30 0.30 0.30 0.30 0.10 0.10 0.10 0.10 0.10]'; x3=[0.00 0.69 1.09 1.38 1.61 0.00 0.69 1.09 1.38 1.61]'; y=[-0.91 -0.35 -0.05 0.15 0.29 -0.58 -0.04 0.23 0.41 0.54]; x=[ones(10,1) x1 x2 x3]; >> [b,bint,r,rint,stats]=regress(y,x); ??? Error using ==> or Matrix dimensions must agree. Error in ==> regress at 70 wasnan = (isnan(y) | any(isnan(X),2)); >> b,bint,stats,rcoplot(r,rint) b = 0 -0.0115 -1.7878 0.6751 bint = 0 0 -0.0168 -0.0062 -2.2782 -1.2973 0.5701 0.7800 stats = 0.9747 134.6812 0.0000 0.0059 問題: 1.我編寫的程序?qū)幔?br /> 2.輸入程序中,總是會出現(xiàn)warning的那段文字,不知道怎么修改? |
|
請問y寫成列向量后又出現(xiàn)問題了,這是怎么回事?? >> x1=[23.00 23.00 23.00 23.00 23.00 28.00 28.00 28.00 28.00 28.00]'; x2=[0.30 0.30 0.30 0.30 0.30 0.10 0.10 0.10 0.10 0.10]'; x3=[0.00 0.69 1.09 1.38 1.61 0.00 0.69 1.09 1.38 1.61]'; >> y=[-0.91 -0.35 -0.05 0.15 0.29 -0.58 -0.04 0.23 0.41 0.54]; >> x=[ones(10,1) x1 x2 x3]; >> [b,bint,r,rint,stats]=regress(y,x); Warning: X is rank deficient to within machine precision. > In regress at 82 >> b,bint,stats,rcoplot(r,rint) |
榮譽版主 (著名寫手)
彩色掛圖
![]() |
專家經(jīng)驗: +2 |

榮譽版主 (著名寫手)
彩色掛圖
![]() |
專家經(jīng)驗: +2 |
|
Most likely you have too many predictor variables, and too few observations. As an alaogy, imagine trying to fit a cubic polynomial regression with only two observations. REGRESS will make a choise about which coefficients to set to zero, but it can't possibly know what you really want. 變量太多,你可以試一下,分別使用x(:,1:2), x(:,1:3), x(:,2:3)算一下,使用3列時總會出現(xiàn)一個b=0。 |

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 一志愿鄭大材料工程290求調(diào)劑 +11 | Youth_ 2026-03-30 | 11/550 |
|
|---|---|---|---|---|
|
[考研] 297求調(diào)劑 +17 | 田洪有 2026-03-26 | 18/900 |
|
|
[考研] 08工科,295,接受跨專業(yè)調(diào)劑 +3 | lmnlzy 2026-03-30 | 3/150 |
|
|
[考研] 342求調(diào)劑 +4 | 加油a李zs 2026-03-26 | 4/200 |
|
|
[考研] 0703 化學 求調(diào)劑,一志愿山東大學 342 分 +7 | Shern—- 2026-03-28 | 7/350 |
|
|
[考研] 化學308分調(diào)劑 +7 | 你好明天你好 2026-03-30 | 8/400 |
|
|
[考研] 0703化學 +14 | 妮妮ninicgb 2026-03-27 | 14/700 |
|
|
[考研] 求調(diào)劑 +4 | QiMing7 2026-03-25 | 5/250 |
|
|
[考研] 299求調(diào)劑 +10 | 15188958825 2026-03-25 | 10/500 |
|
|
[考研] 330分求調(diào)劑 +5 | qzenlc 2026-03-29 | 5/250 |
|
|
[考研] 081200-11408-276學碩求調(diào)劑 +6 | 崔wj 2026-03-26 | 6/300 |
|
|
[考研] 071000生物學求調(diào)劑,初試成績343 +7 | 小小甜面團 2026-03-25 | 7/350 |
|
|
[考研] 292求調(diào)劑 +14 | 鵝鵝鵝額額額額?/a> 2026-03-25 | 15/750 |
|
|
[考研] 0703化學求調(diào)劑,各位老師看看我!! +5 | 祁祺祺 2026-03-25 | 5/250 |
|
|
[有機交流]
高溫高壓反應求助
10+4
|
chibby 2026-03-25 | 4/200 |
|
|
[考研] 一志愿鄭大085600,310分求調(diào)劑 +5 | 李瀟可 2026-03-26 | 5/250 |
|
|
[考研] 336材料求調(diào)劑 +7 | 陳瀅瑩 2026-03-26 | 9/450 |
|
|
[考研] 302求調(diào)劑 +4 | 錦衣衛(wèi)藤椒 2026-03-25 | 4/200 |
|
|
[考研] 一志愿吉林大學材料與化工303分求調(diào)劑 +4 | 為學666 2026-03-24 | 4/200 |
|
|
[考研] 340求調(diào)劑 +5 | 話梅糖111 2026-03-24 | 5/250 |
|