New Posts New Posts RSS Feed: PY rounding errors
  FAQ FAQ  Forum Search   Register Register  Login Login

PY rounding errors

 Post Reply Post Reply Page  12>
Author
ohFFsake View Drop Down
Far too distracted from work
Far too distracted from work


Joined: 04 Sep 08
Location: United Kingdom
Online Status: Offline
Posts: 219
Post Options Post Options   Quote ohFFsake Quote  Post ReplyReply Direct Link To This Post Topic: PY rounding errors
    Posted: 16 Aug 11 at 11:24pm

I've been developing some software for automating our club racing results process, and along the way have come across a few issues with resolving corrected times.

Here's a genuine example to illustrate what I mean.

Two Laser Radials (PY 1106) cross the finishing line and are given times of 1h 9m 28s and 1h 9m 29s

It is clear to the race officer that one boat beat the other, hence the times being a clear second apart.

But when these times are corrected and rounded to the nearest second they both come out at 3706 seconds so the boats appear to have tied, which is plainly wrong.

Mathematically I can see how this arises, and the obvious solution would seem to be to go to an extra decimal place when correcting times in order to preserve the original accuracy, but others at our club assert that only integers should be used.

Does anyone know of a definitive reference anywhere as to how to resolve this issue?

Thanks

Back to Top
JimC View Drop Down
Really should get out more
Really should get out more
Avatar

Joined: 17 May 04
Location: United Kingdom
Online Status: Offline
Posts: 6565
Post Options Post Options   Quote JimC Quote  Post ReplyReply Direct Link To This Post Posted: 17 Aug 11 at 12:53am
Its covered in the RYA manual: yes you handicap to integers only.

Consider: the limit of measurement is at best plus/minus a second, and that's your limit of measurement. Frankly for most clubs hand timing and hand recording we probably don't even manage to time accurately to the last second anyway. Those boats might have been nearly two seconds apart or they might have been a hundreth of a second apart and the clock just ticked over between them: 1h 9m 27.50 secs and 1h 9m 29.49 secs or 1h 9m 28.49 secs and 1h 9m 28.50 secs

Now you say its clearly wrong that they tied, but I think you're mistaken... Whenever two boats of different classes tie on handicap the smart money is that one was anything up to a second ahead of the other, but *you have no way of knowing which was which*. Remember this is a handicap race and NOT a positions race...

Supposing, for instance, that a Solo had also finished with the same corrected time. Would you put it ahead of both Lasers, behind both Lasers, or between the two if you split them? There is no sensible answer. So handicap racing is to the nearest corrected second, and if you're that close then it counts as a tie... It would count as a tie if they were from different classes, so logically it must count as a tie if they are from the same class. If you were extracting places from the handicap races for a class series within the series, on the other hand, you would place them separately...

Does that help? I think I've explained this better in the past...
Back to Top
ohFFsake View Drop Down
Far too distracted from work
Far too distracted from work


Joined: 04 Sep 08
Location: United Kingdom
Online Status: Offline
Posts: 219
Post Options Post Options   Quote ohFFsake Quote  Post ReplyReply Direct Link To This Post Posted: 17 Aug 11 at 1:26am

Thanks for the reply, and I understand the point you are driving at.

I agree that the limit of accuracy is 1 second, the problem I have is that the correction process is discarding some of that accuracy if we round afterwards - or at least it does for boats with PNs higher than the 1000 base.

Mathematically, what is happening here is we are starting out with two boats that are a clear second apart, but the PN correction process reduces that second to something slightly less than a second, which we then discard in its entirety when we round the numbers. So the original timings establish a clear margin between two boats which we then throw away!

It is interesting to note that this only happens for boats with yardsticks of over 1000. This issue could never arise between a pair of boats that had PNs of (say) 950, as in this case the correction process enlarges the gap between the two so it cannot be rounded out.

That's my theory, and I think this case proves it. This isn't a case of "the next second just clicking over", it is a case where two matched boats have crossed the line and the RO has judged one to be ahead of the other, hence allocating them different times. It seems perverse to then score them as tied, regardless of whether it is a handicap race.

Interestingly, the only RYA reference I could find seems a little vague on the issue of rounding, saying that they should be taken to the nearest integer "when rounding is required", which seems to leave it open to the person scoring the race to leave them as decimals if they so desire?

An alternate solution I have just devised would be to calculate all the corrected times in a slightly different way. Instead of using 1000 as the base multiplier, use the PN of the slowest competing boat instead. So if the slowest boat has a PN of (say) 1290, then substitute 1290 into the correction calculation instead of 1000. That way the slowest boat's time ends up uncorrected, whilst every other boat has its time increased during the correction process. These can then be rounded to integers and the only ties will be in cases where the boats original times were less than a second apart.

Back to Top
JimC View Drop Down
Really should get out more
Really should get out more
Avatar

Joined: 17 May 04
Location: United Kingdom
Online Status: Offline
Posts: 6565
Post Options Post Options   Quote JimC Quote  Post ReplyReply Direct Link To This Post Posted: 17 Aug 11 at 9:06am
You're still thinking of the boats as being exactly one second apart: that's the point: you don't know that. You have two boats which are less then two seconds apart and more than say one tenth of a second apart. They are tied *within the limits of resolution* of handicap racing. There's also the very human factor that if one boat crosses the line just ahead of another ROS are inclined to record them as being a second apart even if they did in fact cross on the same second. Although we always like to think our results are accurate to the nearest second I doubt - at least on busy finishes - whether that's always true.

And while its true that you won't have the rounding situation with faster boats, that second resolution also makes the resolution far greater in terms of distance between boats: Lasers might cross the line at 2.5m/s but foiler Moths at 10m/s - so the Moths could score the same time and be several boat lengths apart.

Because the two boats have happened to cross the line pretty much together you're thinking the fact that one was ahead of the other should be recorded. But you don't know which was ahead for any pair of boats that tied on corrected time but had very different handicaps, so its a mathematical nonsense to introduce that distinction... What the rounding is doing is highlighting the limitations of our time recording.

The only way you can, with any rationality, score down to decimals, is if you have some kind of electronic timing system which can measure down to decimals. The human limits of measurement being what they are it would probably make more mathematical sense to regard boats which are a second apart on corrected time as being tied too, but that would be too much like hard work to explain to the average sailor...

Its especially a modern problem: electronic calculation produces these rows of decimals so easily that we forget that they are entirely spurious. A clever primary school teacher introduced me to the issue long (I imagine) before you were born by having me calculate pi. I proudly calculated pi to about 20 decimal places, but was astonished to find that I was wrong after the first two - that was the limits of my ability to accurately measure the length of the piece of cotton I had wrapped round the cylinder...
Back to Top
ellistine View Drop Down
Really should get out more
Really should get out more
Avatar

Joined: 06 Mar 08
Online Status: Offline
Posts: 762
Post Options Post Options   Quote ellistine Quote  Post ReplyReply Direct Link To This Post Posted: 17 Aug 11 at 11:15am
We had exactly the same issue with two Laser 2000's the other evening. One second apart on the water but equal on corrected.

Interestingly if you do the maths it depends a bit on the number of seconds. Here's three times, each a second apart but only the last two are tying (as you would expect as they can't all be tying!).

47:31 = 2851 seconds
Divide by 1090 =  2.61559
Multiply by 1000 = 2615.596 seconds (2616)

47:32 = 2852 seconds
Divide by 1090 =  2.616513
Multiply by 1000 = 2616.513 seconds (2617)

47:33 = 2853 seconds
Divide by 1090 =  2.61743119
Multiply by 1000 = 2617.43 seconds (2617)
Back to Top
chrisg View Drop Down
Really should get out more
Really should get out more
Avatar

Joined: 23 Mar 07
Location: United Kingdom
Online Status: Offline
Posts: 893
Post Options Post Options   Quote chrisg Quote  Post ReplyReply Direct Link To This Post Posted: 17 Aug 11 at 12:00pm
Originally posted by ohFFsake

I've been developing some software for automating our club racing results process, and along the way have come across a few issues with resolving corrected times.

OhFFsake, will your software do anything that sailwave doesn't already do?

Have a word with "marke" on here from Starcross as he has developed his club software to automate pretty much everything. As soon as a race finishes and the OD clicks complete it's on their club website I think. He may be able to give you some useful tips/advice.


Edited by chrisg - 17 Aug 11 at 12:01pm
Back to Top
ohFFsake View Drop Down
Far too distracted from work
Far too distracted from work


Joined: 04 Sep 08
Location: United Kingdom
Online Status: Offline
Posts: 219
Post Options Post Options   Quote ohFFsake Quote  Post ReplyReply Direct Link To This Post Posted: 19 Aug 11 at 12:30am
Originally posted by ellistine

We had exactly the same issue with two Laser 2000's the other evening. One second apart on the water but equal on corrected.

Interestingly if you do the maths it depends a bit on the number of seconds. Here's three times, each a second apart but only the last two are tying (as you would expect as they can't all be tying!).

47:31 = 2851 seconds
Divide by 1090 =  2.61559
Multiply by 1000 = 2615.596 seconds (2616)

47:32 = 2852 seconds
Divide by 1090 =  2.616513
Multiply by 1000 = 2616.513 seconds (2617)

47:33 = 2853 seconds
Divide by 1090 =  2.61743119
Multiply by 1000 = 2617.43 seconds (2617)

Your hypothetical example illustrates the point perfectly. Here we have a situation where to the limit of our knowledge all the boats are equally spaced, yet when the times are corrected two end up tied and the other not.

The problem is that due to this rounding error it becomes arbitrary whether two boats a second apart are adjudged as tied or not. If two tied boats were to finish the same distance apart but both a second earlier - or later - then the tie no longer happens. That's why I feel that this anomaly is an error, rather than an intended consequence of the handicapping system.

Either of the two alternative solutions I put forward corrects it completely, preserving the differential between boats that were originally observed not to be tied.

Back to Top
ohFFsake View Drop Down
Far too distracted from work
Far too distracted from work


Joined: 04 Sep 08
Location: United Kingdom
Online Status: Offline
Posts: 219
Post Options Post Options   Quote ohFFsake Quote  Post ReplyReply Direct Link To This Post Posted: 19 Aug 11 at 12:39am
Originally posted by chrisg

Originally posted by ohFFsake

I've been developing some software for automating our club racing results process, and along the way have come across a few issues with resolving corrected times.

OhFFsake, will your software do anything that sailwave doesn't already do?

Have a word with "marke" on here from Starcross as he has developed his club software to automate pretty much everything. As soon as a race finishes and the OD clicks complete it's on their club website I think. He may be able to give you some useful tips/advice.

Thanks for that. Yes, that's about what we're doing too - my web application calculates all the results then posts them back to our website as part of the process.

The idea was to have a service that was entirely web-based without the need for any client software installation, so any race officer can log in from anywhere on any device (within reason) and update a central database that in turn automatically publishes to the club's website.

Still somewhat at the "proof of concept" phase but it all seems to be working reasonably well so far - except for people complaining about anomalous ties, of which we've had two in a week!

Back to Top
Andymac View Drop Down
Really should get out more
Really should get out more


Joined: 04 Apr 07
Location: Derbyshire
Online Status: Offline
Posts: 852
Post Options Post Options   Quote Andymac Quote  Post ReplyReply Direct Link To This Post Posted: 18 Sep 11 at 1:38am
It occurs to me that if the 'average lap racing' method was being used, and say; over a 1 hour race, 5 laps were completed, then there could be a variance of up to 5 seconds between same boats at the finish, which could then get rounded out to a tie Ermm.
I can't say I'll ever be a fan.
Back to Top
marke View Drop Down
Far too distracted from work
Far too distracted from work


Joined: 16 Jun 08
Location: United Kingdom
Online Status: Offline
Posts: 210
Post Options Post Options   Quote marke Quote  Post ReplyReply Direct Link To This Post Posted: 18 Sep 11 at 7:29pm
hi

chrisg mentioned that I have written some software for automated results calculation.  It is browser based but works on a local server or a laptop (or even just a  datastick) - the OOD times boats by clicking the screen as they cross the finish line - storing the time to a hundreth of a second (Yes - I know OODs will not be that accurate).  This updates the race results in real time.   It attempts to do stuff like predict the next boats to cross the line; allows shortening course in several ways, and allows results to be taken from a previous lap (when the wind disappears on Wednesday night).   At the end of the race it automatically updates the series results and posts the individual results and series results onto our website.  It does a few other things to make the OODs life a bit easier too - collects entries from an electronic signon and allocates them to the correct fleet, deals with average lap races, handles pursuit races with multiple finish lines, allows analysis of PYs, etc.  We have been using it for about 4 years now - about 500 races.

I hit your rounding problem early on when developing the code.  I understand Jim's point about precision, but you are never going to persuade two competitors in the same class in a handicap race where one finished half a boat length ahead of the other that it was a tie.  We discussed this a lot internally and decided to take the following approach.  I do the calculation to a tenth of a second - if we still get a tie (it has happened 3 times in ~500 races) we then give the boat with the lowest PY the benefit of the doubt.

If you want to look at the software there is a demo on the Starcross web site - its not the latest version, but you'll get the gist of how it works.

best of luck

Mark

P.S I started just doing "a proof of concept" - now I wonder where all my spare time went - be very careful ;-)


Edited by marke - 18 Sep 11 at 7:33pm
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.665y
Copyright ©2001-2010 Web Wiz
Change your personal settings, or read our privacy policy