Publications by xi'an
warped Cauchys
A somewhat surprising request on X validated about the inverse cdf representation of a warped Cauchy distribution. I had not come across this distribution, but its density being means that it is the superposition of shifted Cauchys on the unit circle (with nice complex representations). As such, it is easily simulated by re-shifting a Cauchy bac...
791 sym 6 img
unbalanced sampling
A question from X validated on sampling from an unknown density f when given both a sample from the density f restricted to a (known) interval A , f¹ say, and a sample from f restricted to the complement of A, f² say. Or at least on producing an estimate of the mass of A under f, p(A)… The problem sounds impossible to solve without an ability...
1637 sym 4 img
R rexp()
Following a question on X validated about the reasons for coding rexp() following Ahrens & Dieter (1972) version, I re-read Luc Devroye’s explanations. Which boils down to an optimised implementation of von Neumann’s Exponential generator. The central result is that, for any μ>0, M a Geometric variate with failure probability exp(-μ) and Z ...
1409 sym R (420 sym/1 pcs)
bean bag win
A quick riddle from The Riddler, where a multiple step game sees a probability of a 3 point increase of .4 and a probability of a 1 point increase of .3 with a first strategy (A), versus a probability of a 3 point increase of .4 and a probability of a 1 point increase of .3 with a second strategy (B), and a sure miss third strategy (C). The goal...
1003 sym R (215 sym/1 pcs) 2 img
more air for MCMC
Aki Vehtari, Andrew Gelman, Dan Simpson, Bob Carpenter, and Paul-Christian Bürkner have just published a Bayesian Analysis paper about using an improved R factor for MCMC convergence assessment. From the early days of MCMC, convergence assessment has been a recurring (and recurrent!) question in the community. First leading to a flurry of propos...
3111 sym 2 img
scale matters [maths as well]
A question from X validated on why an independent Metropolis sampler of a three component Normal mixture based on a single Normal proposal was failing to recover the said mixture… When looking at the OP’s R code, I did not notice anything amiss at first glance (I was about to drive back from Annecy, hence did not look too closely) and reran t...
1422 sym 4 img
on approximations of Φ and Φ⁻¹
As I was working on a research project with graduate students, I became interested in fast and not necessarily very accurate approximations to the normal cdf Φ and its inverse. Reading through this 2010 paper of Richards et al., using for instance (with another version replacing 2/π with the squared root of π/8) and $latex F_2(x)=1/1+exp(-1.5...
1020 sym R (372 sym/2 pcs) 4 img
inf R ! [book review]
Thanks to my answering a (basic) question on X validated involving an R code, R mistakes and some misunderstanding about Bayesian hierarchical modelling, I got pointed out to Patrick Burns’ The R inferno. This is not a recent book as the second edition is of 2012, with a 2011 version still available on-line. Which is the version I read. As hint...
3169 sym 2 img
breaking sticks of various length
A riddle from the Riddler with a variation on the theme of breaking sticks: Given a stick of length L, what is the optimal manner to break said stick to achieve a maximal product of the individual lengths? While the pen & paper resolution is a one-line back-of-the-envelope calculation, with an impact of the length L, obviously, a quick R code l...
829 sym R (120 sym/1 pcs) 2 img
almost reversed 2-lag Markov chain
Another simple riddle from the Riddler: take a binary sequence and associate to this sequence a score vector made of the numbers of consecutive ones from each position. If the sequence is ten step long and there are 3 ones located at random, what is the expected total score? (The original story is much more complex and involves as often strange s...
1111 sym R (161 sym/1 pcs)