1

I am trying to manipulate the output of EllipsoidQuantile to find the area in the next line.

I can easily find the 95% confidence interval and this generates an ellipsoid, but I would like to extract the axis without copy and pasting.

data = {{-3.17, 272.35}, {.67, 271.54},..........};
elips = EllipsoidQuantile[data, 0.95]

the output is then

Ellipsoid[{{-.578,272},{2.88,0.62},{-.09,0.12},{-.12,-.099}}]

I would like to extract the second row of data(major and minor axis).

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
user29817
  • 11
  • 1
  • Part ? And please add complete examples. – Sektor May 28 '15 at 16:01
  • As a word of caution, you might care to know that EllipsoidQuantile uses an obsolete definition of the Ellipsoid function, as you will notice if you compare the three-argument results you get with the current two-argument definition in the documentation. Take a look at this question How to draw confidence ellipse from a covariance matrix? for a way of drawing those ellipsoids that also doesn't require you to use the MultivariateStatistics package. – MarcoB May 28 '15 at 16:13

1 Answers1

1

Let me generate some random bivariate toy data :

SeedRandom[1]
newdata = RandomVariate[BinormalDistribution[{10, 25}, {1, 5}, 0.7], 100]; 

Take a look at my answer to this question: How to draw confidence ellipse from a covariance matrix?. You will see that you can obtain a 95% confidence ellipsoid as follows:

ellipsoid95 = Ellipsoid[Mean[newdata], 6 Covariance[newdata]]

(* Out: Ellipsoid[{9.99033, 25.6897}, {{6.17123, 20.9226}, {20.9226, 137.338}}] *)

You can plot this with your data:

ListPlot[
  newdata, 
  Epilog -> {Opacity[0], EdgeForm[{Gray, Thick, Dashed}], ellipsoid95},
  PlotRangePadding -> Scaled[.075], Frame -> True, Axes -> False
]

Mathematica graphics

This generates a "new" Ellipsoid object that plays nice with the convenient geometric region functions. For instance, you can then obtain its area simply with the Area function:

Area[ellipsoid95]

(* Out: 63.596 *)
MarcoB
  • 67,153
  • 18
  • 91
  • 189