
Density, distribution function, quantile function and random generation
for the one-inflated
logarithmic distribution with parameter pstr1
.
doilog(x, shape, pstr1 = 0, log = FALSE)
poilog(q, shape, pstr1 = 0)
qoilog(p, shape, pstr1 = 0)
roilog(n, shape, pstr1 = 0)
Same as Uniform
.
Vector of parameters that lie in
Probability of a structural one
(i.e., ignoring the logarithmic distribution),
called
Same as Uniform
.
doilog
gives the density,
poilog
gives the distribution function,
qoilog
gives the quantile function, and
roilog
generates random deviates.
The probability function of oilog
estimates
# NOT RUN {
shape <- 0.5; pstr1 <- 0.3; x <- (-1):7
(ii <- doilog(x, shape, pstr1 = pstr1))
max(abs(poilog(1:200, shape) -
cumsum(shape^(1:200) / (-(1:200) * log1p(-shape))))) # Should be 0
# }
# NOT RUN {
x <- 0:10
par(mfrow = c(2, 1)) # One-Inflated logarithmic
barplot(rbind(doilog(x, shape, pstr1 = pstr1), dlog(x, shape)),
beside = TRUE, col = c("blue", "orange"),
main = paste("OILogff(", shape, ", pstr1 = ", pstr1, ") (blue) vs",
" Logff(", shape, ") (orange)", sep = ""),
names.arg = as.character(x))
deflat.limit <- -dlog(1, shape) / plog(1, shape, lower.tail = FALSE)
newpstr1 <- round(deflat.limit, 3) + 0.001 # Inside but near the boundary
barplot(rbind(doilog(x, shape, pstr1 = newpstr1),
dlog(x, shape)),
beside = TRUE, col = c("blue","orange"),
main = paste("ODLogff(", shape, ", pstr1 = ", newpstr1, ") (blue) vs",
" Logff(", shape, ") (orange)", sep = ""),
names.arg = as.character(x))
# }
Run the code above in your browser using DataLab