prob2IntFreq {humanleague}R 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)

[Package humanleague version 2.3.1 Index]