My final exam for the Monte Carlo course I taught last semester proved too much of a challenge for my fourth year students, despite being rather elementary and centred on accept-reject algorithms and importance/bridge sampling. One of the problems was a decomposition of the truncated Normal simulation method proposed by Marsaglia in 1963, found on X Validated!, which I had posted on the course Teams forum (and discussed on the ‘Og!). Obviously overlooked by the students as hardly anyone solved the central question… Quite a disappointment (and more exams to grade for the resit exam in June!)
Archive for truncated normal
Monte Carlo [exam]
Posted in Kids, pictures, R, Statistics, University life with tags accept-reject algorithm, cross validated, exam, France, fundamental lemma of simulation, George Marsaglia, Introduction to Monte Carlo Methods with R, MIDO, Monte Carlo algorithm, Monte Carlo methods, Monte Carlo Statistical Methods, Paris, PSL, R, ratio of uniform algorithm, Teams, truncated normal, Université Paris Dauphine on January 22, 2025 by xi'ananother, older, truncated Normal algorithm [X’ed]
Posted in Books, pictures, Statistics, University life with tags accept-reject algorithm, Boeing, cross validated, George Marsaglia, John Geweke, Stack Exchange, truncated normal on September 23, 2024 by xi'aninference with insufficient statistics #2
Posted in Books, Kids, Statistics with tags conditional sufficiency, cross validated, EM algorithm, Gibbs sampler, implementation, incomplete data, order statistics, truncated normal on December 28, 2023 by xi'an
Another X validated question of some interest: how to infer about the parameters of a model when only given a fraction 1-α of the order statistics. For instance, the (1-α)n largest observations. On a primary level, the answer is somewhat obvious since the joint density of these observations is available in closed form. At another level, it brings out the fact that the distribution of the unobserved part of the sample given the observed one only depends on the smallest observed order statistic ς (which is thus sufficient in that sense) and ends up being the original distribution truncated at ς, which allows for a closed form EM implementation. Which is also interesting given that the moments of a Normal order statistic are not available in closed form. This reminded me of the insufficient Gibbs paper we wrote with Antoine and Robin a few months ago, except for the available likelihood. And provided fodder for the final exam of my introductory mathematical statistics course at Paris Dauphine.
wrapped Normal distribution
Posted in Books, R, Statistics with tags cross validated, directional data, harmonic mean estimator, truncated normal, unit cube, wrapped normal on April 14, 2020 by xi'anOne version of the wrapped Normal distribution on (0,1) is expressed as a sum of Normal distributions with means shifted by all relative integers
which, while a parameterised density, has imho no particular statistical appeal over the use of other series. It was nonetheless the centre of a series of questions on X validated in the past weeks. Curiously used as the basis of a random walk type move over the unit cube along with a uniform component. Simulating from this distribution is easily done when seeing it as an infinite mixture of truncated Normal distributions, since the weights are easily computed
Hence coding simulations as
wrap<-function(x, mu, sig){
ter = trunc(5*sig + 1)
return(sum(dnorm(x + (-ter):ter, mu, sig)))}
siw = function(N=1e4,beta=.5,mu,sig){
unz = (runif(N)<beta)
ter = trunc(5*sig + 1)
qrbz = diff(prbz<-pnorm(-mu + (-ter):ter, sd=sig))
ndx = sample((-ter+1):ter,N,rep=TRUE,pr=qrbz)+ter
z = sig*qnorm(prbz[ndx]+runif(N)*qrbz[ndx])-ndx+mu+ter+1
return(c(runif(sum(unz)),z[!unz]))}
and checking that the harmonic mean estimator was functioning for this density, predictably since it is lower bounded on (0,1). The prolix originator of the question was also wondering at the mean of the wrapped Normal distribution, which I derived as (predictably)
but could not simplify any further except for x=0,½,1, when it is ½. A simulated evaluation of the mean as a function of μ shows a vaguely sinusoidal pattern, also predictably periodic and unsurprisingly antisymmetric, and apparently independent of the scale parameter σ…
truncated Normal moments
Posted in Books, Kids, Statistics with tags Australia, cross validated, lock, Sydney Harbour, Sydney Opera, truncated normal on May 24, 2019 by xi'an
An interesting if presumably hopeless question spotted on X validated: a lower-truncated Normal distribution is parameterised by its location, scale, and truncation values, μ, σ, and α. There exist formulas to derive the mean and variance of the resulting distribution, that is, when α=0,
and
but there is no easy way to choose (μ, σ) from these two quantities. Beyond numerical resolution of both equations. One of the issues is that ( μ, σ) is not a location-scale parameter for the truncated Normal distribution when α is fixed.
![I came across this question about truncated Normal simulation on X validated, pointing out at a 1963 [AX II!] Boeing technical report by George Marsaglia! The proposal uses a translated Exponential variate with scale 2, and then takes the squared root. This is an alternative of my (1995) [and John Geweke's (1993)] proposal using a translated Exponential variate with optimised scale and I wonder which solution is better. Presumably Marsaglia's, especially since the scale of 1/2 is the optimal one! Fodder for the next Monte Carlo exam, possibly, if my students do not come across this 'Og entry.](https://i0.wp.com/xianblog.fr/wp-content/uploads/2024/09/temp-4.png?resize=450%2C340&ssl=1)
