2013-07-30

Safety training

Hidden underneath short screeds about "Lincoln" and Mad Men is a little gem from train-driving blogger Electro-Kevin. In the context of the recent train crashes in Spain and Switzerland he discusses the individual tweaks towards safety he makes in his job, summarising the situation nicely:

You can't pack a rush-hour train with doctors, businessmen, scientists, politicians and have an idiot at the front driving it.
A fully loaded train at rush hour, travelling into London, can easily carry many hundreds of such people to work. Assuming the average cost of a life at £1M, which is probably low for a professional in a rush hour train, you're looking at half a billion quid at risk on every single journey. On balance, you don't want this being done by a half-trained chimp. Ironically, for most lawyers and management consultants on the train, you could substitute half-trained chimps and make a net benefit for society, but I digress.

Electro-Kevin is acutely aware of this responsibility, and so aims to make his trains safer:

In addition to Press-and-Call I wear rubber charity bands. I use them in the following way:
  • around my palm denotes that my train is longer than normal (so I stop at the right marker on platforms)
  • around my fingers denotes that I have an irregular stopping pattern (so I don't miss stations)
  • wrapped around fingers AND palm denotes that I am under a cautionary sequence of signals approaching a red.
I find this system works well at all times, especially in darkness. The light tugging of the band whilst traversing a long red section means that I am thinking constantly about the red signal.
Do you see how clever this is? He has built himself an analogue reminder system - if he's proceeding towards a red light but forgets, and starts to accelerate to his normal speed, the sensation of train acceleration combined with the squeezing of his finger and palm will trigger "hey, this feels wrong" in his sensory system. He has removed the need to remember a special condition with no visual input ("I'm proceeding towards a red signal"), aware of the fallibility of human memory, and backstopped it with a sensory stimulus.

Clever, n'est ce pas? What Government agency or safety consultancy came up with this system?

This system is simple and cheap and is the most effective that I have come across and - best of all - it was invented by ME !
To be fair, this works for Electro-Kevin but may not work for other drivers who process sensory stimuli differently. It is however an excellent way of providing another layer of safety in the system of driving a train through a busy and complex mesh of track. It's a reminder that if your system relies on human recollection to avoid an accident, you're going to discover how foolish is such a reliance.

This is why paying train drivers very substantial salaries can make sense; if, as a result, you can employ people with an active interest in the safety of their train then you're buying yourself a bargain in reduced risk of accident. Of course, the real trick is ensuring that salaries and safety are actually aligned. How do you objectively rate the safety of a driver in a system where the first serious accident a driver causes is usually his last, and such accidents are in any case extremely rare? The best you can do is try to spot precursors to accidents, e.g. signals passed at danger (SPADs) and base salaries on incidence of precursors, but even then you give drivers - and to a lesser extent their friends in the signal box - a strong disincentive to report such precursors, which might otherwise warn you of an imminent accident at a given junction.

Considering the number of trains on the busy criss-crossing tracks around London, it astonishes me that we don't have a serious crash every couple of months. It seems to astonish Electro-Kevin too. I'm not sure whether that reassures me or not.

Reading entirely the wrong message from Detroit

One of the most immediate and painful results from the forthcoming bankruptcy of Detroit (no doubt followed by any number of high-spending population-declining US cities) is the plight of public sector pensioners. Since they are paid out of current city funds, once the city is bankrupt their pensions are worth pennies on the dollar:

Detroit Emergency Manager Kevyn Orr wants to reduce pension benefits for thousands of retired and current city employees. In its Chapter 9 bankruptcy filing, the city claimed $3.5 billion in underfunded pensions. That's nearly 20 percent of all of the city's total debts of $18.5 billion.
Not included in that $3.5 billion is another $3 billion or so in retirement health benefits. Over 1/3 of Detroit's debt relates to current and future pensioners. It seems that the city was relaxed about pre-funding pension and health benefits, preferring to pay them out of annual taxation - which came a little unstuck when companies, jobs and taxpayers fled the city, slashing tax revenues.

Luckily for us, Helaine Olen has analysed the collapse of Detroit and drawn the appropriate lessons for prospective pensioners, blaming the 401(k) which is roughly equivalent in tax treatment to a UK personally funded defined-contribution pension plan:

However, the Reagan administration expanded the 401(k) allowing companies to offer the benefit to all employees. That's when the corporate bean counters stepped in. Realizing the 401(k) was cheaper on the company bottom line than traditional defined benefit plans, they began to freeze traditional pensions, and force workers to take full responsibility for their own retirement planning.
Helaine seems (the logic is fuzzy here) to claim that if only companies had kept their workers on defined benefit pensions - thereby shifting all the risk to their employing company or city - and eschewed the 401(k) defined benefit plans, things would all have been rosy:
Pensions are not only more cost effective than the 401(k), they work better for the majority of people. With a pension, we don't have the responsibility of guessing the right amount of money to save and how to invest it so it will grow to the right amount.
Mmm. Like the pension holders of Detroit, Stockton, and presumably soon Chicago, Sacramento, Los Angeles have benefitted from this approach. The reason that government pensions have been better (up to now) than 401(k)s is that 401(k) plans make clear just how much money you have to save in order to have a relatively miserly income. The connection between your government pension contributions and payments is, at best, tenuous. You are relying, each year, on the government bringing in enough money from taxpayers (less all the salaries and infrastructure spending that they can't do without unless they want to hang from lamp posts) to pay for your pension and healthcare. Because pensioners are living longer and healthcare costs are ever-increasing, this will be a rapidly increasing total pension and healthcare bill. As soon as the taxpayers have had enough of contributing 50%+ of their taxes direct to your pension and healthcare, and decide to move elsewhere, where is the money going to come from?

Oddly, Helaine seems to skip lightly over the question of where the money to fund government pensions comes from. I wonder why?

After more than thirty years of the 401(k) era, we no longer view pensions as something we must obtain for ourselves. We repeatedly tell pollsters we wish we had them but when it comes down to it, we don't protest when yet another group sees theirs cut or jettisoned entirely.
Perhaps because we realise that in many cases we're paying for that group's pensions in our taxes, while trying desperately to save a tiny amount of pension for ourselves out of the remnants of our income?

2013-07-26

Claire Perry finds maths hard as well

Not content with landing herself with a libel writ due to appalling misunderstanding of the Internet, everyone's favourite Helen Lovejoy - Devizes MP Claire Perry - now has the cunning idea that the Church of England should divest itself of shares in Google. And why?

Mrs Perry said: "It is quite clear that many companies, in particular British Internet Service Providers are finally now taking a really responsible approach to this [Internet porn filtering]. They are seeing that we want a level of social responsibility. “There are others out there who have not got that attitude. The Prime Minister was saying Google have a responsibility, they are effectively helping people for which there can be no case made."
Not the most coherent message, but you get her general drift: Google is not dancing to my tune, what impudence! we must slap them on the nose with a rolled-up newspaper.

Let's assume that this isn't a piece of pointless political posturing and that Perry MP thinks this will actually make a difference. So how much are we talking here?

Accounts published later this year will show that the Church’s pension fund has a £5.7 million stake in the internet search giant, alongside significant investments in a number of internet service providers.
That's about $8.7M, or slightly under 10,000 shares at Google's current stock price of $885. Since about 1.7M Google shares traded yesterday, and Google's market cap is a little under $300 billion, the effectiveness of this divestment could be measured at the same scale as a dog breaking wind in the middle of a tornado.

If I had a more suspicious mind, I'd think that Claire Perry was waving such pointlessly flimsy proposals at friendly journos to distract (squirrel!) from her little contretemps with Guido Fawkes... I'm glad however that the Archbish has a much more honest approach to the issue:

"If you exclude any contact with anything that directly or indirectly gets in any way bad, you can't do anything at all."

For a good take on the very real problem which Claire Perry is trying, desperately ineptly, to tackle, I recommend Greg Ferenstein's piece on Internet filtering. Go read the whole thing, but here's a taste:

The problem with this approach is that the world isn't PG-13. Politics, business, and personal health regularly intersect with adult issues. The (very) savvy engineers at Apple have already discovered that you have to apply a tourniquet to the First Amendment to effectively block children from seeing naughty pictures.

Those Facebook results

Facebook's mobile ad revenues surprised everyone the other day, jumping 75% in three months. Facebook shares soared 30% as analysts were startled by "thesis-changing" results:

"The revenue beat is huge," said Michael Pachter, a Wedbush Securities analyst. "They are clearly doing a great job with local ad sales."
Now I've been using Facebook mobile app most days, and I was astonished by the results. I would characterise the FB mobile adverts as intrusive (taking up chunks of the stream), and not at all relevant as far as I can see (I wasn't even vaguely interested in their subjects). I'd also note that their hotspot - the area of the screen where tapping takes you to the advert's link - is huge. Based on those observations, I have a theory about the FB results.

For a while now, online advertisement firms haven't been able to get much money from showing ads. They have to persuade users to follow the ad (by clicking) so that the advertiser sees traffic to their site from that advert. If the online advertiser can supply demographic detail on the clicking-through user to their advertising client, so much the better. So clicks are a reasonably good proxy for revenue. It's even better if you can trace the click through to an actual sale, but that can be a problem - it's hard to have a good purchasing experience in mobile, for instance, so you might expect the user to actually buy things from their desktop instead once the ad has whetted their appetite.

What I think Facebook has done, very successfully, is to make most of their (hundreds of millions of) active mobile users click on adverts in the stream. Most of these clicks have been accidental. But agents working for advertisers have their campaign success measured by clicks, at least in the short-to-medium term. Therefore they are happy to advertise with Facebook, get all the clicks and hence hit their sales targets, and trouser the appropriate bonus. This works against their long term interests, unless they can get themselves hired away to another firm based on their sales success. It certainly works against the interest of their employing firm - a classic principal-agent situation.

If I'm right - and this is just an educated guess, so I could be massively wrong - in 1-2 more quarters advertisers will be able to see that the surge in mobile clicks does not translate into, say, actual purchases traceable back to the adverts. At that point the value of a Facebook mobile click will become more apparent, and mobile ad revenue will plummet. Facebook has bought itself 3-6 months to tune their advert selection algorithms to make it more likely for users to purchase items - and, preferably, allow advertisers to track the ad click through to a purchase.

If you really want advert clicks to translate into money, you need to make it as hard as possible for a user to accidentally click an advert. The easier you make accidental clicks, the clearer it is that your motivation is to get clicks rather than purchases ("conversions"). And in the end, if the user doesn't purchase something, the advertiser has wasted their money.

2013-07-25

Stability is no longer a workplace option

In the category of "tragic news that everyone will laugh at", Megan McArdle reports that job security for lawyers in the USA is very much a thing of the past:

The odds are increasingly long that a recent law-school grad will find a job. Five years ago, during a recession, American law schools produced 43,600 graduates and 75 percent had positions as lawyers within nine months. Last year, the numbers were 46,500 and 64 percent. In addition to the emotional toll unemployment exacts, it is often financially ruinous. The average law student graduates $100,000 in debt.
Amusing enough for anyone who has ever been envious of the over-paid privileged legal practitioners, but this is merely the legal field catching up with most of the rest of society.

The concept of "a job for life" is now sufficiently rare that the very phrase sounds archaic; instead of something to aspire to, it's a facet of workplace history. The assumption is no longer that once you join a workplace you'll be there forever; rather, there's a divide between those who hop from job to job at the same (low) level, desperately trying to keep their head above the financial waterline, and those who use jobs in a similar way that animated sprites use the platforms in a game of "Donkey Kong" - steadily leaping higher and higher in an attempt to rescue the heroine and beat the game.

Because of this, it never ceases to amaze me - you'd have thought I would have learned by now - when people explicitly or implicitly assume that they will stay in the same place, working the same job, for the indefinite future. It seems so contrary to any rational expectation. I suppose it's a hard thing to contemplate moving job / house / country, but that's the world in which we live. Having made several major leaps across the country in pursuit of jobs, I can sympathise with those recoiling from the prospect of dislocation; and yet, in hindsight and in comparison with my friends and colleagues that stayed in the same place, it was definitely the right move.

McArdle nails the modern day situation:

But remember that we are not facing anything that our ancestors didn’t have to cope with. Insecurity is rarely fatal, even if it’s really frightening. And we may have to learn to live with it, because no one seems to have a very good answer for how to fix it.
You hope for a stable future, but hope is not a strategy. If you want a stable life, you have to be planning actively how to handle instability. Closing your eyes and humming "lalala" is not going to make the world of change go away.

2013-07-24

Emergent evil detection

For machine learning aficionados, a surprising tale of how anti-fraud measures discovered a Chinese car fraud racket that no-one was looking for:

Had they trained AdWords into anti-car prejudice? Was the model simply broken?
The answer turned out to be even stranger. They were real cars, but they weren't really for sale. Scammers were taking pictures of cars on the street, and when a hapless customer showed up a few days later offering money, they'd steal the car and hand it over.
[...]
Baker and his team weren’t looking for cars or car thieves. But the algorithm saw a pattern of quick buys from new accounts, tied together with larger and more subtle patterns, and deduced something was up.
The patterns of fraud in the areas that the model was trained to look at (counterfeit goods and phishing) turned out to be very similar to fraud in other areas like car-theft-serving-innocuous-order. Scammers and thieves tend to operate very similar models in a wide range of marketplaces, and the machine learning model was able to generalise sufficiently to detect fraud in an area where no-one was really looking for it.

Buried in the main story, but to my mind equally significant, is the reason why frauds are so prevalent in China:

According to Li, the larger problem is the Chinese financial system, which requires every bank-to-bank transaction to be routed through the central government’s banking authority. As a result, anti-fraud measures are usually slower than criminals. Stopping a payment could take as long as three days, by which time the money is usually unrecoverable.
Turns out that centralisation of bank transactions really slows things down - heck, why is this surprising? The Chinese government has no real interest in speeding up its inspection of transactions; thus, scammers can rely (indeed, base their fraud model) on slow bank transactions. It's harder to do this in the West because banks have been competing to speed up transactions, giving the scammers a smaller window in which to conduct their frauds.

Claire Perry: confused by the tubes

David Cameron's chief prodnose Claire Perry appears to have annoyed quite a few people with her anti-porn crusading, and someone with reasonably good hacking jobs has managed to compromise her site and add the Goatse.cx shock image to it. This caused no little mirth, and as the Ministry of Truth reports, political blogger Guido Fawkes couldn't help but comment on it. He posted a (thankfully trimmed) screenshot of Claire's "updated" website. So far so good, but it seems that Claire Perry doesn't understand the Internet:

Let's be clear, Claire. There was no link from Guido's site. There was an image - showing the URL of your website, true, but certainly not clickable. As for "distributing porn via my website" - your website was distributing porn all by itself. Guido certainly wasn't helping in any way. I wonder, if you get concepts like this so badly wrong, why exactly do you think that the advice you're giving Cameron on porn blocking is going to be so good?

And hey! it seems that Guido is now planning to sue Claire Perry (presumably not least for the entertainment it's going to provide:

Reluctantly, Guido has instructed m’learned friends who will be writing to her today...
Ah, Claire. Perhaps a little less time fulminating about porn and a little more time studying how the Web operates would have worked wonders. That Oxford degree in Geography appears to have given you a remarkable self-confidence about your knowledge on matters technical. And certainly, when someone you're accusing is telling you that your claims about them are defamatory, it would seem to be a good plan to at least check your understanding of the issue with someone who knows more about it than you do (in this case, a spotty 12 year old geek would have sufficed). Incidentally, if you want to make it harder for others to hack your site, my personal advice is to disable PHP - or at least, make sure you're always up to date with the security fixes.

I see this evolving in the near future into a donation from Claire to a charity of Guido Fawkes' choosing - if Claire has any common sense, or at least has a solicitor with the common sense that the good Lord gave gravel. I'm kind of hoping that Guido will pick a beneficiary like Wikileaks...

2013-07-21

Deddington NIMBYs

Driving through the small town of Deddington the other day, I was struck (not physically) by a large sign on the wall of a very expensive-looking house as you enter Deddington from the east: "KEEP DEDDINGTON RURAL!"

Now Deddington has always struck me as rather rural - you only go through it as a cut-through between the M40 and Chipping Norton - and indeed it's a good 10 miles from the nearest Waitrose (in Brackley), which is my personal measure of ruralness. But clearly it's in imminent danger of un-rurality, so I did a little Googling. Horror of horrors, Pegasus Group is planning to built 85 houses on a 9.5 acre site in Deddington:

If you feel our village should grow in a more sustainable way, responsive to local needs, with 3-5 new houses a year over the next 18 years as contemplated by the new Local Plan, please make your views known by emailing CDC Planning Department (ref. 13/00301/OUT)
Deddingon parish has a population of 2,100; this probably translates to about 1000 houses, of which probably 400 or so are in Deddington; you're looking at a ~20% growth in the town itself. This is hardly the end of the world. Looking at the satellite view of Deddington, with the area for development being the wedge-shaped field above Hempton Road and to the left of Banbury Road this doesn't look as if it's going to change the town beyond all recognition. If you zoom out a little, it's very apparent just how much green space is around Deddington. Building around there is a no-brainer. In fact, the tedious stretch of road between Deddington and Hempton to the west could also useful be built on, joining them up into one entity. (Now I'm going to get letter bombs through the post from the Deddington Urban Liberation League.)

Arguing for less than 1% growth per annum so that it takes ~18 years to increase town size by 20% instead of 1 year is such painful NIMBYism that deserves at least contemptuous dismissal, and better yet an active increase in the amount of planning permission granted. After all, if the town is going to get so het up about such a modest development, surely the marginal additional indignation for e.g. a doubling of house numbers would be rather small?

2013-07-14

Going through the motions, Gary?

Once I saw that George Zimmerman had been acquitted of the murder or manslaughter of Trayvon Martin I knew it was only a matter of time before Gary Younge weighed in. The speed with which he did so took me by surprise nevertheless. Perhaps he wrote "guilty" and "not guilty" versions of the article in advance:

There is no doubt about who the aggressor was here. The only reason the two interacted at all, physically or otherwise, is that Zimmerman believed it was his civic duty to apprehend an innocent teenager who caused suspicion by his existence alone.
Well, Gary my old chum, it seems that there was considerable doubt about who was the aggressor. "Reasonable doubt" at the very least, given a unanimous "not guilty" verdict by the jury. And let us remember that Gary's hints at skin colour as a reason for prejudice don't really fly, given the range of skin hues of defence witnesses and media interviewees who testified to Zimmerman's character and concern for his neighbours.

My hat off to the jury, who discharged a very difficult duty and are no doubt relieved to be past this case:

A court public information officer said that members of the jury had no desire to speak to the media Saturday night. Identities of jury members are currently protected by a court anonymity order.
I'll bet they don't want to speak to the media. Not when media pundits like Gary write bilge like this:
Those who now fear violent social disorder must ask themselves whose interests are served by a violent social order in which young black men can be thus slain and discarded.
We must also ask ourselves how the violent social order arose in the first place. Here's a hint, Gary: broken families and dysfunctional education systems that produced people like the far-from-angelic Trayvon and the illiterate prosecution witness Rachel Jeantel are not unrelated. If Gary really is concerned about the lot of poor black families in the USA, and I see no reason to doubt his sincerity on this point, perhaps he should turn his writing and analytical talents to analysing why a nineteen year old woman cannot even read cursive writing, why black protests have a strong tendency to turn extremely violent and what considerable harm Al Sharpton is actually doing to the black community in his self-aggrandisements.

While we're here, let's note the firing late on Friday of an IT specialist in the state attorney's office who extracted all the photos and text messages from Martin's phone, and approached his attorney a couple months ago in concern that this information had not been turned over to Zimmerman's defence team in apparent violation of rules of evidence disclosure:

Kruidbos asked [lawyer] White in April for legal advice and described some contents of his report such as a photo of an African-American hand holding a gun, a photo of a plant resembling marijuana and a text message referring to a gun transaction.
It's possible that the timing of Kruidbos's dismissal, immediately after closing arguments in the trial, was coincidental. I hope it was, because the implications of deliberate timing in this action are rather disturbing.

2013-07-13

Judgement time for Zimmerman

The jury in the George Zimmerman trial has gone out, and we are now waiting to see whether he will be convicted of 2nd degree murder, manslaughter, or walk free.

A late-breaking development in the trial was the addition of the option of a manslaughter verdict, much to the distaste of defense attorney Don West:

West said he wanted the six jurors to only consider the second-degree murder charge or not guilty.
"The state has charged him with second degree murder. They should be required to prove it," West said. "If they had wanted to charge him with manslaughter … they could do that."
I'm in sympathy with West on this point. It does sound to me as if the prosecution felt that it hadn't got 2nd degree murder in the bag - there are bags of reasonable doubt in several areas of the case - and so wants to give the jury a "get-out" option of "guilty, kinda" in the hope that the defects in their case aren't gaping enough to prevent what could feel like a compromise verdict.

Calling which way this trial will go is essentially guesswork. I'm reasonably confident that he'll duck the 2nd degree murder charge - if the prosecution felt that they'd proven the charge, it seems unlikely that they'd had pushed for alternate charges - but between manslaughter and "not guilty" is too close to call. In fact, a hung jury is well within the possibilities. Then what? I wouldn't be surprised if an initial push for a retrial sputters out.

Zimmerman's guilt or otherwise is being judged by six women. The jury is mostly white, and most of them are mothers. Mothers may sympathise with Trayvon Martin's mother who lost a son, and want to blame someone for it, but alternatively may view Zimmerman as doing his best to protect the neighbourhood. In one sense it's a tough case to judge as it comes down to who was heard screaming - was it Trayvon, in which case Zimmerman must have attacked him, or was it Zimmerman being attacked by Trayvon, in which case it's self-defence? From where I'm sitting, a strict interpretation of "reasonable doubt" can't possibly convict Zimmerman based on the circumstantial evidence, hearsay and contradicting witnesses, but then I haven't been locked in the courtroom for weeks.

Incidentally, if the jury does go for manslaughter, I give the defense an excellent chance of having it reversed on appeal; the judge may have been leaning over backwards to give the prosecution additional options in order to prevent civil disturbances and uncomfortable fallout, but her job is to ensure a fair trial, not safeguard her popularity.

I do feel confident in predicting that even if Zimmerman is found "not guilty" then things are not going to get any easier for him.

Update: the instructions to the Zimmerman jury provide an interesting read. The judge is requiring a unanimous verdict from the 6 jurors, which makes a hung jury far more likely. Also, given the instructions about reliability of witnesses, I'd be extremely surprised at a 2nd degree murder verdict.

2013-07-07

What's in a name? A Tyler by any other name...

Predictable outrage by Barbara "Babs" Ellen in the Guardian in reaction to Katie Hopkins' comments about names as an indicator of class:

I felt wonderfully common, indeed militantly so, when I watched former Apprentice candidate Katie Hopkins on This Morning, telling Phillip Schofield and Holly Willoughby why she wouldn't allow her children to play with other children with "low-class" names such as Tyler, Charmaine or Chardonnay.
In Hopkins's view, a name was a useful short cut in her important life, providing vital information on a child's social status.
I seem to remember the Freakonomics authors making some persuasive statistical arguments that naming of children in American schools provided similar indications towards their parents' social status. They also touched on how some of this tied into racial background, and how many of the poorer American families of Afro-Caribbean background were consciously choosing emphatically "black"-sounding names like DeShawn and LaToya. Overall, in each generation there were popular "classical" names that tended to point to higher social class, and more exotic names that pointed downwards. Interestingly, there were certain names that might show upper social classes in one generation but then be borrowed for middle class children in the next, and then lower class in generations afterwards - the "aspirational" names.

Frank Chalk, author of It's your time you're wasting described the game that his fellow teachers where they'd read out a number of first names of a particular class and then try to guess whether they were top, middle or bottom set in ability. It turned out not to be particularly difficult.

First names do convey significant information about children in aggregate. Of course, on an individual basis you don't know whether Chardonnay was so named because her mother liked a daily bottle of the same, or because that was the principal grape in her father's vineyards. Whether you should act on that information, by selecting which social groups your child plays with, is another question which I choose not to tackle at this time.