rcondbern: Conditional Bernoulli distribution

Description Usage Arguments Value

View source: R/rcondbern.R

Description

Gives one sample from the conditional Bernoulli distribution, either with exact method or with MCMC. This function is a wrapper for idchecking_cpp and metropolis_condbern_cpp

Usage

1
rcondbern(sum_x, alpha, exact = TRUE, num_sample = NULL)

Arguments

sum_x

sum of the Bernoullis

alpha

vector of success probabilities

exact

binary, if TRUE, then use id-check sampling, otherwise use the metropolis algorithm. Default is TRUE.

num_sample

default is NULL.

Value

sample, a length N binary vector, with 1 at the chosen entry


nianqiaoju/agents documentation built on Feb. 19, 2021, 12:18 a.m.