How to generate a regression fit of a 2D surface from 4D data

3 Ansichten (letzte 30 Tage)
William
William am 18 Dez. 2014
Kommentiert: William am 19 Dez. 2014
Hi All, First time posting so please forgive etiquette errors.
I have been using polyfitn to generate a regression fit of 3D noisy data onto a 2D surface. I have also been using polyfitn to generate a regression fit of 4D noisy data onto a 3D surface.
However I now want to fit 4D noisy data onto a 2D surface. Unfortunately I cannot find reference to any matlab functions which will support this. As far as I can see I will need a parametric surface (<http://en.wikipedia.org/wiki/Parametric_surface>) but have been unable to form a method that will make the matlab functions fit to it.
A third or fourth order polynomial is expected to give a reasonable fit to the function as it is not very far from a plane, but it is actually an exponential function a*e^( m*x+c). We have around a million data points in the range roughly 0.5 - 1.0 on each axis.
Can anyone make some suggestions about how I can go about generating this fit?
(Edit: Further Clarification of data available)
  4 Kommentare
John D'Errico
John D'Errico am 18 Dez. 2014
You will notice that I have not chosen to answer this question. :)
I did once attempt a general code that would take a set of (noisy) data in n dimensions and attempt to find a k-manifold (for specified k) that represented the data. You won't find anything posted on the FEX though, as I had no real success in the endeavor.
Your problem is one of a general nonlinear errors in variables class. I also worked on one of these problems long ago for a client. I was never really happy with the result there either. Planar fits are fine for this problem using the SVD, but beyond that point, it gets nasty when things are nonlinear.
So were I to try to solve what I understand so far of your problem, I would think of starting with a very coarse triangulated mesh in the 4-d domain space of your data. In my thoughts this would be no more than two triangles, floating in that R^4 domain.
For each point in your point cloud, compute the distance to the closest point on this triangulated 2-manifold. Think of that as a spring, connecting these fixed points to your manifold. You can think of those springs as exerting a force on the manifold which is proportional to the square of the extension of those springs. (Basic mechanics tells us that springs store potential energy as a function of the square of their extension.) Now, use a SOR-like scheme to relax the triangulated mesh to have minimum potential energy. You could also add in an energy term that would penalize a mesh that was highly curved. Relax the mesh until the system is at a minimum potential energy state. Then look for areas (triangles in the mesh) where the mesh appears to have points that lie at a long distance from the mesh, and refine the triangulation in those regions. Repeat the relaxation step until you are happy with the results.
Overall, not trivial to write, and long to run on a zillion points, but potentially doable.
William
William am 19 Dez. 2014
Hi John,
I think you are right. A linear fit would be fairly straight forward. I like your solution of a spring balancing system, I'll have a think about the practicalities.
Thank you, you have been very helpful.
Cheers,
Will

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Least Squares finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by