Regression analysis/Data fitting

3 views (last 30 days)
Alexander
Alexander on 8 May 2013
I have an emperical formula RR = P^x Z^y (a + b *V + c *V^2 ). x,y are regression exponents a,b,c are regression constants P,Z,V are variables such that RR=f(P,Z,V)
I have data that relates RR and P,Z,V. Is it possible to fit this data to this particular formulae using matlab 2011? if so are there any similar tuitorial or helpful videos?
Thank you in advance.

Accepted Answer

Matt J
Matt J on 10 May 2013
FMINSPLEAS from the File Exchange would be worth a try
It will let you take advantage of the fact that the equation has a linear dependence on some of your parameters (a,b,c) and nonlinear dependence on other parameters (x,y) to do a more efficient fit.
  3 Comments
Matt J
Matt J on 10 May 2013
Edited: Matt J on 10 May 2013
funlist specifies the nonlinear parts of the terms in the model equation, or if there is a purely linear term, you put funlist{i}=1. So, the above example corresponds to a model equation,
y=A+ B*sin(c(1)*x) + C*cos(c(2)*x)
where the unknowns are A,B,C, c(1) and c(2). The coefficients A,B,C are what the fminspleas documentation calls Intrinsically Linear Parameters (ILP) because the model equation depends on those linearly. Conversely, lower case c is an Intrinsically Non-Linear Parameter (INLP) vector. fminspleas returns these as 2 separate output argument vectors. So, if the fit succeeds, then this
[INLP,ILP] = fminspleas(funlist,[3 4],x,y)
will give you INLP=[2,3] and ILP=[4,-3,2].
Alexander
Alexander on 13 May 2013
Thanks a lot Matt. That was extremly helpful.

Sign in to comment.

More Answers (1)

Matt J
Matt J on 8 May 2013
Edited: Matt J on 8 May 2013
Your equations are linear in the unknowns a,b,c. Use any MATLAB linear equation solver to find them, e.g.,
  7 Comments
Tom Lane
Tom Lane on 10 May 2013
Actually I didn't realize x and y were to be estimated either, but I'm glad you found some approximation that would allow you to proceed.
Alexander
Alexander on 13 May 2013
Thank you Tom for your support. I'm relatively new to matlab and I got to learn a little more about polyfit in the process thanks to you. Fminspleas would be the best choice in my case.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!