location
,
scale parameter scale
and
shape parameter shape
.dgpd(x, location = 0, scale = 1, shape = 0, log = FALSE,
tolshape0 = sqrt(.Machine$double.eps),
oobounds.log = -Inf, giveWarning = FALSE)
pgpd(q, location = 0, scale = 1, shape = 0)
qgpd(p, location = 0, scale = 1, shape = 0)
rgpd(n, location = 0, scale = 1, shape = 0)
length(n) > 1
then the length is taken to be the number required.log = TRUE
then the logarithm of the density is returned.(x-location)/scale > 0
and
1+shape*(x-location)/scale > 0
.
Outside that region, the
logarithm of the density is assigned oobounds.lo
dgpd
gives the density,
pgpd
gives the distribution function,
qgpd
gives the quantile function, and
rgpd
generates random deviates.gpd
, the n
, all the above arguments may be vectors and
are recyled to the appropriate length if necessary.gpd
.x = seq(-0.2, 3, by = 0.01)
loc = 0; sigma = 1; xi = -0.4
plot(x, dgpd(x, loc, sigma, xi), type = "l", col = "blue", ylim = c(0, 1),
main = "Blue is density, red is cumulative distribution function",
sub = "Purple are 5,10,...,95 percentiles", ylab = "", las = 1)
abline(h = 0, col = "blue", lty = 2)
lines(qgpd(seq(0.05, 0.95, by = 0.05), loc, sigma, xi),
dgpd(qgpd(seq(0.05, 0.95, by = 0.05), loc, sigma, xi), loc, sigma, xi),
col = "purple", lty = 3, type = "h")
lines(x, pgpd(x, loc, sigma, xi), type = "l", col = "red")
abline(h = 0, lty = 2)
Run the code above in your browser using DataLab