
dbetageom(x, shape1, shape2, log=FALSE)
pbetageom(q, shape1, shape2, log.p=FALSE)
rbetageom(n, shape1, shape2)
a
and b
in
beta
respectively.TRUE
then all probabilities p
are given as log(p)
.dbetageom
gives the density,
pbetageom
gives the distribution function, and rbetageom
generates random deviates.shape1
and shape2
.
Note that the mean of this beta distribution is
shape1/(shape1+shape2)
, which therefore is the
mean of the probability of success.geometric
,
betaff
,
Beta
.shape1 = 1; shape2 = 2; y = 0:30
proby = dbetageom(y, shape1, shape2, log=FALSE)
plot(y, proby, type="h", col="blue", ylab="P[Y=y]",
main=paste("Y ~ Beta-geometric(shape1=",shape1,", shape2=",shape2,")",
sep=""))
sum(proby)
Run the code above in your browser using DataLab