MATLAB 3D Data Fitting: Find Center & Axes Directions

In summary, the conversation discusses methods for finding the center and axes directions of an ellipsoid that best fits a set of samples with small white gaussian noise in 3D space. The suggested approach involves calculating the covariance matrix and finding its eigenvectors and eigenvalues. However, there are concerns about the possibility of the best-fit quadric being a hyperboloid or other shape. Alternative approaches, such as using an optimization problem with constraints or expressing equations parametrically and using orthogonal least squares, are also mentioned. The conversation also touches on the properties of multivariate Gaussian distributions and their relationship to the best-fit ellipsoid.
  • #1
fenestren
9
0
Hi.

I have a set of samples with small white gaussian noise that form a small part of an ellissoid in 3D space.
I'm looking for a way to find the center and the axes directions of the ellipsoid that best fits these samples.

This is an overdetermined problem with much more 3d points than unknows: I tried with a least squares such as:

X = [H'*H]\H'*w (the pseudoinverse)

but it doesn't seem to work (I often obtain another not ellipsoidal quadric).

Can you help me, please?

Thanks.
Luca.
 
Physics news on Phys.org
  • #2
Try calculating the 3x3 covariance matrix of the data set, then find its eigenvectors and eigenvalues. The former are the principal axes, the latter are (I think) the variances along each axis. The square roots of the e-vals will define the ellipsoid. Finding the center is easy: take the mean of the data along each axis.
 
  • #3
Thank you for your reply.
The problem is avoiding the best fitting quadric to be an hyperboloid or other than an ellipsoid.

Is there a solution for that such as an optimization problem with any constraints?
 
  • #4
My proposed approach is not a fit.
 
  • #5
If I'm not wrong, the kind of quadric depends on the sign of eigenvalues and, to have an ellipsoid, they must be all positive, doesn't it?

Is there a way to avoid having non-positive eigenvalues?

Is it maybe possible using a conditioned fitting?

Thank you.
 
  • #6
Maybe the following link will help:

http://www.geometrictools.com/Documentation/LeastSquaresFitting.pdf

I've dabbled in least squares fitting of 2D conics and found that expressing the equations parametrically and using orthogonal least squares seems to work (iterative approach). If you assume the ellipsoid axes aren't rotated, I'd think the approach would be straightforward (easy to say since I haven't done it!), though even if the axes are rotated the consequence is to add another 3 variables that need to be determined.

http://mathworld.wolfram.com/Ellipsoid.html
 
Last edited:
  • #7
I think that if your data are real and three-dimensional, then the covariance matrix will be positive definite. (I'm not a mathematician, so I'm not certain.) Assuming that is true, then the eigenvalues are real.

The approach is based on your comment that the points are spread by Gaussian noise. Here is a comment in the Wikipedia article on multivariate Gaussian distributions:

"The equidensity contours of a non-singular multivariate normal distribution are ellipsoids (i.e. linear transformations of hyperspheres) centered at the mean[4]. The directions of the principal axes of the ellipsoids are given by the eigenvectors of the covariance matrix Σ. The squared relative lengths of the principal axes are given by the corresponding eigenvalues."

http://en.wikipedia.org/wiki/Multivariate_normal_distribution"

EDIT: I assumed that your data are centered about a point R in 3D space, and are spread by random noise. The best-fit ellipsoid is centered on R. In re-reading your original post, I see a different possible interpretation--that you have a small sample of noisy data lying on the surface of an ellipsoid whose center is potentially far from R. If this is the case, then my suggestion is not appropriate.
 
Last edited by a moderator:

1. What is MATLAB 3D Data Fitting and why is it useful?

MATLAB 3D Data Fitting is a tool used for analyzing and visualizing three-dimensional data. It is useful for fitting mathematical models to 3D data, finding the center and axes directions of a 3D object, and creating 3D plots and surface plots to better understand the data.

2. How do I find the center and axes directions of a 3D object using MATLAB?

To find the center and axes directions of a 3D object in MATLAB, you can use the built-in function "fitEllipsoid". This function takes in 3D data points and returns the center and axes directions of the best-fit ellipsoid to the data.

3. Can I customize the 3D plots and surface plots created by MATLAB 3D Data Fitting?

Yes, you can customize the 3D plots and surface plots created by MATLAB 3D Data Fitting. You can change the colors, labels, axes limits, and other properties of the plots to suit your needs.

4. Is it possible to use MATLAB 3D Data Fitting for real-life applications?

Yes, MATLAB 3D Data Fitting can be used for various real-life applications such as analyzing 3D medical images, fitting 3D objects for 3D printing, and analyzing geological data.

5. Are there any limitations to using MATLAB 3D Data Fitting?

One limitation of MATLAB 3D Data Fitting is that it can only handle a limited amount of data points at a time. If you have a large dataset, you may need to split it into smaller subsets and run the fitting process multiple times. Additionally, the accuracy of the fit may also depend on the quality and distribution of the data points.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
19K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
1K
Replies
19
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
13K
  • Calculus and Beyond Homework Help
Replies
1
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
2K
  • High Energy, Nuclear, Particle Physics
Replies
4
Views
2K
Back
Top