getDecision: getDecision

View source: R/getDecision.R

getDecisionR Documentation

getDecision

Description

For given n probabilities 0 <= pi <= 1 with sum(pi)=1, return 0,1,2,3,..,n with probability p0, p1, p2, ..., pn.

Usage

getDecision(p)

Arguments

p

vector of probabilities

Value

int decision in the range from 0 to n

Examples


p <- c(0.6, 0.3, 0.1)
getDecision(p)

babsim.hospital documentation built on May 30, 2022, 9:05 a.m.