3
$\begingroup$

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

4 Answers 4

3

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

  • 0
    @daroczig.........thanks a lot it is really helpful for me.2011-01-19
2

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.

0

Answer given by daroczig generates univariate skewed normal, not multivariate. But similar function rmsn in the package sn provides the desired function.

-1

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$.

  • 0
    i have seen the pointed website but i am not getting how to code it in matlab in multivariate case.2011-01-17