Sister blog of Physicists of the Caribbean in which I babble about non-astronomy stuff, because everyone needs a hobby

Wednesday 12 September 2018

Talent-luck updates : the wrong way but faster

With everything from one apartment very nearly moved into another, I found some time to work on the ol' talent-luck simulator again.

No new results this time. Instead I modularised and cleaned the code so that it's much easier to modify, and added a bunch more comments so it should be easier to play around with. I also implemented a new method that runs about 100x faster than the old version, though the results are not yet in good enough agreement to be trustworthy. The old method, based on the Pluchino paper, has events as objects that move around the world in a random walk. This means each agent has to check if it's in range of every event, which is slow (500,000 checks per timestep).

For the new method, I ran 10 simulations which output the number of events occuring at each timestep to get an event frequency distribution. The new method approximates this as a Gaussian. So a random number of agents is chosen based on this distribution at each timestep, and for each of them some number of events happen. The luck status of each event is assigned to be random in this case. Hence the agents should have roughly the same rate of good events and bad events occuring. And this is massively faster because there are typically only 40 agents that need to be evaluated.

This nearly works. The basics are there but the details disagree, in particular the fraction of wealth held by the 20% richest is closer to 60% rather than 80%, and the slope of the wealth distribution is a different shape and not a simple power law. I haven't had time to check why this is yet : it could be I'm doing something subtly wrong with the new method (I have some suspicions as to what that might be), or that the event frequency distribution isn't as good an approximation to a Gaussian as it appears on a cursory inspection. Still, I'm hopeful this will allow much larger numbers of simulations and more thought behind the underlying method, rather than just endless comparisons to the original model. That's much easier to do when the thing runs in 30 seconds instead of 8 minutes (most of the time is now taken up by plotting, and I expect that to more or less disappear if I run it offline instead of through repl).
https://repl.it/@RhysTaylor1/TalentVersusLuck

2 comments:

  1. It sounds like the old way (Pluchino method) reimpacted agents more per event, so that the new model has blunted that, hence the more even wealth distribution.

    I really can't wait to take a look at your code.

    I wrote a similar simulation engine as the backbone for a planned game that was never completed... Very different premise technically, but mechanically similar to what you're describing. Love this stuff.

    ReplyDelete
  2. Jason Nichols Thanks !

    In an earlier test, I found that the distance the events move (first two panels on the lower row, incorrectly labelled as "agents move") makes a big difference to the wealth distribution. So as you say, I suspect the agents are getting a few more events than from pure chance. I think I need to measure the mean event frequency per agent and see how much higher that is than chance.
    https://lh3.googleusercontent.com/YtNscPxn63fizycZgBhlhuLVgWuBBWIBVy6lazO2ZWWltLgaLVcBU7OJhOOcGD9kWJv6kvR8akpsP9BZFBopQ6neNTBJxGAB6Svn=s0

    ReplyDelete

Due to a small but consistent influx of spam, comments will now be checked before publishing. Only egregious spam/illegal/racist crap will be disapproved, everything else will be published.

Review : Ordinary Men

As promised last time  I'm going to do a more thorough review of Christopher Browning's Ordinary Men . I already mentioned the Netf...