## Archive for Monte Carlo Statistical Methods

## library, whatzat???

Posted in Books, Kids, pictures, University life with tags banned books, ENSAE, Francis Bacon, library, Monte Carlo Statistical Methods, online book, students, Trinity College Dublin on December 19, 2022 by xi'an## MCM in Paris, 2023

Posted in Books, pictures, Statistics, Travel, University life with tags conference fees, France, MCM 2023, Monte Carlo Methods and Applications, Monte Carlo Statistical Methods, Paris, Place Jussieu, registration fees, Sorbonne Université on December 16, 2022 by xi'an**T**he next MCM conference takes place in (downtown) Paris next 26-30 June. Deadlines are **31 December** for mini-symposia/invited sessions and **28 February** for contributed talks/posters. I appreciate very much the effort in lowering the registration fees to 80€ for students and 170€ for others, whilst including lunches into the deal! (The view of Paris in the above logo is actually taking from Paris Jussieu campus.)

## Contributions to BayesComp 23

Posted in Mountains, pictures, Statistics, Travel, University life with tags BayesComp 2023, Finland, International Society for Bayesian Analysis, ISBA, Kittilä airport, Lapland, Levi, MCMSki, Monte Carlo Statistical Methods on September 27, 2022 by xi'an**L**ast call for contributed sessions at BayesComp 2023, 15-17 March, Levi, Finland. Thanks to an increase in the conference rooms, a few more sessions remain available for submission. This edition of BayesComp promises to be the largest ever!!!

## why is this algorithm simulating a Normal variate?

Posted in Books, Kids, R, Statistics with tags cross validated, Devroye, Introducing Monte Carlo Methods with R, Luc Devroye, Monte Carlo Statistical Methods, Non-Uniform Random Variate Generation, normal generator, simulation on September 15, 2022 by xi'an**A** backward question from X validated as to why the above is a valid Normal generator based on exponential generations. Which can be found in most textbooks (if not ours). And in The Bible, albeit as an exercise. The validation proceeds from the (standard) Exponential density dominating the (standard) Normal density and, according to Devroye, may have originated from von Neumann himself. But with a brilliant reverse engineering resolution by W. Huber on X validated. While a neat exercise, it requires on average 2.64 Uniform generations per Normal generation, against a 1/1 ratio for Box-Muller (1958) polar approach, or 1/0.86 for the Marsaglia-Bray (1964) composition-rejection method. The apex of the simulation jungle is however Marsaglia and Tsang (2000) ziggurat algorithm. At least on CPUs since, Note however that *“The ziggurat algorithm gives a more efficient method for scalar processors (e.g. old CPUs), while the Box–Muller transform is superior for processors with vector units (e.g. GPUs or modern CPUs)”* according to Wikipedia.

To draw a comparison between this Normal generator (that I will consider as von Neumann’s) and the Box-Müller polar generator,

```
#Box-Müller
bm=function(N){
a=sqrt(-2*log(runif(N/2)))
b=2*pi*runif(N/2)
return(c(a*sin(b),a*cos(b)))
}
#vonNeumann
vn=function(N){
u=-log(runif(2.64*N))
v=-2*log(runif(2.64*N))>(u-1)^2
w=(runif(2.64*N)<.5)-2
return((w*u)[v])
}
```

here are the relative computing times

```
> system.time(bm(1e8))
utilisateur système écoulé
7.015 0.649 7.674
> system.time(vn(1e8))
utilisateur système écoulé
42.483 5.713 48.222
```

## Bayes Rules! [book review]

Posted in Books, Kids, Mountains, pictures, R, Running, Statistics, University life with tags Abele Blanc, Adriana Rosenbluth, Ama Dablam, Annapurna, applied Bayesian analysis, Australia, Bayes factor, Bayes rule, Bayesian modelling, Bletchley Park, book ban, book review, CHANCE, conjugate priors, CRAN, effective sample size, Enigma code machine, ergodicity, Florida, Gibbs distribution, Himalayas, history of statistics, introductory textbooks, it's greek to me, MCMC, Monte Carlo Statistical Methods, R, rStan, simulation, STAN, Uluru, undergraduates, weakly informative prior on July 5, 2022 by xi'anBayes Rules! is a new introductory textbook on Applied Bayesian Model(l)ing, written by Alicia Johnson (Macalester College), Miles Ott (Johnson & Johnson), and Mine Dogucu (University of California Irvine). Textbook sent to me by CRC Press for review. It is available (free) online as a website and has a github site, as well as a bayesrule R package. (Which reminds me that both our own book R packages, bayess and mcsm, have gone obsolete on CRAN! And that I should find time to figure out the issue for an upgrading…)

As far as I can tell [from abroad and from only teaching students with a math background], Bayes Rules! seems to be catering to early (US) undergraduate students with very little exposure to mathematical statistics or probability, as it introduces basic probability notions like pmf, joint distribution, and Bayes’ theorem (as well as Greek letters!) and shies away from integration or algebra (a covariance matrix occurs on page 437 with a lot . For instance, the Normal-Normal conjugacy derivation is considered a “mouthful” (page 113). The exposition is somewhat stretched along the 500⁺ pages as a result, imho, which is presumably a feature shared with most textbooks at this level, and, accordingly, the exercises and quizzes are more about intuition and reproducing the contents of the chapter than technical. In fact, I did not spot there a mention of sufficiency, consistency, posterior concentration (almost made on page 113), improper priors, ergodicity, irreducibility, &tc., while other notions are not precisely defined, like ESS, weakly informative (page 234) or vague priors (page 77), prior information—which makes the negative answer to the quiz “*All priors are informative*” (page 90) rather confusing—, R-hat, density plot, ~~scaled likelihood,~~ and more.

As an alternative to “technical derivations” Bayes Rules! centres on intuition and simulation (yay!) via its bayesrule R package. Itself relying on rstan. Learning from example (as R code is always provided), the book proceeds through conjugate priors, MCMC (Metropolis-Hasting) methods, regression models, and hierarchical regression models. Quite impressive given the limited prerequisites set by the authors. (I appreciated the representations of the prior-likelihood-posterior, especially in the sequential case.)

Regarding the “hot tip” (page 108) that the posterior mean always stands between the prior mean and the data mean, this should be made conditional on a conjugate setting and a mean parameterisation. Defining MCMC as a method that produces a sequence of realisations that are *not* from the target makes a point, except of course that there are settings where the realisations *are* from the target, for instance after a renewal event. Tuning MCMC should remain a partial mystery to readers after reading Chapter 7 as the Goldilocks principle is quite vague. Similarly, the derivation of the hyperparameters in a novel setting (not covered by the book) should prove a challenge, even though the readers are encouraged to “go forth and do some Bayes things” (page 509).

While Bayes factors are supported for some hypothesis testing (with no point null), model comparison follows more exploratory methods like X validation and expected log-predictive comparison.

The examples and exercises are diverse (if mostly US centric), modern (including cultural references that completely escape me), and often reflect on the authors’ societal concerns. In particular, their concern about a fair use of the inferred models is preminent, even though a quantitative assessment of the degree of fairness would require a much more advanced perspective than the book allows… (In that respect, Exercise 18.2 and the following ones are about book banning (in the US). Given the progressive tone of the book, and the recent ban of math textbooks in the US, I wonder if some conservative boards would consider banning it!) Concerning the Himalaya submitting running example (Chapters 18 & 19), where the probability to summit is conditional on the age of the climber and the use of additional oxygen, I am somewhat surprised that the *altitude* of the targeted peak is not included as a covariate. For instance, Ama Dablam (6848 m) is compared with Annapurna I (8091 m), which has the highest fatality-to-summit ratio (38%) of all. This should matter more than age: the Aosta guide Abele Blanc climbed Annapurna without oxygen at age 57! More to the point, the (practical) detailed examples do not bring unexpected conclusions, as for instance the fact that runners [thrice alas!] tend to slow down with age.

A geographical comment: Uluru (page 267) is not a city!, but an impressive sandstone monolith in the heart of Australia, a 5 hours drive away from Alice Springs. And historical mentions: Alan Turing (page 10) and the team at Bletchley Park indeed used Bayes factors (and sequential analysis) in cracking the Enigma, but this remained classified information for quite a while. Arianna Rosenbluth (page 10, but missing on page 165) was indeed a major contributor to Metropolis et al. (1953, not cited), but would not qualify as a Bayesian statistician as the goal of their algorithm was a characterisation of the Boltzman (or Gibbs) distribution, not statistical inference. And David Blackwell’s (page 10) Basic Statistics is possibly the earliest instance of an introductory Bayesian and decision-theory textbook, but it never mentions Bayes or Bayesianism.

*[Disclaimer about potential self-plagiarism: this post or an edited version will eventually appear in my Book Review section in CHANCE.]*