Density, distribution function, and random generation for the zero/one-inflated beta distribution.
dzoabeta(x, shape1, shape2, pobs0 = 0, pobs1 = 0, log = FALSE,
tol = .Machine$double.eps)
pzoabeta(q, shape1, shape2, pobs0 = 0, pobs1 = 0,
lower.tail = TRUE, log.p = FALSE, tol = .Machine$double.eps)
qzoabeta(p, shape1, shape2, pobs0 = 0, pobs1 = 0,
lower.tail = TRUE, log.p = FALSE, tol = .Machine$double.eps)
rzoabeta(n, shape1, shape2, pobs0 = 0, pobs1 = 0,
tol = .Machine$double.eps)
Same as Beta
.
vector of probabilities that 0 and 1 are observed
(
Same as Beta
.
Numeric, tolerance for testing equality with 0 and 1.
dzoabeta
gives the density,
pzoabeta
gives the distribution function,
qzoabeta
gives the quantile, and
rzoabeta
generates random deviates.
This distribution is a mixture of a discrete distribution
with a continuous distribution.
The cumulative distribution function of pbeta
),
Beta
when only the essential arguments are inputted.
# NOT RUN {
N <- 1000; y <- rzoabeta(N, 2, 3, 0.2, 0.2)
hist(y, probability = TRUE, border = "blue", las = 1,
main = "Blue = 0- and 1-altered; orange = ordinary beta")
sum(y == 0) / N # Proportion of 0s
sum(y == 1) / N # Proportion of 1s
Ngrid <- 1000
lines(seq(0, 1, length = Ngrid),
dbeta(seq(0, 1, length = Ngrid), 2, 3), col = "orange")
lines(seq(0, 1, length = Ngrid), col = "blue",
dzoabeta(seq(0, 1, length = Ngrid), 2 , 3, 0.2, 0.2))
# }
Run the code above in your browser using DataLab