Hi, I'd like to adjust a set of points to an expression like this "E=c1*H+c2​*H*T^(-2)+​c3*T", please help!!...Thanks

2 ビュー (過去 30 日間)
Fred
Fred 2014 年 7 月 10 日
回答済み: Star Strider 2014 年 7 月 10 日
"E=c1*H+c2*H*T^(-2)+c3*T"
where
E,H,T are variables c1, c2, c3 are the regression coefficients
I have all the data necessary of the three variables from a 1 month period, I'd like to know how to obtain the regression coefficients I think that it's a multiple non linear regression but, I don't know what functions of matlab I could use, I'll be thankful for your help.
Thank you very much!!

回答 (2 件)

Brian B
Brian B 2014 年 7 月 10 日
This is a linear regression problem, since it is linear in the coefficients. Assuming E, H, and T are column vectors, you might simply try:
R = [H H.*T.^(-2) T];
c = R\E;
This finds the least-squares solution for the linear equation E = R*c.

Star Strider
Star Strider 2014 年 7 月 10 日
See if this example does what you want:
H = randi(10, 5, 1); % Define H
T = randi(10, 5, 1)+10; % Define T
c = [3 5 7]'; % Define c
X = [H H./(T.^2) T]; % Design matrix
Y = X*c + 0.1*rand(5,1); % Create dependent variable + noise
c = X\Y % Solve for coefficients
If you have the Statistics Toolbox, see the documentation for the LinearModel class.

カテゴリ

Help Center および File ExchangeRegression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by