Wednesday, December 31, 2008

My 2008 Highlights

Time for a brief vanity post as this year has been reasonably good for me. Here are my ten highlights in roughly chronological order:

1) The Boss and E Street at Old Trafford
This was my first stadium gig and my first trip to the 'Theatre of Dreams'.

2) Fantasy Football
After a couple of years of dismal perfomances I finally won my fantasy football league thanks in large part to signing Ronaldo at just the right time and making him captian.

3) Radiohead at Malahide Castle
My first ever Radiohead gig and an enjoyable weekend spent in the area just North of Dublin.

4) Three peaks
I finally climbed Ben Nevis as well as return trips up Snowdon and Scafell all in one weekend.

5) Media-whoring
(My degoratory term for the courting of radio, newspaper and TV by scientists). I must confess that my earlier scoffing at such things was tempered somewhat by my own experience. I enjoyed being interviewed although some of the resulting articles had the typical ring of inaccuracy and the "quotes" assigned to me were hilarious - apparently I have predicted that we will eventually find the Triassic was when dinosaurs were most diverse.

6) My first Science/Nature paper
Almost by accident a study conducted by Steve Brusatte that I had helped out on with some of the numerical analyses was ready to go at a time when Science were publishing a number of Triassic archosaur papers. I suggested we at least give them a try and lo and behold the best reviews and quickest acceptance that I am ever likely to experience occurred. Quite rightly most of the credit goes to Steve, but this was (and is) a fantastic addition to my CV - thanks Steve!

7) My first lead-authored paper
The media-whoring mentioned earlier accompanied the online publication of my first lead-authored paper, although technically it didn't appear in proper print until November.

8) My first post-doctoral position
Just as I was finishing up my PhD a job was advertised at the NHM that well suited my rather odd set of skills (being a paleontologist who doesn't look at fossils) and I was lucky enough to get an interview and an offer. This means 2009 will see me move to London's fantastic Natural History Museum.

9) PhD
Exactly six days after being offered the job came my dreaded PhD viva. I can't say it was an enjoyable experience, but it was one I survived with only minor corrections.

10) Newcastle United 1 Liverpool 5
As she did last season, my Mum managed to get tickets at St James Park for the visit of my beloved Liverpool. Sitting with the home fans meant I had to keep quiet as we romped to our most convicing victory of the season as we close out the year top of the Premier league. Now let's have no mention of this...

Saturday, December 13, 2008

How big is your species-area polygon?

Following on from my dino world post I have recently been trying to work out how to calculate the area of a species' (or other taxon's) range given a set of occurrences as latitudes and longitudes. In theory this is very simple: you draw a convex hull around your occurrences, split the resulting polygon into triangles, measure the area of each and sum the results. Simple, right?

Trouble is, when your coordinates are actually latitudes and longitudes things aren't as easy. Imagine this simple scenario:

Which polygon is largest, the blue or the red? On this projection they appear equal and this is because the distance, measured in degrees of latitude and longitude, between each set of points is exactly the same. However, although latitude is truly a measure of distance (one degree is 111km) longitude is not. At the equator one degree of longitude is equal in distance to one degree of latitude, but closer to the poles this distance declines to zero. This is because our polygon is really a spherical polygon.

How do we measure the area of a spherical polygon? Well, in the same way. we split it into spherical triangles and measure the area of these. However, to measure the area of a spherical triangle we need to know, not the lengths, but the angles (A, B and C, given in radians) as well as the radius (R) of our sphere:


So all we really need to do is work out those angles, but our data is latitudes and longitudes. More technically, we are providing the location of our polygon's vertices.

The easiest way to do this (Bevis and Cambareri 1987) is to artificially move each point to the pole, then the angle can be calculated as the difference between longitudes. However, this isn't quite as simple as it sounds as each angle can be measured twice, once for the 'interior' and once for the 'exterior'. So, for example, there may be 40 degrees of separation in one direction and 360 - 40 = 320 degrees in the other. The reason this confusion arises is that the sides of a spherical polygon are actually the sides of two spherical polygons, both an 'inside' and an 'outside'. (Both are finite, and hence, both are measurable).

Bevis and Cambareri (1987) suggest a way around this is to use an algorithm that measures the area based on the sequence the points are fed to it:

If the points are fed in clockwise order then the internal angles, and hence internal polygon (1) is calculated (shaded area, left-hand plot). If in anticlockwise order then the external polygon (2) is measured (shaded area, right-hand plot).

So how big is your species-area polygon? Well, if you really want to know you can calculate it using the Bevis and Cambareri method (I have put an R implementation on my website here).

Reference:

Bevis, M. and G. Cambareri, 1987. Computing the area of a spherical polygon of arbitrary shape. Mathematical Geology, 19, 335-346.

Tuesday, December 09, 2008

Interesting new website

I recently stumbled across this new website:

http://www.academia.edu/

It is basically a network of academics, but you have to sign up to be part of it. Notable members are Richard Dawkins and that Stephen Hawking chap. Definite lack of palaeontologists at the moment though. Sign up! Be my contact!

My page here:

http://bristol.academia.edu/GraemeLloyd

Sunday, December 07, 2008

Dino World

I am about to give a lecture on dinosaur palaeobiogeography here in Bristol and was tinkering with some data from the Paleobiology database (PBDB) and thought I'd upload the above image for your delectation.

The PBDB recently added two new data fields: palaeolatitude and palaeolongitude. I'm not entirely sure how these are done, but basically any fossil occurrence that has latitude and longitude data added also gets a palaeolatitude and palaeolongitude. Whilst preparing my talk I thought I'd stick up a world map with all of the dinosaur occurrences included on it, but decided to plot out the original positions too.

The above graph shows the modern location of each fossil locality (a light blue circle), it's original position (dark blue circle) and, so you can see how these link up, a red line connecting the two. The resulting image thus shows the 'tracks' along which the modern continents moved. (FYI: the graph was produced in R using the 'maps' library).

There are problems with this plot, however. There are three lines which are quite long and cross over other lines quite obtusely. The upper one of these (leading from the northeast of Russia to somewhere North of the Bering Strait is likely an artefact of drawing the plot on this particular projection. (In reality it should cross the Date Line and not wrap around the Earth in a whole different direction). The two others (the very southern line and the Japan-to-Atlantic line) are a bit harder to explain, but likely they are the result of some kind of error.

Still, I'm quite happy with it.

Sunday, November 09, 2008

Who is my best friend, statistically speaking?

Those of you who use the social networking site facebook may be familiar with the Friend Wheel application which takes your friends and plots them out as nodes along the edge of a circle. It then joins with a line each of your friends who are friends with each other.

My friend wheel is shown above, but who is my best friend?

I reckon I can outgeek John with this one. Surely (!) my best friend ought to be the person who has the most friends in common with me, i.e. the one with the most lines emanating from their node above. Because it would take me too long to work this out for everyone I will limit myself to those who blog: John, Manabu, Sarda and Dave.

It turns out my best friend is easily Manabu (53 friends in common), then Dave (34), Sarda (31) and John (29). However, a raw count might not be the best measure. For example if John only had 31 friends and Manabu had a thousand then surely John would be my best friend because almost all his friends would be my friends. Visually this could be represented as a Venn diagram like this:

Each circle is a person and the area of the circle is the total number of friends they have. In this example I am circle A (I'm very popular, of course) and I have two friends (circles B and C) who share friends with me (represented by the area of overlap). The raw number of friends is about the same, but friend C's circle overlaps with mine much more and so between the two I would consider C to be my best friend. (Of course B and C may also share friends, but representing this would be where Venn diagrams get complicated).

So mathematically speaking my best friend would be the one whose number of friends in common with me is the greatest proportion of their total friends. Let's call this the BFI (Best Friend Index), which logically ranges from 0 (no friends in common) to 1 (all friends in common). It turns out that Manabu has the highest BFI (0.47), but what if I wanted to draw the Venn diagram reflecting this relationship accurately? This is where it gets really geeky.

First we need to draw two circles (one for me, one for Manabu) with the area being the total number of friends we each have. This is easy, right? The area is πr2, so to draw the circle we simply divide our area (number of friends) by π and then root the result. This gives us the radii needed to draw the circles.

Now it gets a bit more complicated. We know the size of the area that the overlap should be (53 friends), but this area has an odd shape that represents two segments of a circle. One for me and one for Manabu. But we cannot simply halve the total area between the two circles as the chord lengths will not match if the circles are different sizes (which they are).

This hurt my head for a bit until I found the answer here. So the area of overlap (A) is given as:

Where (R) and (r) are the radii of our respective circles and (d) is the distance between the two centers - the thing we need to know. So by rearrangement we get:

Um, actually this was a bit hard for me so I posted a question on a maths forum and it seems that this equation is not rearrangeable. The only way to get d then is by an approximation method. I tried to do this using the Newton method, but this requires establishing the derivative of the above equation. Again, beyond my abilities. But after enlisting the help of a friend it turns out this too is impossible as it involves the root of a negative. So the only solution was to write my own extremely inefficient approximation method in R. Here, then, is the Venn (or is it Euler?) plot for Manabu and myself:

This may all seem a bit silly, but it could easily be adapted to cover other things (e.g. favourite music and films in common etc.). If I were a more adept programmer I might have even turned this into a facebook application.

Tuesday, October 07, 2008

Deepest fish ever

Arent they cute?

Thursday, September 11, 2008

Famous again

I'm famous again. Well, sort of. I played a fairly minor role in some interesting new research on the rise of the dinosaurs that suggests it was their competitors, the crurotarsans (crocodiles and their antecedents), that had the greater range of body plans and indistinguishable rates of evolution back in the Triassic when both groups first appeared. The dinosaurs came to dominate, perhaps not because they were superior, but simply that they got lucky with two rounds of mass extinction hurting the crurotarsans much more, leaving only the true crocs to soldier on through the Mesozoic.

Wednesday, September 10, 2008

Goat-based humour

Goats seem to provide a decent history of humorous stories, at least on the BBC website. First was the Sudanese man forced to marry a goat, that sadly later died. And most recently a number of goats were freed from prison after being unfairly "charged with being sold illegally by the roadside." This put me in mind of perhaps the funniest youtube clip I have ever seen:




Sunday, August 31, 2008

Reading level


blog readability test

I saw this on John's blog and thought I'd see if I could match him. (Apparently so). But how does it work?

Saturday, August 30, 2008

Back once again

Hi all. It's been a long time, but I have decided to attempt resuscitation of this blog (which still gets more traffic than my 'proper' web site). Check back soon for a post on my fifteen minutes of fame following the publication of my first lead-authored paper on a new dinosaur supertree.

About Me

My photo
Currently I am founding member, president elect and entire membership of SWEMP (the Society of Wonky-Eyed Macroevolutionary Palaeobiologists). In my spare time I get paid to do research on very dead organisms and think about the really big questions in life, such as: What is the ultimate nature of reality? Why is there no room for free will in science? and What are the implications of having a wardrobe that consists entirely of hotpants?