| 查看: 3410 | 回復(fù): 15 | ||||
monitor2885至尊木蟲 (職業(yè)作家)
隊長
|
[求助]
求廣義線性模型GLM的函數(shù)表達(dá)式 已有1人參與
|
|
y=b0+b1*x1+b2*x2+b3*sin(x3) y=[7.1;4.1;5.2;6.3]; x1=[1;2;3;4]; x2=[100;205;306;150]; x3=[8;10;12;5]; link 函數(shù)是 normal,求 glmfit 的表達(dá)式,求 b0, b1, b2, b3,謝謝。 |

專家顧問 (正式寫手)
![]() |
專家經(jīng)驗: +52 |

至尊木蟲 (職業(yè)作家)
隊長

專家顧問 (正式寫手)
![]() |
專家經(jīng)驗: +52 |
|
我不太明白就是link函數(shù)是normal是什么意思,我用matlab非線性擬合幫你求出參數(shù) y=[7.1;4.1;5.2;6.3]; x1=[1;2;3;4]; x2=[100;205;306;150]; x3=[8;10;12;5]; x=[x1 x2 x3]; f=@(b,x)b(4)+b(1)*x(:,1)+b(2)*x(:,2)+b(3)*sin(x(:,3)) b0=[0 0 0 0]'; opt=optimset('TolFun',1e-3,'TolX',1e-3); [b R]=nlinfit(x,y,f,b0,opt) 最后求得b的數(shù)組 |

至尊木蟲 (職業(yè)作家)
隊長

專家顧問 (正式寫手)
![]() |
專家經(jīng)驗: +52 |
|
實際上b = glmfit([x1 x2 sin(x3)],y)也就可以出結(jié)果了,我猜想廣義線性模型中的Y=b0+b1*x1+b2*x2+b3*x3,其中用sin(x3)來代替x3這才適用模型,所以你最開始b = glmfit([x1 x2 x3],y,'normal','link','normal')這樣直接用x3就有問題,不符合模型假設(shè) b = glmfit([x1 x2 sin(x3)],y,'normal','link','identity')這個格式也是可以的 函數(shù)格式為b = glmfit(X,y,distr,param1,val1,param2,val2,...),distr can be any of the following strings: 'binomial', 'gamma', 'inverse gaussian', 'normal' (the default), and 'poisson'. b = glmfit(X,y,distr,param1,val1,param2,val2,...) additionally allows you to specify optional parameter name/value pairs to control the model fit. Acceptable parameters are as follows. 從matlab函數(shù)解釋中看出,param參數(shù)是來優(yōu)化distr分布的,你要注意寫全了,要么就都缺省讓函數(shù)內(nèi)在保持一致,用b = glmfit([x1 x2 sin(x3)],y),要么就都寫全了,用b = glmfit([x1 x2 sin(x3)],y,'normal','link','identity') |

專家顧問 (正式寫手)
![]() |
專家經(jīng)驗: +52 |

至尊木蟲 (職業(yè)作家)
隊長
|
你看stats,哪個是significance? stats is a structure with the following fields: beta — Coefficient estimates b dfe — Degrees of freedom for error s — Theoretical or estimated dispersion parameter sfit — Estimated dispersion parameter se — Vector of standard errors of the coefficient estimates b coeffcorr — Correlation matrix for b covb — Estimated covariance matrix for B t — t statistics for b p — p-values for b resid — Vector of residuals residp — Vector of Pearson residuals residd — Vector of deviance residuals resida — Vector of Anscombe residuals |

專家顧問 (正式寫手)
![]() |
專家經(jīng)驗: +52 |

至尊木蟲 (職業(yè)作家)
隊長

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 一志愿北京化工大學(xué) 070300 學(xué)碩 336分 求調(diào)劑 +5 | vv迷 2026-03-22 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 303求調(diào)劑 +5 | 安憶靈 2026-03-22 | 6/300 |
|
|
[考研] 354求調(diào)劑 +7 | Tyoumou 2026-03-18 | 10/500 |
|
|
[考研] 384求調(diào)劑 +3 | 子系博 2026-03-22 | 4/200 |
|
|
[考研] 085600材料與化工306 +4 | z1z2z3879 2026-03-21 | 4/200 |
|
|
[考研] 280求調(diào)劑 +11 | 咕嚕曉曉 2026-03-18 | 12/600 |
|
|
[考研] 材料學(xué)碩301分求調(diào)劑 +7 | Liyouyumairs 2026-03-21 | 7/350 |
|
|
[考研] 化學(xué)調(diào)劑 +5 | yzysaa 2026-03-21 | 5/250 |
|
|
[考研] 考研調(diào)劑 +3 | 呼呼?~+123456 2026-03-21 | 3/150 |
|
|
[基金申請]
學(xué)校已經(jīng)提交到NSFC,還能修改嗎?
40+4
|
babangida 2026-03-19 | 9/450 |
|
|
[考研] 265求調(diào)劑 +12 | 梁梁校校 2026-03-19 | 14/700 |
|
|
[考研] 070300化學(xué)319求調(diào)劑 +7 | 錦鯉0909 2026-03-17 | 7/350 |
|
|
[考研] 301求調(diào)劑 +10 | yy要上岸呀 2026-03-17 | 10/500 |
|
|
[考研] 一志愿西南交大,求調(diào)劑 +5 | 材化逐夢人 2026-03-18 | 5/250 |
|
|
[考研] 321求調(diào)劑 +9 | 何潤采123 2026-03-18 | 11/550 |
|
|
[考研] 304求調(diào)劑 +7 | 司空. 2026-03-18 | 7/350 |
|
|
[考研] 考研調(diào)劑求學(xué)校推薦 +3 | 伯樂29 2026-03-18 | 5/250 |
|
|
[考研] 329求調(diào)劑 +9 | 想上學(xué)吖吖 2026-03-19 | 9/450 |
|
|
[考研] 353求調(diào)劑 +3 | 拉鉤不許變 2026-03-20 | 3/150 |
|
|
[考研] 085410人工智能專碩317求調(diào)劑(0854都可以) +4 | xbxudjdn 2026-03-18 | 4/200 |
|