| 查看: 3409 | 回復: 15 | ||||
monitor2885至尊木蟲 (職業(yè)作家)
隊長
|
[求助]
求廣義線性模型GLM的函數(shù)表達式 已有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 的表達式,求 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ā)表 | |
|---|---|---|---|---|
|
[考研] 287求調(diào)劑 +8 | 晨昏線與星海 2026-03-19 | 9/450 |
|
|---|---|---|---|---|
|
[考研] 求調(diào)劑 +6 | 十三加油 2026-03-21 | 6/300 |
|
|
[考研] 275求調(diào)劑 +6 | shansx 2026-03-22 | 8/400 |
|
|
[考研] 考研調(diào)劑 +3 | 呼呼?~+123456 2026-03-21 | 3/150 |
|
|
[考研] 求調(diào)劑 +4 | 要好好無聊 2026-03-21 | 4/200 |
|
|
[考研] 材料學碩333求調(diào)劑 +3 | 北道巷 2026-03-18 | 3/150 |
|
|
[考研] 22 350 本科985求調(diào)劑,求老登收留 +3 | 李軼男003 2026-03-20 | 3/150 |
|
|
[考研] 一志愿山大07化學 332分 四六級已過 本科山東雙非 求調(diào)劑! +3 | 不想理你 2026-03-16 | 3/150 |
|
|
[考研] 307求調(diào)劑 +3 | wyyyqx 2026-03-17 | 3/150 |
|
|
[考研] 299求調(diào)劑 +6 | △小透明* 2026-03-17 | 6/300 |
|
|
[考研] 265求調(diào)劑 +9 | 梁梁校校 2026-03-17 | 9/450 |
|
|
[考研] 求調(diào)劑 +3 | Ma_xt 2026-03-17 | 3/150 |
|
|
[考研] 一志愿蘇州大學材料求調(diào)劑,總分315(英一) +5 | sbdksD 2026-03-19 | 5/250 |
|
|
[考研] 290求調(diào)劑 +7 | ^O^乜 2026-03-19 | 7/350 |
|
|
[考研] 085410人工智能專碩317求調(diào)劑(0854都可以) +4 | xbxudjdn 2026-03-18 | 4/200 |
|
|
[考研] 求調(diào)劑 +3 | 暗涌afhb 2026-03-16 | 3/150 |
|
|
[考研] 生物學調(diào)劑招人。! +3 | 山海天嵐 2026-03-17 | 4/200 |
|
|
[考研] 288求調(diào)劑,一志愿華南理工大學071005 +5 | ioodiiij 2026-03-17 | 5/250 |
|
|
[考研] 0854可跨調(diào)劑,一作一項核心論文五項專利,省、國級證書40+數(shù)一英一287 +8 | 小李0854 2026-03-16 | 8/400 |
|
|
[考研] 277調(diào)劑 +5 | 自由煎餅果子 2026-03-16 | 6/300 |
|