update_bernoulli_beta: Bernoulli-Beta conjugate model

Description Usage Arguments Value Examples

View source: R/update_bernoulli_beta.R

Description

This function implements the conjugate model (B | pi) ~ Bernoulli(pi); pi ~ Beta(alpha0,beta0) See wikipedia for details https://en.wikipedia.org/wiki/Conjugate_prior

Usage

1
update_bernoulli_beta(suff_stat_data, alpha0 = 1, beta0 = 1)

Arguments

suff_stat_data

a vector of sufficient statistics: non_consumer_sample_size and consumer_sample_size

alpha0

prior hyperparameter alpha0 for the beta distribution

beta0

prior hyperparameter beta0 for the beta distribution

Value

param A list with the prior and posterior hyperparameters. It constains the following components

prior

A list with the prior hyperparameters alpha, beta

posterior

A list with the posterior hyperparameters alpha, beta

Examples

1
2
data <- c(non_consumer_sample_size = 20, consumer_sample_size = 10)
update_bernoulli_beta(suff_stat_data = data, alpha0 = 1, beta0 = 1)

Iraices/PrecisePvsBoundedP documentation built on Jan. 18, 2021, 11:32 p.m.