Reputation: 1119
I would like to create a bimodal distribution using the beta distribution.
Can someone explain how to obtain such a distribution?
I tried merging two different sample from a beta distribution, but I'm sure there's a more appropriate way.
a<-c(rbeta((50),10,1,1), rbeta((50),1,10,1))
Upvotes: 0
Views: 1584
Reputation: 8267
The beta distribution is bimodal for appropriate values of its parameters, e.g. (0.5,0.5):
set.seed(1)
hist(rbeta(10000,.5,.5))
Upvotes: 4