# NOT RUN {
lower <- 3; upper <- 8; kay <- exp(0.5)
# }
# NOT RUN {
xx <- seq(lower - 0.5, upper + 0.5, len = 401)
plot(xx, dtruncpareto(xx, low = lower, upp = upper, shape = kay),
main = "Truncated Pareto density split into 10 equal areas",
type = "l", ylim = 0:1, xlab = "x")
abline(h = 0, col = "blue", lty = 2)
qq <- qtruncpareto(seq(0.1, 0.9, by = 0.1), low = lower, upp = upper,
shape = kay)
lines(qq, dtruncpareto(qq, low = lower, upp = upper, shape = kay),
col = "purple", lty = 3, type = "h")
lines(xx, ptruncpareto(xx, low = lower, upp = upper, shape = kay),
col = "orange")
# }
# NOT RUN {
pp <- seq(0.1, 0.9, by = 0.1)
qq <- qtruncpareto(pp, lower = lower, upper = upper, shape = kay)
ptruncpareto(qq, lower = lower, upper = upper, shape = kay)
qtruncpareto(ptruncpareto(qq, lower = lower, upper = upper, shape = kay),
lower = lower, upper = upper, shape = kay) - qq # Should be all 0
# }
Run the code above in your browser using DataLab