October 22, 2019
For today
Read Chapter 9 and do the reading quiz
Turn in your final report
Today
Preview of the second half
Chapter 9
Why Agents?
Schelling's model of segregation
Sugarscape
For next time:
Read Chapter 10 and do the reading quiz
Read "Why Agents" and come to class prepared to discuss reading questions.
Bibliography 4: Find a paper that might make a good project 2 and add an entry to the annotated bibliography
Optional reading: Economist article relevant to determinism
Reading questions on Axtell (2000), "Why Agents? On the Varied Motivations for Agent Computing in the Social Sciences," Working Paper No. 17, Center on Social and Economic Dynamics, The Brookings Institution:
According to Axtell, what are the three distinct uses of agent modeling techniques?
Which was considered most scientifically acceptable at the time he was writing?
Which do you think he is most interested in?
For what other reasons does Axtell encourage social scientists to include agent-based modeling in their "toolkits"? (Hint: see the "Conclusions" section.)
How do things look now on those fronts, compared to 2000?
What does Axtell mean by a "sufficiency theorem"?
Why might "sufficiency analysis" (as Newell and Simon called it) be a controversial approach to science?
Chapter 9: Agent-based models, economics, Schelling's model, Sugarscape
Chapter 10: Agent-based models in space: traffic jams and Boids
Chapter 11: Evolution
Chapter xx: Game theory, Iterated Prisoner's Dilemma
Chapter 12: Evolution of cooperation
Chapter xx: Bayesian statistics
Project Two Schedule
Bibliographies: Oct 29, Nov 1, Nov 5
Proposal: Nov 8
Working notebook: Nov 15
Draft: Nov 22
Final: Dec 11
I have asserted that FFT takes n log n time. Let's see why.
1) Open notebooks/fft.ipynb
2) Read through the text and code, and work on the exercises.
Then we'll do some order of growth analysis.
We saw this model at the beginning of the semester, so there might not be much more to say.
The implementation uses NumPy and np.convolve2d again.
It also uses np.nonzero, which I wrapped with locs_where:
def locs_where(condition):
return np.transpose(np.nonzero(condition))
Why does np.nonzero return a tuple of 1D arrays rather than an N-D array?
Have I just reinvented np.argwhere?
You can use a tuple as an index into a NumPy array (but you can't use an array as an index). As a result, you might end up doing a lot of conversion.
Exercise: for each expression in the following snippet, identify the type
unhappy_locs = locs_where(occupied & (frac_same < self.p))
empty_locs = locs_where(a==0)
for source in unhappy_locs:
i = np.random.randint(len(empty_locs))
dest = tuple(empty_locs[i])
a[dest] = a[tuple(source)]
a[tuple(source)] = 0
empty_locs[i] = source
Features:
1) Agent heterogeneity.
2) State in the world as well as the agents.
3) Local information.
If agents live forever, the distribution of wealth is not stationary.
Once we give them finite lives, we have all of the elements of an evolutionary system:
1) Replicators
2) Variation
3) Differential survival
So we expect to see increasing fitness over time (where "fitness" just means propensity to survive and/or reproduce). In the notebook, you'll have a chance to explore this.
What does Sugarscape have to say about wealth inequality?
Implementation note: agent-based models and object-oriented programming go together nicely.
1) Heterogeneity between agents can be represented with instance variables.
2) Different kinds of agents can be represented with inheritance hierarchies.
3) Different models can be implemented using the template pattern (parent class defines the structure of the simulation, child classes provide implementations of key methods).
Next time, more about emergence.