MATLAB Answers

Multi-parametric fit with matlab

3 views (last 30 days)
Hi everyone! My question is as follows:
I have several experimental data, X. X is dependent of 4 different independent variables; X=f(A,B,C,D), which are experimental data too. What I want is the expression of the multi-parametric fit; which I have to “guess” with my data. For example, in the end, I could write X like
X=A*log(B)^C+D/2, or
X=A^3/B+C*exp(D), or X=B*D…that is what I want to know.
How can I fit them? For example, if I had only X and A, maybe the relation would be like X=A^3 (easily to do with cftool). But what I want to get is a multi-parametric fit.
Is that possible to be done? Is there any toolbox that may help me? I thought about a procedure, but it’s pretty biased. For example, to hit the mark we can use dimensional analysis, but it has some limitations. Also, we can do: X=(A^a)*(B^b)*(C^c)*(D^d)
and fitting with experimental data, finding the coefficients a,b,c,d that minimize the error (an iterative process where we can use nlinfit with its least-squares, or Nelder–Mead Method). But, as you see, limitations are huge. What I want to know is if there is a toolbox that links the behave of the variables, trying and iterating with different function s to reach the best expression for X with its four variables.
I think I am asking too much, and maybe there’s no toolbox that does exactly that…but if there’s any m file you know that would help me to get the most out of calculating whit matlab in this situation (as nlinfit does) I would be very pleased.
Any ideas are welcome. Thanks in advance.
Miguel Ángel
Miguel Ángel on 5 Apr 2012
Thanks Greg,it's a large procedure but it's a good beginning.

Sign in to comment.

Accepted Answer

Richard Willey
Richard Willey on 5 Apr 2012
Hi Miguel
fitensemble is able to handle multiple independent variables. You should be able to use this with the data set that you described.
From my perspective, the easiest way to explain nonparametric fitting to a relatively non technical audience is to describe localized regression. You can use this technique to illustrate the basic concepts. You won't be able to use localized regression to solve your problem (the algorithm doesn't scale well with large numbers of independent variables, but the basic intuition remains the same)
I have some good slides that describe how a combination of localized regression, cross validation, and bootstrap. Drop me an email at and I'll fire these off to you.

More Answers (1)

Richard Willey
Richard Willey on 4 Apr 2012
Hi Miguel
From the sounds of things, your central problem is that you're unable to specify an equation that describes the relationship between your variables.
My recommendation would be to use a non-parametric fitting techniques. With a continuous response variable you could use the boosted / bagged decision trees in Statistics Toolbox. Alternatively, if you prefer you can also use a Neural network to solve the same problem. The following url will take you tot he documentation for "fitensemble"
In some cases, you might prefer to use a semi-parametric modeling technique. Assume that you can't specify an equation that describes the relationship between your variables, however, you still have some idea what's going on (Perhaps you know that the first derivative of your curve is positive. Alternatively, you know that there is an inflection point located at the following location). In this case, you're probably better off using John D'Errico's Shape Language Modelling code:
  1 Comment
Miguel Ángel
Miguel Ángel on 5 Apr 2012
Thank you so much, Richard. I’ve been checking the model you left me, but I think it’s for one variable. In spite of these, what I like the most is that you can constrain the system, and study each parameter separately would help me.
My area of knowledge is civil engineering, and I am doing my final project. Most of the examining board isn’t familiarized with non-parametric techniques (me too). But recently, I’ve taken part in a webminar about this, and since then I decided to add this method as a part of my project. Which you think is the friendliest method to understand, explain to the board and execute with Matlab? Maybe Neural, with its Neural Network in Matlab?
Thaks again for your help.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!