Streaming Log-sum-exp Computation

Posted on Sun 08 May 2016 in Algorithms

A common numerical operation in statistical computing is to compute

$$\log \sum_{i=1}^n \exp x_i,$$

where \(x_i \in \mathbb{R}\), and \(n\) is potentially very large.

We can implement the above computation by exponentiating each number, then summing them, then taking a logarithm as follows (written in Julia …


Continue reading

Reverse Search

Posted on Fri 07 August 2015 in Algorithms

One of my all-time favorite algorithms is reverse search proposed by David Avis and Komei Fukuda in 1992, PDF.

Reverse search is an algorithm to solve enumeration problems, that is, problems where you would like to list a finite set of typically combinatorially related elements. Reverse search is not quite …


Continue reading

Streaming Mean and Variance Computation

Posted on Sun 25 January 2015 in Algorithms

Given a sequence of observed data we would often like to estimate simple quantities like the mean and variance.

Sometimes the data is available in a streaming setting, that is, we are given one sample at a time. For example, this is the case when

  • the number of samples is …

Continue reading