How to fit min. area ellipse around data point

In summary, to draw an ellipse/ellipsoid around 2d/3d data points with a certain confidence interval and minimum area/volume, you can use the covariance matrix and calculate the appropriate value of r for each data point. This can be done in MATLAB or other software with similar capabilities. If the data has a non-zero mean, the mean should be subtracted before performing these calculations.
  • #1
Amrita
2
0
Hi,

I am having some 2d and 3d data files (from some nmr experiment, as a matter of fact) and the data plot for that is such that most of the points are coming together now I want to draw ellipse around 2d data point and ellipsoid around 3d data point with the condition that 90% (or any confidence interval) of data will fall inside it. Moreover, these ellipse / ellipsoid should have the minimum area/volume. How to do that can anyone advice me?
I have been trying it in Matlab. But if any other software does this efficiently, kindly inform in details.
 
Physics news on Phys.org
  • #2
Amrita said:
Hi,

I am having some 2d and 3d data files (from some nmr experiment, as a matter of fact) and the data plot for that is such that most of the points are coming together now I want to draw ellipse around 2d data point and ellipsoid around 3d data point with the condition that 90% (or any confidence interval) of data will fall inside it. Moreover, these ellipse / ellipsoid should have the minimum area/volume. How to do that can anyone advice me?
I have been trying it in Matlab. But if any other software does this efficiently, kindly inform in details.
If x1, x2, x3 ... are the column vectors for your points, form the 2×2 or 3×3 covariance matrix

[tex]\textbf{R} = \frac{1}{N}\sum_{n=1}^N \textbf{x}_n \textbf{x}_n^T[/tex]​

The ellipse / ellipsoid you want will have an equation of the form

[tex]\textbf{x}^T\textbf{Rx} = r^2[/tex]​

for some suitable value of r. For arbitrary data you can just calculate the value of rn for each data point x = xn and take the 90th percentile (or whatever).

You should be able to all this in MATLAB.
 
  • #3
Correction

My response above is based on the assumption that your data has zero mean. If the mean of your data is not negligible (i.e. if you want an ellipse that isn't centred on the origin) you'll need to subtract the mean first before you do anything else.
 

Related to How to fit min. area ellipse around data point

1. How do I calculate the minimum area ellipse around a set of data points?

To calculate the minimum area ellipse, you can use a mathematical formula known as the "smallest enclosing ellipsoid" algorithm. This algorithm iteratively finds the ellipse with the minimum area that encloses all of the data points. There are also various software packages and online tools available that can perform this calculation for you.

2. What is the purpose of fitting a minimum area ellipse around data points?

Fitting a minimum area ellipse around data points can be useful in various fields such as statistics, data analysis, and image processing. It can help to summarize and visualize the data, identify outliers, and estimate the confidence interval or standard deviation of the data.

3. Can I fit an ellipse around non-linear or non-normal data?

Yes, it is possible to fit an ellipse around non-linear or non-normal data. However, the results may not accurately represent the overall distribution of the data. It is important to assess the data and consider other methods for analyzing non-linear or non-normal data.

4. Are there any limitations to fitting a minimum area ellipse around data points?

Yes, there are some limitations to fitting a minimum area ellipse around data points. It assumes that the data points are normally distributed and do not have any significant outliers. It may also not accurately represent the data if there are a small number of data points or if the data is highly skewed.

5. How can I interpret the results of the minimum area ellipse fitting?

The minimum area ellipse fitting provides information about the center, orientation, and scale of the data. The center of the ellipse represents the mean of the data, while the orientation and scale can help to understand the spread or variability of the data. The size of the ellipse can also indicate the confidence interval or standard deviation of the data.

Similar threads

  • STEM Educators and Teaching
Replies
5
Views
848
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
2K
  • Atomic and Condensed Matter
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
26
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
16
Views
6K
  • Set Theory, Logic, Probability, Statistics
Replies
24
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
16
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
Back
Top