Skip to main content
16-Pearl
September 20, 2018
Solved

Creating the “enveloping” ellipse for a Monte Carlo plot?

  • September 20, 2018
  • 2 replies
  • 6108 views

To all

 I am doing my 1st step with the montecarlo() function in mcad 15. I copied the example and put my own function and it seems to work fine.

Does anyone know if there is a way of getting/creating the “enveloping” ellipse one often sees on a Monte Carlo plot? I attached one on which I drew the ellipse

 

I think the length of the minor and major axis have a meaning (in the Mont Carlo world) byut can’t quite remember what it is!

Best answer by JBlackhole

Get the mean data X0 =(x0,y0)

Get pts

1: X1=(x1,y1) x1=min(x), y(x1)

2: X2=(x2,y2) x2=max(x), y(x2)

 

Centre of the ellipse is X0

Major axis a =|| X2-X1||

Rotation angle of the ellipse atan(|X2|/|X1|)

Search minor axis (b) to envelope all the pts

Plot ellipse translated by X0 and rotated by alpha

2 replies

JBlackhole16-PearlAuthorAnswer
16-Pearl
September 25, 2018

Get the mean data X0 =(x0,y0)

Get pts

1: X1=(x1,y1) x1=min(x), y(x1)

2: X2=(x2,y2) x2=max(x), y(x2)

 

Centre of the ellipse is X0

Major axis a =|| X2-X1||

Rotation angle of the ellipse atan(|X2|/|X1|)

Search minor axis (b) to envelope all the pts

Plot ellipse translated by X0 and rotated by alpha

23-Emerald I
September 25, 2018

And the minor axis is?

23-Emerald I
September 25, 2018

How about this?

You've calculated the angle for the major axis.  (I liked what you've got so far.

Now

    Rotate all of the data so that the major axis is parallel to the x axis.

    Then the length of the minor axis is max(y)-min(y).  And the minor axis is normal to the major axis, so you know the whole ellipse.

16-Pearl
September 26, 2018

Here's a solution that uses Minimize to make an ellipse of minimum area that includes all the points.  Seems to work.

 

2018-09-26_16-58-04.jpg

 

4.0/pdf attached

16-Pearl
September 27, 2018

Thanks for that.

Thanks to Fred and yourself for the input. Really appreciated