# NOT RUN {
size <- 20
ivec <- c(6, 10); avec <- c(8, 11); prob <- 0.5; xgrid <- 0:25
tvec <- 14; pobs.a <- 0.05; pstr.i <- 0.15
(ddd <- dgaitbinom(xgrid, size, prob.p = prob, prob.a = prob + 5,
truncate = tvec, pobs.mix = pobs.a,
pobs.mlm = pobs.a, alt.mlm = avec,
pstr.mix = pstr.i, inf.mix = ivec))
# }
# NOT RUN {
plot(xgrid, ddd, type = "n", ylab = "Probability", xlab = "x",
main = "GAIT PNP Combo PMF---Binomial Parent")
mylwd <- 1
abline(v = avec, col = 'blue', lwd = mylwd)
abline(v = ivec, col = 'purple', lwd = mylwd)
abline(v = tvec, col = 'tan', lwd = mylwd)
abline(h = c(pobs.a, pstr.i, 0:1), col = 'gray', lty = "dashed")
lines(xgrid, dbinom(xgrid, size, prob), col = 'gray', lty = 2)
lines(xgrid, ddd, type = "h", col = "pink", lwd = 7) # GAIT PNP combo PMF
points(xgrid[ddd == 0], ddd[ddd == 0], pch = 16)
# }
Run the code above in your browser using DataLab