Category Archives: statistics

## Those pesky p-values and simulated p-values

Last time, we investigated the use of the $\chi^2$-test in the following experiment described in [1]: a plot of land was divided into 112 20m by 20m squares. Half of these squares received an artificially large perch, and the researchers observed which squares were chosen by Red-winged Blackbirds to make their nests. The results were […]

## A quick guide to Python’s random number generator

If you are doing applied math and want to run a computer simulation, then chances are you will need random numbers. I write most of my simulations in Python, and luckily Python has a great random number library. Let’s see how to use it. The first step is to import the library: import random random.seed() […]

## Linear models: reversing the predictors and the predicted

Consider $n$ observed data points $(x_1,y_1),\dots, (x_n, y_n)$. We think they might satisfy a linear model $y = ax + b$. Finding the coefficients $a$ and $b$ is called linear regression, and the most typical way to find them is the method of least squares: that is, we find $a$ and $b$ that minimize the […]

## Conditioning and a sum of Poisson random variables

Previously we talked about the Poisson distribution. The Poisson distribution with mean $\mu \gt 0$ is a distribution on the natural numbers whose density function is $$f(n) = \frac{e^{-\mu}\mu^n}{n!}$$ We have already seen that the Poisson distribution essentially arises from the binomial distribution as a sort of “limiting case”. In fact, the Poisson distribution is […]

## Maximum likelihood, moments, and the uniform distribution

Suppose we have observations from a known probability distribution whose parameters are unknown. How should we estimate the parameters from our observations? Throughout we’ll focus on a concrete example. Suppose we observe a random variable drawn from the uniform distribution on $[0,\theta]$, but we don’t know what $\theta$ is. Our one observation is the number […]

## Where does the Poisson distribution come from?

The Poisson distribution is a discrete probability distribution on the natural numbers $0,1,2,\dots$. Its density function depends on one parameter $\mu$ and is given by $$d(n) = \frac{e^{-\mu}\mu^n}{n!}$$ Not surprisingly, the parameter $\mu$ is the mean, which follows from the exponential series $$e^x = \sum_{n=0}^\infty \frac{x^n}{n!}$$ Here is what the density function looks like when […]

## Do The Continents Affect Surface Air Temperature?

The internet has enabled researchers and organisations of various kinds to make their data available for free to download and hence anyone with a computer and some rudimentary R knowledge can observe and analyse all sorts of trends in everything from economics to society to natural phenomena. Obviously this can provide endless hours of fun […]