I want to draw samples from a skew normal distribution as part of a matlab project of mine. I already implemented the CDF and PDF of the distribution, but sampling from it still bothers me.
Sadly, the description of this process from the documentation of an R package is riddled with dead links, so I did some reading on the process.
One way of sampling from the distribution would be inverse transform sampling
, which uses a uniform random variable $U\sim Unif(0,1) $ and involves solving
$F(F^{-1}(u)) = u$
with $F(x)$ being the CDF of the distribution we want to sample from. Since I don't know how to find the inverse of $F(x)$ myself, I did some searching, finding this question asked several times but not answered.
Edit: another method to sample from the distribution would be rejection sampling, however for that I need to find a distribution that
- I can draw samples from
- Has a pdf "which is at least as high at every point as the distribution we want to sample from, so that the former completely encloses the latter." (from the rejection sampling wiki article)
I've plotted the skew normal distribution with $\xi=1,\omega=1.5,\alpha=4$ and its truncated version (truncated to [0,2.5] here).
In my application of this, I will always truncate the distribution to a certain interval, so I'd need to find a distribution that 'contains' the SN pdf for (hopefully) all parameters.
Any ideas how I could go about sampling from such truncated skew-normal distributions?