set.seed(208); N <- 10000
k <- rozibeta(N, 2, 3, 0.2, 0.2)
hist(k, probability = TRUE, border = "blue",
main = "Blue = inflated; orange = ordinary beta")
sum(k == 0) / N # Proportion of 0
sum(k == 1) / N # Proportion of 1
Ngrid <- 1000
lines(seq(0, 1, length = Ngrid),
dbeta(seq(0, 1, length = Ngrid), 2, 3), col = "orange")
lines(seq(0, 1, length = Ngrid), col = "blue",
dozibeta(seq(0, 1, length = Ngrid), 2 , 3, 0.2, 0.2))
set.seed(1234); k <- runif(1000)
sum(abs(qozibeta(k, 2, 3) - qbeta(k, 2, 3)) > .Machine$double.eps) # Should be 0
sum(abs(pozibeta(k, 10, 7) - pbeta(k, 10, 7)) > .Machine$double.eps) # Should be 0
Run the code above in your browser using DataLab