# Probability

### Variable probability Bernoulli outcomes – Fast and Slow

November 1, 2012 |

I am working on a project that requires the generation of Bernoulli outcomes. Typically, I would go about this using the built in sample() function like so: This works great and is fast, even for large n. Problem is, I want to generate each sample with its own unique probability. ... [Read more...]

### Introduction to Bayesian lecture: Accompanying handouts and demos

October 19, 2012 |

I recently posted the slides from a guest lecture that I gave on Bayesian methods for biologists/ecologist. In an effort to promote active learning, the class was not a straight forward lecture, but rather a combination of informational input from me and opportunities for students to engage with the ... [Read more...]

### Introduction to Bayesian Methods guest lecture

October 18, 2012 |

This is a talk I gave this week in Advanced Biostatistics at McGill. The goal was to provide an gentle introduction to Bayesian methodology and to demonstrate how it is used for inference and prediction. There is a link to an accompanying R script in the slides [Read more...]

### Observing Dark Worlds – Visualizing dark matter’s distorting effect on galaxies

October 13, 2012 |

Some people like to do crossword puzzles. I like to do machine learning puzzles. Lucky for me, a new contest was just posted yesterday on Kaggle. So naturally, my lazy Saturday was spent getting elbow deep into the data. The training set consists of a series of ‘skies’, each containing ... [Read more...]

### Continuous dispersal on a discrete lattice

September 27, 2012 |

Dispersal is a key process in many domains, and particularly in ecology. Individuals move in space, and this movement can be modelled as a random process following some kernel. The dispersal kernel is simply a probability distribution describing the distance travelled in a given time frame. Since space is continuous, ... [Read more...]

### The future of Artificial Intelligence – as imagined in 1989

September 6, 2012 |

This image comes from the cover of Preliminary Papers of the Second International Workshop on Artificial Intelligence and Statistics (1989). Someone abandoned it in the lobby of my building at school. Whatever for, I’ll never know. I just love the idea of machine learning/AI/Statistics evoking a robot hand ... [Read more...]

### An update on visualizing Bayesian updating

August 17, 2012 |

A while ago I wrote this post with some R code to visualize the updating of a beta distribution as the outcome of Bernoulli trials are observed. The code provided a single plot of this process, with all the curves overlayed on top of one another. Then John Myles White (... [Read more...]

### Simulation: The modeller’s laboratory

August 10, 2012 |

In his 2004 paper in Trends in Ecology and Evolution, Steven Peck argues: Simulation models can be used to mimic complex systems, but unlike nature, can be manipulated in ways that would be impossible, too costly or unethical to do in natural systems. Simulation can add to theory development and testing, ... [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...]

### R Workshop: Reproducible Research using Sweave for Beginers

April 27, 2012 |

Monday, April 30, 2012  14h-16h. Stewart Biology Rm w6/12 (Montreal) guRu: Denis Haine (Université de Montréal) Topics Reproducible research was first coined by Pr. Jon Claerbout, professor of geophysics at Stanford University, to describe that the results from researches can be replicated by other scientists by making available data, procedures, ... [Read more...]

### Insights into Quantile Regression from Arthur Charpentier

April 24, 2012 |

At this Monday’s Montreal R User Group meeting, Arthur Charpentier gave an interesting talk on the subject of quantile regression. One of the main messages I took away from the workshop was that quantile regression can be used to determine if extreme events are becoming more extreme. The example ... [Read more...]

### Montreal R Workshop: Quantile Regression

April 17, 2012 |

Stewart Biology Building, McGill University (Rm N4/17) Monday, April 24, 2012  14h-16h Dr. Arthur Charpentier (UQàM) In this workshop we will examine difference concepts related to quantiles, and practical issues based on R codes. This workshop will present quantile regression, and the idea of iterative least square estimation. It will ... [Read more...]

### Playing with fire (or water)

April 2, 2012 |

A few days ago, http://www.futilitycloset.com/ published a short post based on the fourth problem of the 1987 Canadian Mathematical Olympiad (from on a problem from the 6th All Soviet Union Mathematical Competition in Voronezh, 1966). The problem i... [Read more...]

### Sunday evening, stupid games…

April 1, 2012 |

This evening, while I was about to wash the dishes, I heard my elders starting a game (call them Him and Her) Him: "I have picked - in my head - a number, lower than 50. Try to guess..." Her: "No way, too difficult..." Him: "You can try five differ... [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...]

### Montreal R Workshop: Introduction to Bayesian Methods

March 22, 2012 |

Monday, March 26, 2012  14h-16h, Stewart Biology N4/17 Corey Chivers, Department of Biology McGill University This is a meetup of the Montreal R User Group. Be sure to join the group and RSVP. More information about the workshop here. Topics Why would we want to be Bayesian in the first place?  ... [Read more...]

### Monty Hall Simulations

March 20, 2012 |

Using R I'm doing a lot of simulations of the classic monty hall-problem and plotting multiple simulations using ggplot2. [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...]

### How Not To Draw a Probability Distribution

March 7, 2012 |

If I google for “probability distribution” I find the following extremely bad picture: It’s bad because it conflates ideas and oversimplifies how variable probability distributions can generally be. Most distributions are not unimodal. Most dist... [Read more...]

### Example 9.21: The birthday "problem" re-examined

February 23, 2012 |

The so-called birthday paradox or birthday problem is simply the counter-intutitive discovery that the probability of (at least) two people in a group sharing a birthday goes up surprisingly fast as the group size increases. If the group is only 23 peo...