Polynomial fitting with multiple independent variables

조회 수: 22 (최근 30일)
Oleksandr
Oleksandr 2014년 1월 27일
댓글: Matt J 2014년 1월 29일
Can someone provide example how to perform Polynomial fitting (let's say of 2 or 3-rd order) with multiple independent variables? I have 3 variables: pressure, temperature and concentration (p,t,c) and expectation values of rate of reaction (r) depending on this 3 variables. My question is how to find functional form f(p,t,c)=r and how to perform fitting. (all three variables separetely f(p)=r etc. agree well with linear regresion model).
Thanks a lot

채택된 답변

Matt J
Matt J 2014년 1월 27일
  댓글 수: 12
Oleksandr
Oleksandr 2014년 1월 29일
thank you! and if I may to ask you what is the command to get the actual (fitted) values of the functions , not the coefficients?
Matt J
Matt J 2014년 1월 29일
I see that there is a polyvaln.m that comes with the POLYFITN toolbox.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

dpb
dpb 2014년 1월 27일
편집: Andrei Bobrov 2014년 1월 27일
Z=zeros(size(p)); % intercept term
X=[Z p t c p.*p t.*t c.*c p.*t p.*c t.*c]; % 2nd order design matrix
c=r\X; % LS solution
You will need a good-sized dataset to have sufficient DOF left after estimating all the terms and while it's a good sign that the "one at a time" plots seem to fit reasonably well that doesn't guarantee a good fit overall.
One would wish that Matlab would have all this built into one of the Toolboxes with a resulting ANOVA table and all but afaict while there are some additional tools in Curve Fitting and Stat toolboxes they really didn't build a general regression model toolset a la SAS, say, unfortunately. You're still on your own for that portion AFAIK.
  댓글 수: 2
Oleksandr
Oleksandr 2014년 1월 27일
so what is the expression for function?
dpb
dpb 2014년 1월 27일
Z p t c p.*p t.*t c.*c p.*t p.*c t.*c
In order, as written above the design matrix is
intercept
3 variables
3 quadratic terms
three cross terms
The coefficients will be in that order in the return vector. You can reorder in whatever order suits you.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by