vendredi 16 juillet 2021

Scipy sample from tail only

I'm building a simulation which requires random draws from the tail of a lognormal distribution. A threshold tao is chosen, and a resulting conditional distribution is given by enter image description here

I need to randomly sample from that conditional distribution, where F(x) is lognormal with a chosen mu and sigma, and tao is set by the user.

My inelegant solution right now is simply to sample from the lognormal, tossing out any values under tao, until I have the sample size I need, but I'm sure this can be improved.

Thanks for the help!




Aucun commentaire:

Enregistrer un commentaire