all.equal(pbetaRv1(1/4, 2, 3),
pbeta (1/4, 2, 3))
set.seed(101)
N <- 1000
x <- sample.int(7, N, replace=TRUE) / 8
a <- rlnorm(N)
b <- 5*rlnorm(N)
pbt <- pbeta(x, a, b)
for(i in 1:N) {
stopifnot(all.equal(pbetaRv1(x[i], a[i], b[i]), pbt[i]))
cat(".", if(i %% 20 == 0) paste0(i, "\n"))
}
Run the code above in your browser using DataLab