Since I am not well-versed in mathematics, I am struggling with the implementation of a random number generator in NetLogo which follows roughly a pareto distribution. This is the follow-up question of this one here, where I would like to substitue the random-float
with something like "random-pareto"
in order to have events taking place in the model following a pareto distribution (thinking of simulated earthquakes and their degree of destructiveness).
The code in question is:
ask hits [
let %draw (random-float 100)
let %strength 0 ;; no damage
if (%draw < 50) [set %strength (%strength + 1)] ;;1 for little damage
if (%draw < 10) [set %strength (%strength + 1)] ;;2 for middle damage
if (%draw < 5) [set %strength (%strength + 1)] ;;3 for strong damage
if (%draw < 1) [set %strength (%strength + 1)] ;;4 for complete destruction
ifelse pcolor = red [die]
[ ask n-of %strength patches [ set pcolor red ]]
]
I got inspired by this question here to do the same in R and the Netlogo Dictionary here about the fact that random-exponential
can be written as (- mean) * ln random-float 1.0
.
Can somebody help?