Posts Tagged ‘ Probability ’

Visualising the Metropolis-Hastings algorithm

February 10, 2012
By
Visualising the Metropolis-Hastings algorithm

In a previous post, I demonstrated how to use my R package MHadapive to do general MCMC to estimate Bayesian models. The functions in this package are an implementation of  the Metropolis-Hastings algorithm. In this post, I want to provide an intuitive way to picture what is going on ‘under the hood’in this algorithm. The

Read more »

Gauging Interest in a Montreal R User Group

February 7, 2012
By
Gauging Interest in a Montreal R User Group

Some of us over at McGill’s Biology Graduate Student Association have been developing and delivering R/Statistics workshops over the last few years. Through invited graduate students and faculty, we have tackled  everything from multi-part introductory workshops to get your feet wet, to special topics such as GLMs, GAMs, Multi-model inference, Phylogenetic analysis, Bayesian modeling, Meta-analysis,

Read more »

General Bayesian estimation using MHadaptive

February 6, 2012
By
General Bayesian estimation using MHadaptive

If you can write the likelihood function for your model, MHadaptive will take care of the rest (ie. all that MCMC business). I wrote this R package to simplify the estimation of posterior distributions of arbitrary models. Here’s how it works: 1) Define your model (ie the likelihood * prior). In this example, lets build

Read more »

Monty Hall by simulation in R

February 3, 2012
By
Monty Hall by simulation in R

(Almost) every introductory course in probability introduces conditional probability using the famous Monte Hall problem. In a nutshell, the problem is one of deciding on a best strategy in a simple game. In the game, the contestant is asked to select one of three doors. Behind one of the doors is a great prize (free

Read more »

Uncertainty in markov chains: fun with snakes and ladders

December 31, 2011
By
Uncertainty in markov chains: fun with snakes and ladders

I love board games. Over the holidays, I came across this interesting post over at Arthur Charpentier’s Freakonometrics blog about the classic game of snakes and ladders. The post is a nice little demonstration of how the game can be formulated completely as a Markov chain, and can be analysed simply using the mathematics of

Read more »

Visualizing Sampling Distributions

September 25, 2011
By
Visualizing Sampling Distributions

Teacher: “How variable is your estimate of the mean?” Student: “Uhhh, it’s not. I took a sample and calculated the sample mean. I only have one number.” Teacher: “Yes, but what is the standard deviation of sample means?” Student: “What do you mean means, I only have the one friggin number.” Statisticians have a habit

Read more »

Visualizing Bayesian Updating

September 10, 2011
By
Visualizing Bayesian Updating

One of the most straightforward examples of how we use Bayes to update our beliefs as we acquire more information can be seen with a simple Bernoulli process. That is, a process which has only two  possible outcomes. Probably the most commonly thought of example is that of a coin toss. The outcome of tossing

Read more »

Hey! I made you some Wiener processes!

September 7, 2011
By
Hey! I made you some Wiener processes!

Check them out. Here are thirty homoskedastic ones: > homo.wiener for (j in 1:30) {  for (i in 2:length(homo.wiener)) {          homo.wiener for (j in 1:30) {        plot( homo.wiener,           type = "l", col = rgb(.1,....

Read more »

Hey! I made you some Wiener processes!

September 7, 2011
By
Hey! I made you some Wiener processes!

Check them out. Here are thirty homoskedastic ones: > homo.wiener for (j in 1:30) {  for (i in 2:length(homo.wiener)) {          homo.wiener for (j in 1:30) {        plot( homo.wiener,           type = "l", col = rgb(.1,....

Read more »

Using simulation to demonstrate theory: Hardy-Weinberg Equilibrium

June 13, 2011
By
Using simulation to demonstrate theory: Hardy-Weinberg Equilibrium

One of my teaching roles is in an introductory Genetics course, where first year students are presented with a wide range of new ideas at a relatively fast pace.  It seems that often, students choose to take a memorization approach to learning the material, rather than taking the chance to think about how and why

Read more »