Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

share|improve this question
add comment

3 Answers

up vote 1 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:

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|improve this answer
    
@daroczig.........thanks a lot it is really helpful for me. –  user5620 Jan 19 '11 at 5:30
add comment

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|improve this answer
add comment

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|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
add comment

Your Answer

 
discard

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