Learn R Programming

MultiDiscreteRNG (version 0.1.0)

calc.bin.prob.NB: Collapse discrete negative binomial outcomes to binary variables

Description

This function implements Step 1 of the algorithm. It collapses each discrete outcome from the negative binomial distribution into a binary probability and determines a dichotomous threshold for each variable.

Usage

calc.bin.prob.NB(NB.r.vec, NB.prob.vec)

Value

vector of binary probability, dichotomous threshold

Arguments

NB.r.vec

vector of number of trials

NB.prob.vec

vector of probabilities

Examples

Run this code
NB.r.vec <- c(10, 3, 16)
NB.prob.vec <- c(0.65, 0.4, 0.88)

# Compute binary probabilities, PMFs, and thresholds
p <- calc.bin.prob.NB(NB.r.vec, NB.prob.vec)

Run the code above in your browser using DataLab