Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

how can we generate random numbers using skew normal distribution in multivariate case

share|cite|improve this question
up vote 2 down vote accepted

If you are interested in theory, as @Nate Eldredge suggested, follow the url.

As written there also, you could use R in practice to generate random numbers using a skew normal distribution.

Load the library sn:


Or if not installed, first install it via install.packages('sn').

Then you can generate any random number with given parameters with the rsn function.

rsn(n=100, location=1.256269, scale=1.605681, shape=5)

Will generate 100 random numbers from the distribution with given parameters. If you would like to plot the histogram of your generated values, use higher sample size (e.g. 1.000 or 10.000), like:

hist(rsn(n=10000, location=1.256269, scale=1.605681, shape=5))

alt text

share|cite|improve this answer
@daroczig.........thanks a lot it is really helpful for me. – user5620 Jan 19 '11 at 5:30

This page should point you to what you want. I found it just by following links from Wikipedia and in the future it would be best if you try that first before asking.

share|cite|improve this answer

Edit: this answers a different question.

Supposing that the mean is $\mu$ and the variance is $\Sigma$, calculate the Cholesky decomposition $\Sigma =LL^*$, generate a vector $v$ of $\operatorname{rank} \Sigma$ independent Gaussians, and output $Lv + \mu$.

share|cite|improve this answer
That gives you a multivariate normal, not a skew normal. – Nate Eldredge Jan 17 '11 at 4:51
Not the same? Oops... – Yuval Filmus Jan 17 '11 at 5:21
i have seen the pointed website but i am not getting how to code it in matlab in multivariate case. – user5620 Jan 17 '11 at 6:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.