powered by
This function will generate the closest integer vector to the probabilities scaled to the population.
prob2IntFreq(pIn, pop)
an integer vector of frequencies that sum to pop, and the RMS difference from the original values.
a numeric vector of state occupation probabilities. Must sum to unity (to within double precision epsilon)
the total population
prob2IntFreq(c(0.1,0.2,0.3,0.4), 11)
Run the code above in your browser using DataLab