Patrick Juola: Language Log » Rowling and "Galbraith": an authorial analysis:
Language is a set of choices, and speakers and writers tend to fall into habitual, or at least common, choices… dialect… social pressure… and some just seem to come…. much of this apparently free variation is actually rather static at least at an individual level. So by studying examples of documents a person has written, we can build a model of the kind of choices that person makes…. Mosteller and Wallace studied the writing styles of The Federalist Papers in the mid-60s and showed, for example, that Alexander Hamilton never used the word "whilst" but that James Madison never used the word "while." More interestingly, they both used the word "by," but Madison consistently used it twice as often. I was approached by a reporter, Cal Flyn, from the Sunday Times, to assess this kind of variation in the writings of "Robert Galbraith," a first-time novelist and author of The Cuckoo's Calling…. For the past ten years or so, I've been working on a software project to assess stylistic similarity automatically, and at the same time, test different stylistic features to see how well they distinguish authors….
I was given e-text copies of Cuckoo to compare against Rowling's own The Casual Vacancy, Ruth Rendell's The St. Zita Society, P.D. James' The Private Patient and Val McDermid's The Wire in the Blood…. Of the 11 sections of Cuckoo, six were closest (in distribution of word lengths) to Rowling, five to James. No one else got a mention….
Nothing at all pointed to Rendell as a possible author, and only one test, and an unreliable one at that, suggested James. McDermid could be a reasonable candidate author, but the word length distribution seemed almost entirely uncharacteristic of her. The only person consistently suggested by every analysis was Rowling…. Does this prove that Rowling wrote Cuckoo? Of course not. All it really "proves" — suggests, rather — is that out of the four authors studied, the most likely candidate author is probably Rowling. But it could easily also be by someone who, by accident or design, wrote like Rowling…. It was certainly enough for the Sunday Times to use as part of their package when they approached Rowling's agent and asked, directly, "Did J.K. Rowling write The Cuckoo's Calling?" Less than a day later, Rowling confirmed through a spokesman that she had indeed written the novel, and the story launched.