# stats

## Marsaglia Transform: Uniform to Standard Normal

The polar method (attributed to George Marsaglia, 1964) is a pseudo-random number sampling method for generating a pair of independent standard normal random variables. While it is superior to the Box–Muller transform, the Ziggurat algorithm is even more efficient. – Wikipedia This post by Hristo Dachev on the Marsaglia transform …

## Streaming descriptive statistics

I recently ran into the problem of getting sample statistics from potentially infinite population or very large sample sizes. The problem is that most algorithms scale linearly with this problem domain. Especially when looking at quartiles. I am going to detail below firstly how I was doing things and secondly …

## Streaming Histograph

Streaming Histograph is a term I came up with for a component I tried to recreate from controul.com. It is essentially a histogram that works with stream data. Stream data is a series of data where there is no known end or where the population size is potentially infinite. The …

## Binary Sorted Array

Some versions of quick sort and some other sorting algorithms have their worst case when a list is mostly sorted. This post is about an array that keeps itself sorted. It makes use of a binary search to determine the place to insert a new element. Let it be noted …

## Park Miller distributions

I have posted previously about the Park Miller method for generating uniform random numbers. This post is about visualising the distribution and any modifications of the .random() function. The histographer is used to visualise the distribution and estimate the descriptive statistics. The default ParkMiller.random() uniform distribution is shown first. Thereafter …

## Coins Spinning

The code for this post originally started out as example on how to remove bias from a biased coin flip. The code was written to transform a coin that landed heads up 25% of the time to get a result landing heads up 50% of the time. However, as the …

## Dice Distributions

To generate random numbers that follow a certain distribution you can generate them using the formula of the distribution. This is great if you have a distribution which is in polynomial form. Another way to get such a distribution is to make use of dice. I know what the distribution …