How to fit min. area ellipse around data point

AI Thread Summary
To fit a minimum area ellipse around 2D data points and an ellipsoid around 3D data points, a covariance matrix should be formed from the data. The equation for the ellipse/ellipsoid is based on the covariance matrix and requires calculating a suitable radius for the desired confidence interval, such as 90%. It's important to note that if the data is not centered at the origin, the mean should be subtracted before applying the covariance matrix. MATLAB can perform these calculations effectively, but users are encouraged to explore other software options if needed. This approach ensures that the majority of data points fall within the defined shape.
Amrita
Messages
2
Reaction score
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
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

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

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

\textbf{x}^T\textbf{Rx} = r^2​

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.
 
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.
 
I think it's easist first to watch a short vidio clip I find these videos very relaxing to watch .. I got to thinking is this being done in the most efficient way? The sand has to be suspended in the water to move it to the outlet ... The faster the water , the more turbulance and the sand stays suspended, so it seems to me the rule of thumb is the hose be aimed towards the outlet at all times .. Many times the workers hit the sand directly which will greatly reduce the water...
Back
Top