lundi 16 mars 2020

How can I draw random samples from a skewed normal distribution in Python?

I have this skewed normal distribution:

from scipy.stats import norm
def skewnorm(xi,w,a,x):

    m = (x-xi)/w 

    return (2/((w)))*norm.pdf(m)*norm.cdf(a*m)

I would like to generate random samples with this distribution with certain values for xi,w and a in order to implement a montecarlo simulation with some stocks returns.

I would like to do the same as: np.random.normal(mean, std, n)but with my skewed normal distribution.

Can you help me? thank you very much




Aucun commentaire:

Enregistrer un commentaire