divilian / specstar

Combines SPECscape and SPECnet into one project
1 stars 1 forks source link

Incorpororating wealth dynamics as a stochastic dynamical system #32

Closed venkatachalapathy closed 5 years ago

venkatachalapathy commented 5 years ago

As discussed in the meeting (05/31),, one way to introduce environmental heterogeneity is through the use of stochasticity as follows

d(wealth) = income(dt) + white noise

This can be written as a stochastic differential equation. I suggest that we use

http://docs.juliadiffeq.org/stable/tutorials/sde_example.html

In example 1, set f and g to be constants. Vary the constants to vary the dynamics.

Also the array structure of solutions is clearer here

http://docs.juliadiffeq.org/stable/basics/solution.html

jeffg828 commented 5 years ago

How many agents are being used in simulation? I'm doubtful that even Julia is fast enough to run a few hundred ode solves per model step time.

On Sat, Jun 1, 2019, 11:05 venkatachalapathy notifications@github.com wrote:

As discussed in the meeting (05/31),, one way to introduce environmental heterogeneity is through the use of stochasticity as follows

d(wealth) = income(dt) + white noise

This can be written as a stochastic differential equation. I suggest that we use

http://docs.juliadiffeq.org/stable/tutorials/sde_example.html

In example 1, set f and g to be constants. Vary the constants to vary the dynamics.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WheezePuppet/specstar/issues/32?email_source=notifications&email_token=ALNPB27CUBMJABTZIQDZ2ZLPYKF2RA5CNFSM4HSAVZ5KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GXDE3EQ, or mute the thread https://github.com/notifications/unsubscribe-auth/ALNPB25QNJFG7ERFREPAUBDPYKF2RANCNFSM4HSAVZ5A .

divilian commented 5 years ago

I may have a very different opinion about this, so let's duke it out.

I'm totally in favor of modeling environmental heterogeneity, and adding white noise to the income when modifying agent wealth is a perfectly fine idea to start with. Here's the thing, though: in an ABM like SPECscape/net, we don't (and shouldn't) actually be solving differential equations like in the package you cited. Instead, the equivalent result will simply emerge as a consequence of the ABM rules.

To be concrete: let's say we have a global income setting that gives the (mean) grains of sugar each agent receives at each time step. And let's say that each time through the main simulation loop, each agent receives that much sugar, plus or minus a bit of i.i.d. white noise (Gaussian, mean 0, some st dev). This is exactly what we do in the code right now (except currently it's uniform instead of Gaussian noise; that's a one-line fix) and it does exactly carry out and produce the same phenomenon that you wrote with that diff eq.

More briefly, I'm not sure whether you're arguing that we should use the DifferentialEquations package in Julia to accomplish this computation, or whether you're simply arguing that the net effect of the simulation should be to produce the result that could also be captured, in a different way, with that diff eq. I disagree that the former is the right approach, but I agree that the latter is what the simulation should do (and essentially does already, minus the Gaussian part).

jeffg828 commented 5 years ago

Can't see how it could be worth the computational cost in any case.

On Sat, Jun 1, 2019, 21:04 Stephen Davies notifications@github.com wrote:

I may have a very different opinion about this, so let's duke it out.

I'm totally in favor of modeling environmental heterogeneity, and adding white noise to the income when modifying agent wealth is a perfectly fine idea to start with. Here's the thing, though: in an ABM like SPECscape/net, we don't (and shouldn't) actually be solving differential equations like in the package you cited. Instead, the equivalent result will simply emerge as a consequence of the ABM rules.

To be concrete: let's say we have a global income setting that gives the (mean) grains of sugar each agent receives at each time step. And let's say that each time through the main simulation loop, each agent receives that much sugar, plus or minus a bit of i.i.d. white noise (Gaussian, mean 0, some st dev). This is exactly what we do in the code right now (except currently it's uniform instead of Gaussian noise; that's a one-line fix) and it does exactly carry out and produce the same phenomenon that you wrote with that diff eq.

More briefly, I'm not sure whether you're arguing that we should use the DifferentialEquations package in Julia to accomplish this computation, or whether you're simply arguing that the net effect of the simulation should be to produce the result that could also be captured, in a different way, with that diff eq. I disagree that the former is the right approach, but I agree that the latter is what the simulation should do (and essentially does already, minus the Gaussian part).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/WheezePuppet/specstar/issues/32?email_source=notifications&email_token=ALNPB25F5SMLN27QQDAR3MLPYMMBTA5CNFSM4HSAVZ5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWXLPBY#issuecomment-497989511, or mute the thread https://github.com/notifications/unsubscribe-auth/ALNPB24M7T5OHJFZ7RY7X63PYMMBTANCNFSM4HSAVZ5A .

venkatachalapathy commented 5 years ago

The idea was to connect with literature in economics and to simplify the ABM based decision rules by going into continuous-state space formulations. In the future, when we play around with different proto-rules, the interaction term that appears in the SDS formulation is more illuminative than the decision rules. The continuum limit dynamics might be necessary to understand the phenomena at the macroscopic level and connect with economic models.

But for the time being, I agree with you guys that we may not need the differential equation approach. We can revisit this in future iterations.