Extranomical
Extranomical

Reputation: 435

How to specify min and max values in a skewnorm distribution?

I want to use the skewnorm function to generate random numbers. I want the numbers to come close to zero, but never less than or equal to it. Is there a way to specify a minium value?

Upvotes: 0

Views: 424

Answers (1)

Alexey Romanov
Alexey Romanov

Reputation: 170723

By definition, skew normal distribution allows any number to be generated just as the normal distribution does (its density is positive on the entire real line). So if your numbers are never less than or equal to 0, they don't come from skew normal distribution.

To ensure you never get a non-positive number you can e.g. throw out any such number you get and sample again in a loop; you just won't get a skew normal distribution this way.

Upvotes: 1

Related Questions