# NOT RUN {
iunif(0.7, min = 2, max = 4)
set.seed(8675309)
iunif(runif(10), 2, 4, showPDF = TRUE)
set.seed(8675309)
iunif(runif(10), 2, 4, showECDF = TRUE)
set.seed(8675309)
iunif(runif(10), 2, 4, showPDF = TRUE, showECDF = TRUE)
set.seed(8675309)
iunif(runif(10), 2, 4, showPDF = TRUE, showCDF = FALSE)
iunif(runif(120), 2, 4, showPDF = TRUE, minPlotQuantile = 0.02, maxPlotQuantile = 0.98)
# use resetRowsMargins to allow visual exploration of ks.test results
set.seed(54321)
vals <- iunif(runif(10), 2, 4, showECDF = TRUE, resetRowsMargins = FALSE)
D <- as.numeric(ks.test(vals, "punif", 2, 4)$statistic)
for (x in seq(2.5, 3.5, by = 0.05)) {
y <- punif(x, 2, 4)
segments(x, y, x, y + D, col = "darkgreen", lwd = 2, xpd = NA)
}
# show the PDF and CDF without any variates
iunif(NULL, 2, 4)
# show CDF with inversion and PDF using show
iunif(runif(10), 2, 4, show = c(1,1,0))
iunif(runif(10), 2, 4, show = 6)
# show CDF with inversion and ECDF using show
iunif(runif(10), 2, 4, show = c(1,0,1))
iunif(runif(10), 2, 4, show = 5)
# show CDF with inversion, PDF, and ECDF using show
iunif(runif(10), 2, 4, show = c(1,1,1))
iunif(runif(10), 2, 4, show = 7)
# }
Run the code above in your browser using DataLab