iexp(0.5, rate = 3)
set.seed(8675309)
iexp(runif(10), 2, showPDF = TRUE)
set.seed(8675309)
iexp(runif(10), 2, showECDF = TRUE)
set.seed(8675309)
iexp(runif(10), 2, showPDF = TRUE, showECDF = TRUE, sampleColor = "blue3")
set.seed(8675309)
iexp(runif(10), 2, showPDF = TRUE, showCDF = FALSE)
iexp(runif(100), 2, showPDF = TRUE, minPlotQuantile = 0.02, maxPlotQuantile = 0.98)
# plot the PDF and CDF without any variates
iexp(NULL, 2, showPDF = TRUE, showCDF = TRUE)
# plot CDF with inversion and PDF using show
iexp(runif(10), 2, show = c(1,1,0))
iexp(runif(10), 2, show = 6)
# plot CDF with inversion and ECDF using show, using vunif
iexp(vunif(10), 2, show = c(1,0,1))
iexp(vunif(10), 2, show = 5)
# plot CDF with inversion, PDF, and ECDF using show
iexp(vunif(10), 2, show = c(1,1,1))
iexp(vunif(10), 2, show = 7)
# plot three different CDF+PDF+ECDF horizontal displays,
# with title only on the first display
oldpar <- par(no.readonly = TRUE)
par(mfrow = c(3,3)) # 3 rows, 3 cols, filling rows before columns
set.seed(8675309)
iexp(runif(20), 2, show = 7, respectLayout = TRUE, restorePar = FALSE)
iexp(runif(20), 2, show = 7, respectLayout = TRUE, restorePar = FALSE, showTitle = FALSE)
iexp(runif(20), 2, show = 7, respectLayout = TRUE, restorePar = TRUE, showTitle = FALSE)
par(oldpar)
# display animation of all components
iexp(runif(10), 2, show = 7, plotDelay = 0.1)
# display animation of CDF and PDF components only
iexp(runif(10), 2, show = 5, plotDelay = 0.1)
if (interactive()) {
# interactive -- pause at each stage of inversion
iexp(runif(10), 2, show = 7, plotDelay = -1)
}
# overlay visual exploration of ks.test results
oldpar <- par(no.readonly = TRUE)
set.seed(54321)
vals <- iexp(runif(10), 2, showECDF = TRUE, restorePar = FALSE)
D <- as.numeric(ks.test(vals, "pexp", 2)$statistic)
for (x in seq(0.25, 0.65, by = 0.05)) {
y <- pexp(x, 2)
segments(x, y, x, y + D, col = "darkgreen", lwd = 2, xpd = NA)
}
par(oldpar) # restore original par values, since restorePar = FALSE above
Run the code above in your browser using DataLab