Created
February 25, 2015 06:45
-
-
Save vsbuffalo/1185ce09785a3da5124f 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
hpdi_stat <- function(x, prob=0.95) { | |
# stat functions for ggplot that handle HPDI from samples | |
# automatically. | |
hpdi <- HPDinterval(as.mcmc(x)) | |
c(y=mean(x), ymin=hpdi[1, 'lower'], ymax=hpdi[1, 'upper']) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment