Error ellipse features

34 views
Skip to first unread message

Christopher Tyson

unread,
May 31, 2022, 9:42:19 AMMay 31
to ctmm R user group
Hi Chris,

I am interested in incorporating error from locations estimated by trilateration of VHF data. So far, I've been able to calculate the covariance matrix of the 95% error ellipse. Are there other features I should also extract from the error ellipse to include with each location estimate? Attached is some code showing the approach I use.

Many thanks! 

Cheers,
Chris
error_elllipse_example.R
dets.csv

Christen Fleming

unread,
May 31, 2022, 11:01:07 AMMay 31
to ctmm R user group
Hi Chris,

At the moment, you would want to get your data into Argos format, which is kind of a weird format for the covariance matrix. There are three columns: Argos.orientation, Argos.semi.major, and Argos.semi.minor.
Argos.orientation is the counter-clockwise angle between the the major axis (of largest variance) and north.
Argos.semi.major is the larger of the COV matrix eigenvalues (variances) divided by 2 and then square rooted (in meters).
Argos.semi.minor is the smaller of the COV matrix eigenvalues (variances) divided by 2 and then square rooted (in meters).

I couldn't run that code without errors and I'm not sure what format your data is in to help more explicitly.

Is this trilateralized or triangulated VHF data? One day, I'd like to find the time to code up support for triangulation in the package, if that's something that people still do.

Best,
Chris

Christopher Tyson

unread,
May 31, 2022, 1:55:35 PMMay 31
to ctmm R user group
Hi Chris,

Many thanks for the reply and the explanation of the Argos format that I need to go for.
As for the localization data, I'm doing trilateration. It is from an automated radio-tracking type system with many receivers within a fairly small area. 
Attached is some new code, which should hopefully run for you. 

Thanks again for your reply.

Cheers,
Chris

error_elllipse_example.R
dets.csv

Christen Fleming

unread,
May 31, 2022, 3:19:22 PMMay 31
to ctmm R user group
Hi Chris,

I'm not familiar with this data structure to understand how to most easily pull out the error ellipse information, but I calculate that the sqrt(2) standard-error ellipse used in the Argos format would be given by level=1-exp(-1) .

Best,
Chris

Christopher Tyson

unread,
Jun 1, 2022, 9:48:12 AMJun 1
to ctmm R user group
Hi Chris,

I've calculated the semi-major/minor axes from the error ellipses, but I am still not quite clear on the orientation. In the attached script, there is code to plot the axes for the error ellipses that I'm working with. If you could clarify which angle is the one I should calculate, I would be very appreciative! Sorry for the basic question and thanks again for your help!

Best,
Chris
dets.csv
error_elllipse_example.R

Christen Fleming

unread,
Jun 2, 2022, 6:21:39 AMJun 2
to ctmm R user group
Hi Chris,

I'm not super familiar with this object class, but I think you need levels=1-exp(-1) to fix to the Argos sqrt(2)-standard-error ellipse format, which then lets you drop the sqrt(2) from your code later on, because I suspect your ell.info object is not the 1-standard-error COV-matrix ellipse, but the ellipse with coverage levels.

For the angles, try this code:

u <- eigen.info$vectors[,1] # major axis eigenvector
theta <- atan2(u[2],u[1]) # angle from x-axis in radians
theta <- theta *360/(2*pi) # angle from x-axis in degrees
theta <- theta - 90 # angle from y-axis in degrees

I forgot to mention that Argos format is in degrees.

Best,
Chris

Christopher Tyson

unread,
Jun 2, 2022, 8:04:27 AMJun 2
to ctmm R user group
Hi Chris,

Thank you very much for the explanation and for the code! This makes sense and was very helpful.

Cheers,
Chris
Reply all
Reply to author
Forward
0 new messages