Selecting values from bounded normal distribution in NetLogo

user2359494

I'm trying to have NetLogo draw values from a bounded random normal distribution following the recommendation in a previous question in stackoverflow

NetLogo : How to make sure a variable stays in a defined range?

Specifically I'm asking the model to create a circular home range that varies in size according to empirical data

set homerange patches in-radius ((sqrt (( random-normal-in-bounds [ 54.4 35.8 19 151 ] * 1000000)/ pi))/ 100)

to-report random-normal-in-bounds [mid dev mmin mmax]
  let result random-normal mid dev
  if result < mmin or result > mmax
    [ report random-normal-in-bounds mid dev mmin mmax ]
  report result
end

However I keep getting the error that random-normal-in-bounds expected 4 inputs. I'm sure it's something silly I'm doing but it looks like 4 inputs (54.4, 35.8, 19, 151) to me. Any suggestions on what I'm doing wrong? Thanks in advance!

Marzy

I think your error is caused by [] you don't need these brackets.

Update:

to test
clear-all
let homerange  nobody
let radius sqrt (( random-normal-in-bounds  54.4 35.8 19 151  * 1000000)/ pi) / 100 
crt 1 [
set homerange  patches in-radius radius
]
ask homerange  [set pcolor violet]
end
to-report random-normal-in-bounds [mid dev mmin mmax]
  let result random-normal mid dev
  if result < mmin or result > mmax
    [ report random-normal-in-bounds mid dev mmin mmax ]
  report result
end

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

NetLogo selecting a value from a matrix

From Dev

Sampling from a bounded domain zipf distribution

From Dev

selecting random rows with normal distribution based on a column in SQL Server 2012

From Dev

selecting random rows with normal distribution based on a column in SQL Server 2012

From Dev

How to generate random uniform distribution by selecting h/l values from multiple arrays?

From Dev

Selecting values from a combobox

From Dev

Selecting values from List

From Dev

Selecting values from a combobox

From Dev

selecting weighted random distribution from a mysql table

From Dev

Generating a normal distribution from known percentiles

From Dev

Efficiently randomly drawing from a multivariate normal distribution

From Dev

Draw histogram with normal distribution overlay from data

From Dev

Drawing a value from a normal distribution in F#

From Dev

Generating numbers from normal distribution in Python

From Dev

Generate many sample pairs from normal distribution

From Dev

draw from skew normal distribution using stan

From Dev

Scaleable Python normal distribution from pandas DataFrame

From Dev

NetLogo: selecting random one turtle from two kinds

From Dev

Netlogo, selecting a value from the combination of lists and single value

From Dev

NetLogo: selecting random one turtle from two kinds

From Dev

Selecting Values from different arrays

From Dev

Selecting random values from dictionary

From Dev

selecting values from javascript in a for loop

From Dev

Selecting varchar values from a column

From Dev

selecting values from a reference table

From Dev

Selecting unique values from SQL

From Dev

Selecting Captured values from a String

From Dev

Fit bimodal normal distribution to a vector of values, not its histogram

From Dev

Multimodal distribution in NetLogo

Related Related

  1. 1

    NetLogo selecting a value from a matrix

  2. 2

    Sampling from a bounded domain zipf distribution

  3. 3

    selecting random rows with normal distribution based on a column in SQL Server 2012

  4. 4

    selecting random rows with normal distribution based on a column in SQL Server 2012

  5. 5

    How to generate random uniform distribution by selecting h/l values from multiple arrays?

  6. 6

    Selecting values from a combobox

  7. 7

    Selecting values from List

  8. 8

    Selecting values from a combobox

  9. 9

    selecting weighted random distribution from a mysql table

  10. 10

    Generating a normal distribution from known percentiles

  11. 11

    Efficiently randomly drawing from a multivariate normal distribution

  12. 12

    Draw histogram with normal distribution overlay from data

  13. 13

    Drawing a value from a normal distribution in F#

  14. 14

    Generating numbers from normal distribution in Python

  15. 15

    Generate many sample pairs from normal distribution

  16. 16

    draw from skew normal distribution using stan

  17. 17

    Scaleable Python normal distribution from pandas DataFrame

  18. 18

    NetLogo: selecting random one turtle from two kinds

  19. 19

    Netlogo, selecting a value from the combination of lists and single value

  20. 20

    NetLogo: selecting random one turtle from two kinds

  21. 21

    Selecting Values from different arrays

  22. 22

    Selecting random values from dictionary

  23. 23

    selecting values from javascript in a for loop

  24. 24

    Selecting varchar values from a column

  25. 25

    selecting values from a reference table

  26. 26

    Selecting unique values from SQL

  27. 27

    Selecting Captured values from a String

  28. 28

    Fit bimodal normal distribution to a vector of values, not its histogram

  29. 29

    Multimodal distribution in NetLogo

HotTag

Archive