prob2IntFreq: Generate integer frequencies from discrete probabilities and...

View source: R/RcppExports.R

prob2IntFreqR Documentation

Generate integer frequencies from discrete probabilities and an overall population.

Description

This function will generate the closest integer vector to the probabilities scaled to the population.

Usage

prob2IntFreq(pIn, pop)

Arguments

pIn

a numeric vector of state occupation probabilities. Must sum to unity (to within double precision epsilon)

pop

the total population

Value

an integer vector of frequencies that sum to pop, and the RMS difference from the original values.

Examples

prob2IntFreq(c(0.1,0.2,0.3,0.4), 11)

humanleague documentation built on April 18, 2023, 1:09 a.m.