Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to fit min. area ellipse around data point

  1. Nov 6, 2009 #1
    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.
     
  2. jcsd
  3. Nov 8, 2009 #2

    DrGreg

    User Avatar
    Science Advisor
    Gold Member

    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.
     
  4. Nov 9, 2009 #3

    DrGreg

    User Avatar
    Science Advisor
    Gold Member

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: How to fit min. area ellipse around data point
  1. Fit data NMR (Replies: 1)

Loading...