Created
October 7, 2019 18:01
-
-
Save monogenea/229c161be01809a591cb808965fea351 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bonus! Sample counts from predictionsP, take 95% HDPI | |
hdpiPoisP <- apply(predictionsP, 2, HPDI, prob = .95) | |
meanPoisP <- colMeans(predictionsP) | |
plot(rangeA, meanPoisP, type = "l", ylim = c(0, 15), | |
yaxp = c(0, 15, 5), xlab = "Min Age (standardized)", | |
ylab = expression(paste(lambda, " / no. eggs laid"))) | |
shade(hdpiPoisP, rangeA) | |
poisample <- sapply(1:100, function(k){ | |
rpois(nrow(predictionsP), predictionsP[,k]) | |
}) | |
hdpiSample <- apply(poisample, 2, HPDI, prob = .95) | |
shade(hdpiSample, rangeA) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment