scale
,
and parameters d
and k
.dggamma(x, scale=1, d=1, k=1)
pggamma(q, scale=1, d=1, k=1)
qggamma(p, scale=1, d=1, k=1)
rggamma(n, scale=1, d=1, k=1)
dggamma
gives the density,
pggamma
gives the distribution function,
qggamma
gives the quantile function, and
rggamma
generates random deviates.ggamma
, the n
, all the above arguments may be vectors and
are recyled to the appropriate length if necessary.ggamma
.x=seq(0, 14, by=0.01); d=1.5; Scale=2; k=6
plot(x, dggamma(x, Scale, d, k), type="l", col="blue", ylim=c(0,1),
main="Blue is density, red is cumulative distribution function",
sub="Purple are 5,10,...,95 percentiles", las=1, ylab="")
abline(h=0, col="blue", lty=2)
lines(qggamma(seq(0.05,0.95,by=0.05), Scale, d, k),
dggamma(qggamma(seq(0.05,0.95,by=0.05), Scale, d, k), Scale, d, k),
col="purple", lty=3, type="h")
lines(x, pggamma(x, Scale, d, k), type="l", col="red")
abline(h=0, lty=2)
Run the code above in your browser using DataLab