## Sunday, April 27, 2014

### testing speed limit algorithm with real data

In previous post I proposed an algorithm for automated detection of speed limit violations from GPS data. Then in a later post I tested this on simulated data. Here I apply it to data which was collected by someone else during a short drive in San Francisco.

I've a general 40 kph speed limit within the city (also previously here), except on the interstate highways. This car trip didn't include any interstate highways, so it will be interesting to see how it would do with such a restriction.

Here's the speed versus time. As you can see, it was a short trip, only around 8 minutes:

It's mostly slow going, except for one stretch on Bayshore Boulevard, which is faster. That portion is generally 50 to 65 kph, Sure enough, this triggers the algorithm as speeding for a 40 kph limit. I assign a fine in dollars equal to the excess distance ahead of a "pace car" beyond the 50 meters allowed by the algorithm, at a ratio of one dollar per 100 meters. So if the car in question pulls 150 meters ahead of the "pace car" during the trip, that's a \$1 fine.

Here's how the fine varies with speed limit:

At a 40 kph speed limit, the fine would be \$1.74. It goes up substantially if the speed limit is lower. By 49 kph, it drops to zero. Note the car actually got up to 63.2 kph, but not long enough to trigger a speed limit violation between 49 and 63 kph.

At present, a speed fine is viewed as a big deal. You get pulled over, mailed a citation, given a big fine with additional fees, and possibly waste time in court defending yourself. With this system, there would be none of that. You'd get notified of a fine, and you (the registered owner of the car) would pay it by 30 days or whatever. The fine could be big or small. But acceptance of the responsibility to pay assessed fines would be part of receiving the privilege of driving a car. If you don't pay your fines accrued for your car(s), your driving privileges are suspended until you do.

This was just a short trip, so fines tend to be small. But the speed was quite modest over the majority of the drive. The goal here is to eliminate the uncertainty. If you speed to a certain threshold, you'll pay. Such a system would substantially slow the prevailing traffic speed, both increasing safety and reducing congestion. It would make getting around, by foot, bike, or even car safer and easier.

I can't simulate the advantages of reduced speed on traffic congestion here, but I can calculate, at the same level of congestion, how much longer the trip would have taken with a 40 kph speed limit cap. That's 24.8 seconds, taking the trip time from 8:36 to 9:00.8. In the spectrum of factors which contribute to delays in getting to a destination, that's a very small number, and it wouldn't take much improvement in traffic smoothness to take it to zero.

#### 6 comments:

jmorgan said...

I guess there is no letting anyone else drive your car then. Kids, friends, wife when you are drunk etc...

You have to be proven guilty of speeding. In Arizona I got a speeding ticket with my picture driving which I can't really argue that thats not me. Also easy enough to prove when you are pulled over and you don't exit the car and the cop approaches you. But with the system you are talking about there is no due process, there is no presumed innocence.

djconnel said...

Take responsibility for who drives it. This is the way it is in most of the world. And as it is here with parking tickets & bridge tolls, for example.

Driving is a privilege requiring exceptional skill, training, and with it accountability, not a right, so presumed innocence is not applicable.

It's no different with firearms. If your gun kills someone, you're responsible. Cars are just as deadly.

jmorgan said...

People already drive without a license, registration and insurance. How does this affect them? Oh sure it might be a minority of drivers but arguably its this minority that is most dangerous and has the least amount of consequences.

How much would this state run program cost? Device? Support staff etc... Billions and billions

And how do you prevent people from disabling or tampering with the unit? Easily defeated with a Faraday cage (potato chip bag) besides reprograming or anything else.

The only people this would end up effecting are those that obey the law anyways and just happen to go over the speed limit when they did not realize.

If I let a friend borrow a gun because he told me he was going dove hunting (its in season) and had no previous record of violence and could legally carry a gun and ended up killing someone. (You could insert car where it says gun) Any prosecutor would have a hard time proving I was responsible for the murder assuming I wasn't grossly negligent.

djconnel said...

This doesn't have anything to do with license: it has to do with the registered owner of the vehicle. Of course, if it's unregistered, then that's another matter: the position of an unregistered vehicle is known on the highway.

Every safety improvement in cars cost "billions". This would be cheaper than child seats, and save a lot more lives.

Disabling and tampering is always an issue. Ideally the car wouldn't operate without GPS signal. That's unrealistic. But some intermediate step needs to be determined. It wouldn't completely replace traditional speed enforcement, as I noted earlier.

On the gun subject: I think it's a matter of state law, so I'll step away from that one. But it is true in most if not all European and Commonwealth nations automated speed detection cameras will result in a citation, whether or not the driver is positively identified. Traffic citations are not in the same class as felony charges. The standard of proof is different.

jmorgan said...

I guess we will have to tear down all parking garages then. A car sitting all day will not have reception when someone tries to leave to go home and their car will not start. There are so many issues around just recording the data needed, securely and accurately that this wont work. Someone will find a way to work around it or defeat it. Common, SSL which we all had faith in (well our credit cards and passwords) was not secure.

I understand you have good intentions but there are too many issues for this to be feasible besides all of the potential legal issues this would bring up.

How do you handle accidents. Obviously the plaintiff would want the data to prove the defendant was negligent etc. Providing the data (the data being the property of the owner of the car) would essentially be incriminating themselves with the data. Again just to many issues to overcome to ever make this work short of all cars driving themselves but then there would also be no speeding so no issue.

Distracted driving (cell phones mostly) is a huge issue and will only continue to grow as more people (younger) start driving. You could fix that by not allowing phones to work while moving so many MPH but again someone will find a work around. Just because its illegal isn't going to stop people that want to break the law from breaking the law.

djconnel said...

Thanks for the comments. Your view is a common one. But I think there's a fundamental disagreement in perspective.

Driving is a privilege, not a right like walking or talking or even riding a bicycle. Since it is a restricted activity, there's an increased duty n practitioners. That means it is reasonable that one will be monitored for compliance with basic safety principles like speed limits.

As a result, I disagree the driver "owns the data". While there's reasonable resistance to having ones position being monitored, accountability in the case of a collision is hardly an intrusion into privacy or personal freedom.

On the parking lot situation: yes, GPS reception (or lack thereof) is an important consideration. I don't think cars should shut down based on a loss of position data. Although position detection is in its relative infancy, and with applications exploding, the problem of urban and even indoor position detection is getting a lot of attention.

Europe has automated speed limit enforcement via cameras. We can do better than that with current technology. The key is to establish the goal: that the cause of public safety outweighs any "freedom" to escape responsibility for reckless actions in this context.