## How to use mcsm

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

Within the past two days, I received this email

Dear Prof.Robert
I have just bought your recent book on Introducing Monte Carlo Methods with R.  Although I have checked your web page for the R programs (bits of the code in the book, codes for generating the figures and tec – not the package available on cran)  used in the book, I have not found them.
I wonder whether you could make them available.
Thank you very much for your time and patience.
Yours Sincerely

and that one

Dear Prof. Robert,
I bought “Introducing Monte Carlo Methods with R” from Amazon booksore. I am a teacher at […] University, and I choose this book as a textbook in my class.
I can not find the R package “mcsm” according to your book (page 5). Where can I download the R package “mcsm”?
I highly appreciate your help.
Best regards,

so I fear that readers may miss the piece of information provided in the book. As indicated on pages 36-37 of Introducing Monte Carlo Methods with R, mcsm is a registred R package, readers can therefore download it manually from CRAN,  but they should first try using install.packages in R as this is both easier and safer. (They should check on the main R project webpage for more help in installing packages.)

Another useful information for readers is that the code used on the examples of Introducing Monte Carlo Methods with R is available from mcsm through the demo command/code. Typing demo(Chapter.3) starts the production of the examples of Chapter 3:

> demo(Chapter.3)

demo(Chapter.3)
————————
Type  <Return>   to start :
> # Section 3.1, Introduction
>
> ch=function(la){ integrate(function(x){x^(la-1)*exp(-x)},0,Inf)\$val}
> plot(lgamma(seq(.01,10,le=100)),log(apply(as.matrix(
+  seq(.01,10,le=100)),1,ch)),xlab=”log(integrate(f))”,
+  ylab=expression(log(Gamma(lambda))),pch=19,cex=.6)
> S=readline(prompt=”Type  <Return>   to continue : “)
Type  <Return>   to continue :

and obviously the same for all other chapters. This also means the code is available in the corresponding file, something like

/usr/lib/R/site-library/mcsm/demo/Chapter.3.R

depending on your system.

## Scottish “Happy Hours”

Posted in Mountains with tags , , on February 27, 2010 by xi'an

In preparation for my trip to Ben Nevis, next Tuesday, a pretty accurate definition of the meaning of “great weather” for Scottish climbers… My guide will be Max Hunter, whose blog is full of tantalising pictures. Looking forward some great weather!

## Welcome, Robin!

Posted in R, Statistics, University life with tags , , , on February 26, 2010 by xi'an

Robin Ryder started his new blog with his different solutions to Le Monde puzzle of last Saturday (about the algebraic sum of products…), solutions that are much more elegant than my pedestrian rendering. I particularly like the one based on the Jacobian of a matrix! (Robin is doing a postdoc in Dauphine and CREST—under my supervision—on ABC and other computational issues, after completing a PhD in Oxford on philogenic trees for language history with Geoff Nicholls. His talk at the Big’MC seminar last month is reproduced there.)

And, in a totally unrelated way, here is the Sudoku (in Le Monde) that started my post on simulated annealing, nicely represented on Revolutions. (Although I cannot see why the central columns are set in grey…) I must mention that I am quite surprised at the number of visits my post received, given that using simulated annealing for solving Sudokus has been around for a while. Even my R code, while original, does not compete with simulated annealing solutions that take a few seconds… I thus completely share Dirk Eddelbuettel‘s surprise in this respect (but point to him that Robin’s blog entry has nothing to do with Sudokus, but with another Le Monde puzzle!)

## Another review of Search for Certainty

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

The best thing about this book is that it will offend and annoy both frequentists and subjectivists. I implore my friends on both sides of the philosophical divide to read the book with an open mind.

Our comments, Andrew‘s and mine‘s, led Larry Wasserman to read Krzysztof Burdzy’s The Search for Certainty to make his own opinion and Andrew just posted Larry’s review. The review is highly positive, arguing that “this is an interesting and important book” and that “Burdzy makes a convincing case that the philosophy of probability is a complete failure“. While remaining utterly unconvinced (that the book has any bearing on the philosophical foundations of Statistics),  I will not engage here into another debate about The Search for Certainty as the readers can check for themselves the strength of Larry’s arguments. Needless to say, I cannot be convinced into redefining probability as an experimental science where Burdzy’s five laws would replace Kolmogorov’s three axioms…

## Monty Hall, again

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

This little article contains nothing new, and only almost trivial mathematics. It is a plea for future generations to preserve the life of The True Monty Hall paradox, and not let themselves be misled by probability purists who say “you must compute a conditional probability”.

Richard Gill posted a paper on arXiv this morning about the Monty Hall problem. He does not mean to try yet another solution to the problem more susceptible to convince the army of skeptics out there, but rather to illustrate the hidden and implicit assumptions behind the mathematisation (sic!) of the problem… As a background to the problem, Richard Gill refers to the book The Monty Hall Problem: The Remarkable Story of Math’s Most Contentious Brain Teaser that led to my earlier post. Now, after having read the paper and come upon the final sentence reported above, I must say I am none the wiser about why the author wrote the paper! To me the Monty Hall problem is primarily an instance of wrong conditioning… Nonetheless, I appreciate the points about visualising the puzzle as a decision theoretic problem and the solution as the minimax procedure.