Data fitting using GLM model

3 ビュー (過去 30 日間)
Jana Ulmanová
Jana Ulmanová 2022 年 1 月 4 日
回答済み: John D'Errico 2022 年 1 月 4 日
Hello,
I need to fit data with this dependece r(H10,T,P,t)=a0(H10)+a1*t+a2*t^2+ a3*T+a4*P+a5 and I would like to use GLM.
I am struggling with the very beginning. Could you possible give me a hint how to fit data with 4 different dependencies and obtaint a1..a5 ?
Thank you.
  1 件のコメント
John D'Errico
John D'Errico 2022 年 1 月 4 日
Is A0 a FUNCTION of H10? Or have you forgotten to put a * in there to denote multiplication. Is there a way that we should know this by looking at your question? (NO.)

サインインしてコメントする。

採用された回答

John D'Errico
John D'Errico 2022 年 1 月 4 日
Trivial.
Well, trivil, If we assume that A0(H10) was actually intended as A0*H10.
r(H10,T,P,t)=a0*H10 + a1*t + a2*t^2 + a3*T + a4*P + a5
First, set up a matrix. Assuming you have variables, as COLUMN vectors, for the variables: H10, T, P, t and r.
n = numel(H10);
M = [H10,t,t.*t,T,P,ones(n,1)];
a012345 = M\r;
The vector a012345 will contain the coeffiicients you wish to find.
You could also use tools from the stats toolboix, such as regress, etc.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by