
lower
, upper
and shape
.dtpareto(x, lower, upper, shape)
ptpareto(q, lower, upper, shape)
qtpareto(p, lower, upper, shape)
rtpareto(n, lower, upper, shape)
dtpareto
gives the density,
ptpareto
gives the distribution function,
qtpareto
gives the quantile function, and
rtpareto
generates random deviates.tpareto1
, the tpareto1
.lower = 3; upper = 8; k = exp(0.5)
x = seq(lower, upper, len=200)
plot(x, dtpareto(x, lo=lower, up=upper, shape=k), type="l",
main="Truncated Pareto density split into 10 equal areas")
abline(h=0, col="blue", lty=2)
qq = qtpareto(seq(0.1,0.9,by=0.1),lo=lower, up=upper,shape=k)
lines(qq, dtpareto(qq, lo=lower, up=upper, shape=k),
col="purple", lty=3, type="h")
pp = seq(0.1,0.9,by=0.1)
qq = qtpareto(pp, lo=lower, up=upper, shape=k)
ptpareto(qq, lo=lower, up=upper, shape=k)
qtpareto(ptpareto(qq, lo=lower, up=upper, shape=k),
lo=lower, up=upper, shape=k) - qq # Should be all 0
Run the code above in your browser using DataLab