Learn R Programming

ProbBayes (version 1.1)

bayesian_crank: Computes Posterior Probabilities for Discrete Models

Description

Given a data table with columns Prior and Likelihood, computes posterior probabilities

Usage

bayesian_crank(d)

Arguments

d

data frame with columns Prior and Likelihood

Value

data frame with new columns Product and Posterior

Examples

Run this code
# NOT RUN {
  df <- data.frame(p=c(.1, .3, .5, .7, .9),
                   Prior=rep(1/5, 5))
  y <- 5
  n <- 10
  df$Likelihood <- dbinom(y, prob=df$p, size=n)
  df <- bayesian_crank(df)
# }

Run the code above in your browser using DataLab