spinner_bayes: Implements Bayes' rule for a spinner problem

Description Usage Arguments Value Author(s) Examples

View source: R/spinner_bayes.R

Description

Computes and plots the posterior distribution of spinners given a sequence of spins

Usage

1
2
3
4
  spinner_bayes(list_regions,
                prior,
                data,
                plot=TRUE)

Arguments

list_regions

list of vectors of integer areas for the spins 1, 2, ...

prior

a vector containing the prior probabilities for the spinners

data

a vector containing the spin values where 1, 2, 3, ... are the possible spins

plot

if plot=TRUE, a comparative graph of the prior and posterior probabilities is displayed

Value

A data frame with variables Spinner, Prior, Likelihood, Product, and Posterior

Author(s)

Jim Albert

Examples

1
2
3
4
5
6
  regions1 <- c(1, 1, 1)
  regions2 <- c(2, 1, 2, 1)
  data <- c(1, 1, 1, 2)
  spinner_bayes(list(regions1, regions2),
                prior=c(0.5, 0.5),
                data)

bayesball/TeachBayes documentation built on Jan. 5, 2020, 1:47 a.m.