bayesian_crank: Computes Posterior Probabilities for Discrete Models

Description Usage Arguments Value Author(s) Examples

View source: R/bayesian_crank.R

Description

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

Usage

1

Arguments

d

data frame with columns Prior and Likelihood

Value

data frame with new columns Product and Posterior

Author(s)

Jim Albert

Examples

1
2
3
4
5
6
  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)

Example output

Loading required package: LearnBayes
Loading required package: ggplot2
Loading required package: gridExtra
Loading required package: dplyr

Attaching package: 'dplyr'

The following object is masked from 'package:gridExtra':

    combine

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

Loading required package: shiny

TeachBayes documentation built on May 1, 2019, 9:17 p.m.