## Monte Carlo integration

I recently came across this question: “You have a function called random that randomly generates a number between 0 to 1. Use this to calculate pi.” Worded differently, the question is asking you to estimate pi using random numbers. As you can read in the script for Life of Pi (one of my favourite movies):…

## Markov chain

A Markov chain is a mathematical system that undergoes transitions from one state to another on a state space in a stochastic (random) manner. Examples of Markov chains include the board game snakes and ladders, where each state represents the position of a player on the board and a player moves between states (different positions…

## Probability

The fundamental idea of inferential statistics is determining the probability of obtaining the observed data when we assume the null hypothesis is true. For example, if we roll a die 10 times and got 10 sixes, what is the probability of observing this result if we assume the null hypothesis that the die was fair?…

## Combinations and permutations in R

Time to get another concept under my belt, combinations and permutations. While I’m at it, I will examine combinations and permutations in R. As you may recall from school, a combination does not take into account the order, whereas a permutation does. Using the example from my favourite website as of late, mathsisfun.com: A fruit…

## Calculus

Calculus in Latin means pebble or small stone, such that we are working with small pieces. There are two main ideas in calculus, the first being differentiation or finding a derivative (finding a slope, which would equal the rate) and the second being integration, which is the joining (or integration) of the small pieces together…

## Distance Matrix Computation

Here I demonstrate the distance matrix computations using the R function dist(). Firstly let’s prepare a small dataset to work with: How does this dataset look in 3 dimensional space? We can see that points 4 and 6 are quite far away from each other.

## Set notation

I’ve just started the Mathematical Biostatistics Boot Camp 1 and to help me remember the set notations introduced in the first lecture, I’ll include them here: The sample space, $$\Omega$$ (upper case omega), is the collection of possible outcomes of an experiment, such as a die roll: $$!\Omega = \{1, 2, 3, 4, 5, 6\}$$…

## Using LaTeX with WordPress

Updated 2017 November 17th WordPress now supports LaTeX. To display LaTeX, just surround the code with “$latex” and “$”, without the quotations. In this post, I show some formulae from this tutorial on SVD. I’ve shown the code for each formula; you can also mouseover the formula to see the code.