least squares surface fitting with a non-polynomial function

3 views (last 30 days)
I apologise if this is an obvious or previously answered question, I have spent some time searching for an answer and I could not find one, perhaps because I do not fully understand the capabilities of the existing least squares solvers.
I am trying to fit a surface to my data (two independent variables, one dependent) and I am not sure exactly what form the surface should take. I know that there exist functions that will fit a polynomial surface to multidimensional datasets but I don't understand which function is most appropriate for use in my case.
I know that the surface takes the general form z = A.exp(Bx) where A and B vary as a function of y. I do not know exactly how they vary and want to try several possibilities, starting by assuming that both A and B vary linearly in y (but I also want to try e.g. polynomial relationships between A, B and y), i.e. initially fitting a surface of the form z = (ay + b).exp((cy + d)x).
In this case I want to find the values of a-d that minimise the sum of squares between this function and my data. I'd be very grateful if someone could suggest a way to achieve this.

Accepted Answer

Matt J
Matt J on 19 Aug 2014
You could apply lsqcurvefit to any of the model variations you've described. It might be worth looking at FMINSPLEAS, however. FMINSPLEAS can take advantage of the fact that z depends linearly on some of the parameters (a and b in your example). Although, if you have more than 6 nonlinear parameters, you might be pushing the limitations of the tool, since optimization of those parameters relies on Nelder-Mead.
  1 Comment
David
David on 20 Aug 2014
Many thanks, I should have mentioned that I don't have the optimisation toolbox, but in any case fminspleas is working well.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!