x <- seq(-2, 4, by = 0.01)
loc <- 1; shape <- -pi /2
if (FALSE) plot(x, dgensh(x, shape, loc), type = "l",
main = "Blue is density, orange is the CDF",
ylim = 0:1, las = 1, ylab = "",
sub = "Purple are 5, 10, ..., 95 percentiles",
col = "blue")
abline(h = 0, col = "blue", lty = 2)
lines(qgensh((1:19) / 20, shape, loc), type = "h",
dgensh(qgensh((1:19) / 20, shape, loc),
shape, loc), col = "purple", lty = 3)
lines(x, pgensh(x, shape, loc), col = "orange")
abline(h = 0, lty = 2)
pp <- (1:19) / 20 # Test two functions
max(abs(pgensh(qgensh(pp, shape, loc),
shape,loc) - pp)) # Should be 0
Run the code above in your browser using DataLab