Publications by xi'an

Bernouilli, Montmort and Waldegrave

14.04.2015

In the last issue of Statistical Science, David Belhouse [author of De Moivre’s biography]  and Nicolas Fillion published an accounting of a discussion between Pierre Rémond de Montmort, Nicolaus Bernoulli—”the” Bernoulli associated with the St. Petersburg paradox—, and Francis Waldegrave, about the card game of Le Her (or Hère, for ...

2439 sym R (550 sym/1 pcs) 8 img

simulating correlated Binomials [another Bernoulli factory]

20.04.2015

This early morning, just before going out for my daily run around The Parc, I checked X validated for new questions and came upon that one. Namely, how to simulate X a Bin(8,2/3) variate and Y a Bin(18,2/3) such that corr(X,Y)=0.5. (No reason or motivation provided for this constraint.) And I thought the following (presumably well-known) resoluti...

1977 sym R (108 sym/1 pcs) 8 img

scale acceleration

23.04.2015

Kate Lee pointed me to a rather surprising inefficiency in matlab, exploited in Sylvia Früwirth-Schnatter’s bayesf package: running a gamma simulation by rgamma(n,a,b) takes longer and sometimes much longer than rgamma(n,a,1)/b, the latter taking advantage of the scale nature of b. I wanted to check on my own whether or not R faced the same di...

1678 sym R (238 sym/2 pcs) 8 img

the most patronizing start to an answer I have ever received

29.04.2015

Another occurrence [out of many!] of a question on X validated where the originator (primitivus petitor) was trying to get an explanation without the proper background. On either Bayesian statistics or simulation. The introductory sentence to the question was about “trying to understand how the choice of priors affects a Bayesian model estimate...

2058 sym 4 img

Le Monde puzzle [#909]

30.04.2015

Another of those “drop-a-digit” Le Monde mathematical puzzle: Find all integers n with 3 or 4 digits an single interior zero digit, such that removing that zero digit produces a divider of x. As in puzzle #904, I made use of the digin R function: digin=function(n){ as.numeric(strsplit(as.character(n),"")[[1]])} and simply checked all int...

945 sym R (438 sym/3 pcs) 6 img

take those hats off [from R]!

04.05.2015

This is presumably obvious to most if not all R programmers, but I became aware today of a hugely (?) delaying tactic in my R codes. I was working with Jean-Michel and Natesh [who are visiting at the moment] and when coding an MCMC run I was telling them that I usually preferred to code Nsim=10000 as Nsim=10^3 for readability reasons. Suddenly, I...

1846 sym R (1237 sym/3 pcs) 6 img

corrected MCMC samplers for multivariate probit models

05.05.2015

“Moreover, IvD point out an error in Nobile’s derivation which can alter its stationary distribution. Ironically, as we shall see, the algorithms of IvD also contain an error.”  Xiyun Jiao and David A. van Dyk arXived a paper correcting an MCMC sampler and R package MNP for the multivariate probit model, proposed by Imai and van Dyk in 200...

2916 sym 8 img

arbitrary distributions with set correlation

10.05.2015

A question recently posted on X Validated by Antoni Parrelada: given two arbitrary cdfs F and G, how can we simulate a pair (X,Y) with marginals  F and G, and with set correlation ρ? The answer posted by Antoni Parrelada was to reproduce the Gaussian copula solution: produce (X’,Y’) as a Gaussian bivariate vector with correlation ρ and the...

2019 sym R (345 sym/2 pcs) 8 img

quantile functions: mileage may vary

11.05.2015

When experimenting with various quantiles functions in R, I was shocked [ok this is a bit excessive, let us say surprised] by how widely the execution times would vary. To the point of blaming a completely different feature of R. Borrowing from Charlie Geyer’s webpage on the topic of probability distributions in R, here is a table for some stan...

1444 sym R (219 sym/2 pcs) 4 img 1 tbl

another viral math puzzle

24.05.2015

After the Singapore Maths Olympiad birthday problem that went viral, here is a Vietnamese primary school puzzle that made the frontline in The Guardian. The question is: Fill the empty slots with all integers from 1 to 9 for the equality to hold. In other words, find a,b,c,d,e,f,g,h,i such that a+13xb:c+d+12xe–f-11+gxh:i-10=66. With presumably ...

1517 sym R (137 sym/1 pcs) 6 img