lundi 17 février 2020

R How to sample from an interrupted upside down bell curve

I've asked a related question before which successfully received an answer. Now I want to sample values from an upside down bell curve but exclude a range of values that fall in the middle of it like shown on the picture below: enter image description here

I have this code currently working:

min <- 1
max <- 20
q <- min + (max-min)*rbeta(10000, 0.5, 0.5)

How may I adapt it to achieve the desired output?




Aucun commentaire:

Enregistrer un commentaire