I aim to run some numerical simulations where a random variable of interest (Let's call it $X$) can take different distribution. Past studies, always assumed that $X$ is normally distributed while it is not uncommon that $X$ is actually skewed in reality.

I'd like to be able to vary (from one simulation to another) the variance $V$ and the skew $S$ (keeping the mean constant at zero) and get a distribution of always the same kind with this variance and this skew. Because past work were based on a normal distribution, I'd like my distribution to "kinda look like a normal distribution".

Can you help with that?

What I tried

I thought about using the skewed normal distribution. I tried to find out what parameter set I should use to get a given skew and variance. I tried to solve the following system of equation for $\alpha$, $\omega$ and $\xi$.

$$Variance = \left(1-\frac{2 \alpha ^2}{\pi \left(\alpha ^2+1\right)}\right) \omega ^2$$

$$Skew = \frac{\sqrt{2} (4-\pi ) \alpha ^3}{\pi ^{3/2} \left(\alpha ^2+1\right)^{3/2} \left(1-\frac{2 \alpha }{\pi \sqrt{\alpha ^2+1}}\right)^{3/2}}$$

$$Mean = \frac{\sqrt{\frac{2}{\pi }} \alpha \omega }{\sqrt{\alpha ^2+1}}+\xi = 0$$

... but I failed! It would be perfect to me if only one parameter set would yield to a given mean, variance and skew but I am not sure this is going to be true.

A skewed normal distribution might arguably not be the best choice of distribution. I thought about using a Beta distribution as well but I ran into the same kind of issue. I fail to solve these hairy equations.


1 Answer 1


I don't know the purpose of your simulation or what software you will be using. However, I would like to suggest the gamma distribution because it is widely used in applications, simulation functions are readily available, and, when the shape parameter is large, the PDF looks roughly normal (because of the CLT).

In one parameterization, the parameters are shape $\alpha$ and rate $\lambda.$ The skewness is $1/\sqrt{\alpha}.$ The variance is $\alpha/\lambda^2.$ The mean is $\alpha/\lambda$, but you could subtract that if you need mean 0. The R code for generating $n$ independent observations, before any centering, is 'rgamma(n, alpha, lambda)'.

  • 1
    $\begingroup$ Oh well, that is a handy distribution indeed. I'll be using that then. Thank you. $\endgroup$
    – Remi.b
    Mar 31, 2015 at 16:47
  • $\begingroup$ I have an open question asking for personal anecdotes about doing simulation. If you have anything to say, I'd be happy to see it there. $\endgroup$
    – BruceET
    Mar 31, 2015 at 17:43
  • $\begingroup$ Sure. I am in the field of population genetics. I am simulating an evolving fish population over an explicit river network. Each fish has 50 loci that code for a quantitative phenotypic trait. Those loci mutate at a given rate and the effect of the mutation is added (or substracted) from the old value of the locus. These effects are drawn from a normal distribution. The distance between the trait value and the optimum phenotype gives fitness (according to a gaussian function). $\endgroup$
    – Remi.b
    Mar 31, 2015 at 18:03
  • $\begingroup$ Over the landscape the optimum phenotype is changing linearly. Fish can migrate and the probability of migrating to a patch at distance $x$ will be given by a gamma function thanks to your answer. The simulations is coded in C++ and it will probably run for 2 days. The main goal is to study the evolution of the geographic range limit in fishes when facing asymmetric dispersal. $\endgroup$
    – Remi.b
    Mar 31, 2015 at 18:03
  • $\begingroup$ Interesting study. Gamma seems well suited. (In physics/engr related Rayleigh distn is often used to model positive distance.) Wishing you success. $\endgroup$
    – BruceET
    Mar 31, 2015 at 18:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.