# Monte Carlo

### Why trust some supposed laws of statistical sampling and…

August 15, 2012 |

Why trust some supposed laws of statistical sampling and convergence when you can just test them yourself? If you have a computer with R installed (also recommended: Rstudio) then you can stop dithering about whether these n=1000 studies cited in the n... [Read more...]

### Simulating Euro 2012

June 11, 2012 |

Why settle for just one realisation of this year’s UEFA Euro when you can let the tournament play out 10,000 times in silico? Since I already had some code lying around from my submission to the Kaggle hosted 2010 Take on the Quants challenge, I figured I’d recycle it for ... [Read more...]

### Ruin probability and infinite time

March 27, 2012 |

A couple of weeks ago, I had a discussion with a practitioner, working in some financial company, about ruin, and infinite time. And it remind me a weird result. Well, not a weird result, but a result I found disturbing, at first, when I was a stud... [Read more...]

### π Day Special! Estimating π using Monte Carlo

March 14, 2012 |

In honour of π day (03.14 – can’t wait until 2015~) , I thought I’d share this little script I wrote a while back for an introductory lesson I gave on using Monte Carlo methods for integration. The concept is simple – we can estimate the area of an object which is inside another ... [Read more...]

### Sampling for Monte Carlo simulations with R

October 31, 2011 |

I've knocked together a quick function for generating efficient Monte Carlo samples. It takes a bit of the legwork out of running Monte Carlo simulations. [Read more...]

### No simulation is complete without a gif

March 24, 2011 |

I promise this is my last post on the now week and a half old π pay! Building on the last post, I figured I could show how convergence actually works in the estimation algorithm. If you’ll recall, we plotted … Continue reading → [Read more...]

### More pi plus 1 (or plus 0.01) day fun

March 15, 2011 |

Since I just didn’t get enough this morning, I spent some more time fooling around with estimating pi. Since I was basically counting the number of random x,y pairs inside a quarter circle and computing a sample average for more … Continue reading → [Read more...]

### I’m late for π day

March 15, 2011 |

It is officially no longer pi day, but I didn’t see this Drew Conway post about estimating pi until just a few minutes ago. Because Google Reader doesn’t show github embeds, I also got to try it without seeing Drew’s … Continue reading → [Read more...]

### A Million Random Digits: review of reviews

March 4, 2011 |

Recently on his blog (here), Robin mentioned an amazing book, called "A Million Random Digits" published by RAND corporation. The book was initially published in 1955, but RAND published a nice (and expensive) second edition. A great thing is that ... [Read more...]

January 5, 2011 |

Another exciting day at Adap’skiii!!! Yves Atchadé presented a very recent work on the fundamental issue of estimating the asymptotic variance estimation for adaptive MCMC algorithms, with an intriguing experimental observation that a non-converging bandwidth with rate 1/n was providing better coverage than the converging rate. (I always found ...

### The Chosen One

August 30, 2010 |

Toss one hundred different balls into your basket. Shuffle them up and select one with equal probability amongst the balls. That ball you just selected, it’s special. Before you put it back, increase its weight by 1/100th. Then put it back, mix up the balls and pick again. If ... [Read more...]

### Random sudokus [p-values]

May 21, 2010 |

I reran the program checking the distribution of the digits over 9 “diagonals” (obtained by acceptable permutations of rows and column) and this test again results in mostly small p-values. Over a million iterations, and the nine (dependent) diagonals, four p-values were below 0.01, three were below 0.1, and two were above (0.21 and 0.42). [...]

### ACM Transactions on Modeling and Computer Simulation

May 20, 2010 |

Pierre Lecuyer is the new editor of the ACM Transactions on Modeling and Computer Simulation (TOMACS) and he has asked me to become an Area Editor for the new area of simulation in Statistics. I am quite excited by this new Æditor’s hat, since this is a cross-disciplinary journal: ... [Read more...]

### Random [uniform?] sudokus [corrected]

May 19, 2010 |

As the discrepancy [from 1] in the sum of the nine probabilities seemed too blatant to be attributed to numerical error given the problem scale, I went and checked my R code for the probabilities and found a choose(9,3) instead of a choose(6,3) in the last line… The fit between the ...

### Random [uniform?] sudokus

May 19, 2010 |

A longer run of the R code of yesterday with a million sudokus produced the following qqplot. It does look ok but no perfect. Actually, it looks very much like the graph of yesterday, although based on a 100-fold increase in the number of simulations. Now, if I test the ...

### Random sudokus [test]

May 17, 2010 |

Robin Ryder pointed out to me that 3 is indeed the absolute minimum one could observe because of the block constraint (bon sang, mais c’est bien sûr !). The distribution of the series of 3 digits being independent over blocks, the theoretical distribution under uniformity can easily be simulated: #uniform distribution ...

### Sudokus more random than random!

April 18, 2010 |

Darren Wraith pointed out this column about sudokus to me. It analyses the paper by Newton and De Salvo published in the Proceedings of the Royal Academy of Sciences A that I cannot access from home. The discussion contains this absurd sentence “Sudoku matrices are actually more random than randomly-generated ... [Read more...]

December 11, 2009 |

When looking around on Amazon, I found that “Introducing Monte Carlo Methods with R” was associated with another very recently published (same day as ours!) book, “Understanding Computational Bayesian Statistics“, by William Bolstad, that seems to mostly cover the same ground as us (with some connections with Bayesian Core for ...