Archive for Maxwell

simulating Maxwell distribution

Posted in Books, Kids, R, Statistics, University life with tags , , , , , , , on April 22, 2021 by xi'an

A question that came out on X validated a few days ago is how to efficiently simulate from a distribution with density


(Obviously this density is already properly normalised since the second moment of the standard Normal  distribution is one.) The first solution that came out (by Jarle Tufto) exploits the fact that this density corresponds to a signed root of a χ²(3) variate. This is a very efficient proposal that requires a Gamma sampler and a random sign sampler. Since the cdf is available in closed form,


I ran a comparison with a numerical inversion, but this is much slower. I also tried an accept-reject version based on a Normal proposal with a larger variance, but even when optimising this variance, the running time was about twice as large. While checking Devroye (1986) for any possible if unlikely trick, I came upon this distribution twice (p.119 in an unsolved exercise, p.176 presented as the Maxwell distribution). With the remark that, if

X~x²φ(x),  then  Y=UX~φ(x).

Inverting this result leads to X being distributed as


which recovers the original χ²(3) solution, if slightly (and mysteriously) increasing the simulation speed.

Mixture estimation and applications

Posted in Statistics, University life with tags , , , , on November 18, 2009 by xi'an

As posted earlier, there will be a workshop on mixture estimation at ICMS, in Edinburgh, in March 2010. It is organised by Kerrie Mengersen and Mike Titterington, and myself. The list of speakers so far is available on the workshop webpage and includes a sufficient array of sensitivities to make the starting roundtable on label switching a lively moment!

While attendance at this workshop is by invitation only and the total attendance will be strictly limited, as the  workshop will be held at 15 South College Street, Edinburgh, with all lectures being given in the Newhaven Lecture Theatre, if you wish to be considered for an invitation please contact within the coming days Professor Mike Titterington at Glasgow University.