Archive for randomness

Random dive MH

Posted in R, Statistics with tags , , , , on September 2, 2010 by xi'an

A new Metropolis-Hastings algorithm that I would call “universal” was posted by Somak Dutta yesterday on arXiv. Multiplicative random walk Metropolis-Hastings on the real line contains a different Metropolis-Hastings algorithm called the random dive. The proposed new value x’ given the current value x is defined by

\begin{cases} x\epsilon &\text{with probability } 1/2\\ x/\epsilon &\text{with probability } 1/2\end{cases}

when \epsilon is a random variable on (-1,1). Thus, at each iteration, the current value is either shrunk or expanded by a random amount. When I read the paper in the Paris metro, while appreciating that this algorithm could be geometrically ergodic as opposed to the classical random walk algorithm, I was not convinced by the practical impact of the method, as I thought that the special role of zero in the proposal was not always reflected in the target. Especially when considering that the proposal is parameter-free. However, after running the following R program on a target centred away from zero, I found the proposal quite efficient.

f=function(x){.5*dnorm(x,mean=14)+.5*dnorm(x,mean=35)}
Nsim=10^5
x=rep(5,Nsim)
for (t in 2:Nsim){
coef=runif(1,min=-1)^sample(c(-1,1),1)
prop=x[t-1]*coef
prob=abs(coef)*f(prop)/f(x[t-1])
x[t]=x[t-1]
if (runif(1)<prob) x[t]=prop
}
hist(x,pro=T,nclass=113,col=”wheat2″)
curve(f,add=T,n=1001,col=”sienna”,lwd=2)

Obviously, it is difficult to believe that this extension will keep working similarly well when the dimension increases but this is an interesting way of creating a heavy tail proposal.

Numbers rule your world

Posted in Books, Statistics with tags , , , , , , , , , , , on February 22, 2010 by xi'an

Andrew Gelman gave me a copy of the recent book Numbers rule your world by Kaiser Fung, along with the comment that it was a nice book but not for us. I spend my “lazy Sunday” morning reading the book at the breakfast table and agree with Andrew on his assessment. (waiting for the  incoming blog review!). Numbers rule your world is unlikely to bring enlightment to professional or academic statisticians, but it provides a nice and soft introduction to the use of statistics in everyday’s life, to the point I would encourage my second and third year students to read it. It covers a few topics that are central to Statistics via ten newspaper-ised stories that make for a very light read, but nonetheless make the point. The themes in Numbers rule your world are

  • variability matters more than average, as illustrated by queuing phenomena;
  • correlation is not causation, but is often good enough to uncover patterns, as illustrated by epidemiology and credit scoring;
  • Simpson’s paradox explains for apparent bias in group differences, as illustrated by SAT score differences between black students and white students;
  • false positives and false negatives have different impacts on the error (here comes Bayes theorem!), depending on population sizes and settings, as illustrated by the (great!) case of cheating athletes and polygraph tests (with a reference to Steve Fienberg‘s work);
  • extreme events may exhibit causes, or not, as illustrated by a cheating lottery case (involving Jeff Rosenthal as the expert, not the cheater!) and a series of air crashes.

The overall tone of Numbers rule your world is pleasant and engaging, at the other end of the stylistic spectrum from Taleb’s Black Swan. Fung’s point is obviously the opposite of Taleb‘s: he is showing the reader how well statistical modelling can explain for apparently paradoxical behaviour. Fung is also adopting a very neutral tone, again a major change from Taleb, maybe being even too positive (no the only mention is made of the current housing crisis in the pages Numbers rule your world dedicates to credit scoring comes in the conclusion, pp. 176-7). Now, in terms of novelty, I cannot judge of the amount of innovation when compared with (numerous) other popular science books on the topic. For instance, I think Jeff Rosenthal’s Struck by Lightning brings a rather deeper perspective, but maybe thus restricts the readership further…

Determinism versus randomness in Biology

Posted in Statistics with tags , on October 10, 2009 by xi'an

As mentioned earlier, I bought the current issue of La Recherche for its catchy special report on the impact of randomness on gene expressions and other biological events. The absurd graph was actually a good  warning about the quality of the report: there is nothing there but a succession of evidences, cut by empty generalities on the nature of randomness like “determinism is only a special case of randomness”, “random does not mean unpredictable” and “randomness does not imply an absence of reproducibility”… The type of determinism invoked in the articles seems to be related to the basic Cartesian type of determinism where a given cause always induces the same effect, which would mean that the same regulatory proteins induce the same expression on all genes at all times. Given that these proteins are in small quantities, thus are not available for all genes, it seems to me quite logical that some genes are expressed and others are not! The argument is therefore not even anti-deterministic but gives a finer reason to the source of the expression mechanism. Randomness at the molecular level thus appears as an evidence and the report does not shed any light on why this “theory” has had so much trouble to penetrate the deterministic foundations of Biology. This is a wasted opportunity as I think there are fairly interesting issues in this domain, in particular in trying to explain different reactions of a cell under identical energy  input and environmental conditions. As usual, I find the journal has a terrible tendency to oversimplifiy topics to the point of making them uninteresting.

Ps-A gold medal to the sentence that “throwing a [fair] coin 100,000 times will result in about 50,000 heads”, missing the fact that the standard deviation is then of 500, i.e. that the outcome is 50,000±1000… And a silver one for missing the religious meaning of probabilism.

Bad graph of the day

Posted in Books, Statistics with tags , , , , on October 7, 2009 by xi'an

The French general science monthly La Recherche published in its October issue a graph about the difference between randomness and determinism which, besides being useless and meaningless (with the caption “determinism, a case of probabilism“, as if probability was a kind of disease!), shares the same feature as a density plot I saw in The Economist when looking at an abridged Black Swan, namely that it shows two densities with the same modal value and with two strongly different areas. (I’ll comment later on the whole issue of separating determinism from randomness.)

More/less incriminating digits from the Iranian election

Posted in Statistics with tags , , , , , , on June 21, 2009 by xi'an

Following my previous post where I commented on Roukema’s use of Benford’s Law on the first digits of the counts, I saw on Andrew Gelman’s blog a pointer to a paper in the Washington Post, where the arguments are based instead on the last digit. Those should be uniform, rather than distributed from Benford’s Law, There is no doubt about the uniformity of the last digit, but the claim for “extreme unlikeliness” of the frequencies of those digits made in the paper is not so convincing. Indeed, when I uniformly sampled 116 digits in {0,..,9}, my very first attempt produced the highest frequency to be 20.5% and the lowest to be 5.9%. If I run a small Monte Carlo experiment with the following R program,

fre=0
for (t in 1:10^4){
   h=hist(sample(0:9,116,rep=T),plot=F)$inten;
   fre=fre+(max(h)>.16)*(min(h)<.05)
   }

the percentage of cases when this happens is 15%, so this is not “extremely unlikely” (unless I made a terrible blunder in the above!!!)… Even moving the constraint to

(max(h)>.169)*(min(h)<.041)

does not produce a very unlikely probability, since it is then 0.0525.

The second argument looks at the proportion of last and second-to-last digits that are adjacent, i.e. with a difference of ±1 or ±9. Out of the 116 Iranian results, 62% are made of non-adjacent digits. If I sample two vectors of 116 digits in {0,..,9} and if I consider this occurrence, I do see an unlikely event. Running the Monte Carlo experiment

repa=NULL
for (t in 1:10^5){
    dife=(sample(0:9,116,rep=T)-sample(0:9,116,rep=T))^2
    repa[t]=sum((dife==1))+sum((dife==81))
    }
repa=repa/116

shows that the distribution of repa is centered at .20—as it should, since for a given second-to-last digit, there are two adjacent last digits—, not .30 as indicated in the paper, and that the probability of having a frequency of .38 or more of adjacent digit is estimated as zero by this Monte Carlo experiment. (Note that I took 0 and 9 to be adjacent and that removing this occurrence would further lower the probability.)