Multidimensional surface fitting to n independent variables.
26 views (last 30 days)
Show older comments
Nishanth Rao
on 12 Apr 2020
Answered: Thiago Henrique Gomes Lobato
on 12 Apr 2020
Hello all. I have a set of 16 independent variables . Based on these 16 independent variables, i conduct some experiment, and observe an output y such that where is some unknown function. I conduct the experiment several times, and gather some data . Can i fit a multidimensional surface on this data to find an approximate structure of in continuous form, just like a single dimension curve fitting? Can I use the command fit or lsqcurvefit for this purpose? Thank you so much for your time.
0 Comments
Accepted Answer
John D'Errico
on 12 Apr 2020
Some common misunderstandings in this...
First, you cannot use fit on problems with more than 2 independent parameters. 16 is not an option, nor I doubt, it will be anytime soon. You could, in theory, use lsqcurvefit, with a massive caveat.
Use of lsqcurvefit REQUIRES, ABSOLUTELY requires a model. Do you have some proposed model? That does not appear to be true. So, unless your surface were to be a trivially simple one, perhaps a hyper-plane, then where are you going? And if your surface were something utterly trivial like that, then you could use backslash to solve the problem in theory.
Could you use a tool like my polyfitn (found on the file exchange)? I imagine someone will eventually recommend it to you. However, unless your model was truly a linear one, it will get complicated and messy. For example, a fully quadratic polynomial model in 16 variables will have something like
n = 16;
1 + n + n*(n+1)/2
ans =
153
so 153 terms in it. And nothing ever seems to be as simple as a quadratic. Plus, you would need significantly more than that number of data points, and odds are your data will not have been chosen well to build that model, at least not unless you have some expertise in the statistical design of experiments. Most people don't, so they show up with useless data for this purpose, and then wonder why they have a problem. (Sorry, but this is often the case. And if you have no idea how to build/estimate a model in more than 1 dimension, then you are surely in that set of people.) In the end, please don't try to use polyfitn on this problem, as then you will just come running to me to ask why it did not work well on your problem. Sorry.
What can you do? You might find a dimensionality reduction tool, on the order of PCA, to be of value here. You may also find neural net techniques to be of value, as they can do some of the "thinking" for you. You may even find data mining techniques to be of some benefit in this. The cost of course, if you will need to learn tools in other domains that may be foreign. Essentially, you need to learn to use a tool, learn how it works, learn to understand the tool, to be able to use that tool effectively.
Yes, I know, it may seem like I've just told you to investigate some totally foreign tools, without knowingly telling you if they will be useful to you. But look at it from my point of view. You've asked someone to tell you how to solve a vague problem, where we have been given no clue how good your data is for that purpose. All we really know is it is a big problem, so you will need to use tools that can handle high-dimenisional data. Do you have sufficient data? Is it good enough? God only knows.
So perhaps my best recommendation is to find a statistician who will consult for you. Find someone with expertise in this class of problem. (In these days of isolation, that may be more difficult, but such is life.) Show them exactly what you have. Then ask that individual to recommend a course forward. Their answer may be to get better data, as it often should be.
0 Comments
More Answers (1)
Thiago Henrique Gomes Lobato
on 12 Apr 2020
You first have to define which kind of function you would like to build. lsqcurvefit can surely be used, but you first have to define the structure of your function/model. The easiest model/approach is to use a multiple linear regression , but you can go further to non-linear equations until neural networks. Thus first try to define how your model should look like and then fit it accordingly with a linear combination, lsqcurvefit (in case of a non-linear equation) or even machine learning methods such as Gaussian Process.
0 Comments
See Also
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!