2

I am trying to find a methodology (or even better, the code) to do the following in Netlogo. Any help is appreciated (I could always try to rewrite the code from R or Matlab to Netlogo):

I have $5000, which I want to distribute following different beta distributions among 10 000 actors. The maximum amount an actor may receive is $1.

Basically, I am looking for a way to generate random numbers to actors (10000 actors) in a [0,1] interval, following different beta distributions, where the mean of the distributed values remains equal to 0.5. This way the purchasing power of the population (10000 actors with a mean of 0.5 is $5000) remains equal for beta(1,1) (uniform population) as well as, for example, beta(4,1) (rich population).

an example with 5 actors distributing 2,5 dollar:

beta(1,1) 0,5 - 0,5 - 0,5 - 0,5 - 0,5 (mean 0,5) 
beta(4,1) 0,1 - 0,2 - 0,5 - 0,7 - 1,0 (mean 0,5) 

I've been thinking. If there is no apparent solution to this, maybe the following could work. We can write the shape of the frequency distribution of beta(4,1) as y=ax^2+b with some value for a and b (both increase exponentially).
In my case, the integral(0-1) of y=ax^2+b should be 5000. Playing around with values for a and b should give me the shape of beta(4,1).

The number of actors having 0.1 should then be the the integral(0-0.1) of y=ax^2+b where a and b are parameters of the shape resembling the beta(4,1).

Is my reasoning clear enough? Could someone extend this reasoning? Is there a link between the beta distribution and a function of a,b,x ?

Joe
  • 457
  • 5
  • 18
daan166
  • 300
  • 1
  • 10
  • if you want the mean to stay equal to 0.5, then you should keep the two shape parameters equal; in R, `rbeta(10000,shape1=s,shape2=s)`; the larger `s` is, the more concentrated the distribution will be around 0.5 – Ben Bolker May 16 '16 at 15:00
  • But how can we keep the total to be exactly 5000? – zyurnaidi May 16 '16 at 15:04
  • If you want to keep the total *exactly* 5000, you need to scale the values by their mean and multiply by 0.5 ... – Ben Bolker May 16 '16 at 15:33
  • but keeping shape 1 and shape 2 equal will not allow me to distribute the values with a right- or left skewed PDF. How can I distribute 5000 following a beta(4,1)? – daan166 May 16 '16 at 15:41
  • I just made a small edit with an example how the distribution could look like for 5 actors. Now I'm looking to generate these values at random for 10000 actors – daan166 May 16 '16 at 16:05
  • Thanks for the input and time, however, I figured out that the thing I tried to achieve is not possible. – daan166 May 19 '16 at 17:29

0 Answers0