Skip to content

Adding skew normal random variable #1149

Closed

Description

@saona-raimundo

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.

Activity

  1. dhardy commented on Jul 22, 2021

    @dhardy
    Member

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

  2. saona-raimundo commented on Jul 23, 2021

    @saona-raimundo
    ContributorAuthor

    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.

  3. vks commented on Sep 15, 2021

    @vks
    Contributor

    Implemented in #1174.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions