Skip to content

Instantly share code, notes, and snippets.

@aammd
Created November 28, 2020 02:53
Show Gist options
  • Save aammd/64c394532b6740e603be91f3c90f219d to your computer and use it in GitHub Desktop.
Save aammd/64c394532b6740e603be91f3c90f219d to your computer and use it in GitHub Desktop.
Inspired by Peskun 2016 http://arxiv.org/abs/1610.07554
library(tidyverse)
#> Warning: package 'tibble' was built under R version 4.0.2
#> Warning: package 'tidyr' was built under R version 4.0.2
#> Warning: package 'dplyr' was built under R version 4.0.2
tibble(x = 0:42,
       y1 = pbinom(x, 42, 0.3),
       y2 = 1-pbeta(0.3, x+1, 42-x)) %>% 
  ggplot(aes(x = x, y = y1)) + 
  geom_point(col = "green", size = 3) + 
  geom_point(aes(y = y2))

# that makes a lot of sense! as the number of successes increases (in a
# binomial) its as if the number of successes increases and failures decrease in a Beta

Created on 2020-11-27 by the reprex package (v0.3.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment