StochRound: Stochastic rounding

Description Usage Arguments Details Value Author(s) References Examples

Description

Rounds a number up or down to a whole number with a probability equal to how close the starting value is to these whole numbers.

Usage

1

Arguments

x

a numerical value.

Details

Stochastis rounding can be helpful in simulations where we need a round number (for instance number individuals) but we calculate based on some percentage. Using this function we will pick reasonable numbers without a bias.

Value

one of the two closest whole numbers is returned

Author(s)

Heath Blackmon

References

http://coleoguy.github.io/

Examples

1

coleoguy/evobir documentation built on June 13, 2019, 9:54 p.m.