Skip to content

Adding skew normal random variable #1149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
saona-raimundo opened this issue Jul 22, 2021 · 3 comments
Closed

Adding skew normal random variable #1149

saona-raimundo opened this issue Jul 22, 2021 · 3 comments

Comments

@saona-raimundo
Copy link
Contributor

Background

What is your motivation?

Skew normal distribution is a variant of the normal distribution that allows a preference to some side of the mode. It has many applications and it is a very simple variant to work with. Personally, I used it in a biological model and implemented the sampling method to do some Monte Carlo computations.

What type of application is this?

Numerical simulation

Feature request

I would like to add SkewNormal to the rand_distr crate. This would implement Distribution<F> where F:Float, just as Normal does.

As for the sampling algorithm, I propose to follow this paper. The method is simple, but there is no benchmark against other algorithms. That would be a reason to choose another algorithm. Other algorithms might have performance issues in extreme parameters.

I volunteer to make a PR. I wanted to ask first about it.

@dhardy
Copy link
Member

dhardy commented Jul 22, 2021

That sounds fine to me, and the algorithm looks straightforward to implement.

It would be good to have some tests (see #1121).

Aside: would you care to review #1136? (No pressure.)

@saona-raimundo
Copy link
Contributor Author

That sounds fine to me, and the algorithm looks straightforward to implement.

Great! Thank you!

It would be good to have some tests (see #1121).

I will include tests like these ones then.

Aside: would you care to review #1136? (No pressure.)

Sure, no problem :) I will not take more than a week.

@vks
Copy link
Collaborator

vks commented Sep 15, 2021

Implemented in #1174.

@vks vks closed this as completed Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants