Project Topics

326 views
Skip to first unread message

Alan Isaac

unread,
May 12, 2014, 11:53:11 AM5/12/14
to au-ec...@googlegroups.com
Use this thread to discuss possible topics for your term project.

A one paragraph project description is due next week.

Alan Isaac

unread,
May 13, 2014, 9:50:30 AM5/13/14
to au-ec...@googlegroups.com
This post is to some extent a response to Kevin's introduction.  Kevin expressed an interest in a couple languages and technical tools.  I will be expecting students in Econ 450 and Econ 650 to learn a little NetLogo, a language that specifically targets agent-based applications.  NetLogo is a very easy language, yet is has powerful features for agent-based modeling.  It will be the language for the homework assignments.

However I am open to students using other languages for their main project, if they prefer.  Contact with a statement of your reasons and your choice of language, and I am sure we can find a mutually agreeable arrangement.
 

Alan Isaac

unread,
May 13, 2014, 12:18:30 PM5/13/14
to au-ec...@googlegroups.com
I want to mention one more support resource for this course:
the Writing Lab in the ASAC will be offering online support
for students enrolled in online classes this summer.

To visit the Writing Lab webpage, which contains all the
instructions to schedule an appointment and prepare for it,
please go to
https://american.mywconline.com/index.php?msgLOG=YES

Cheers,
Alan Isaac

Kevin Carrig

unread,
May 13, 2014, 1:27:58 PM5/13/14
to au-ec...@googlegroups.com
Great to hear the main project may be expanded to outside computational languages. For anyone that may be more inclined to use Python as their basis for ABM, I came across Tengolo, a library for agent-based modeling in Python. Most of the functionality here is borrowed from the matplotlib module, but it may be interesting to compare the efficiency gains in implementing a model in Python vs. NetLogo. Below is the documentation for this library:

Alan Isaac

unread,
May 14, 2014, 7:56:13 AM5/14/14
to au-ec...@googlegroups.com
Thanks for pointing out https://github.com/abegong/tengolo

You may also be interested in gridworld (my own effort):
http://econpy.googlecode.com/svn/trunk/abm/gridworld/gridworld.py

Alan Isaac

Kevin Carrig

unread,
May 14, 2014, 10:46:19 PM5/14/14
to au-ec...@googlegroups.com
Can you speak to the GIS extension in NetLogo? Specifically, incorporating shapefiles, interacting with various projections, and clustering methods in lat-lon data?

Kevin 

Alan Isaac

unread,
May 15, 2014, 10:25:30 AM5/15/14
to au-ec...@googlegroups.com
GIS Extension

Use of the GIS extension goes beyond the instructional scope of this course, but you are nevertheless welcome to use it in your term project. However, I would generally suggest postponing this additional complexity.  Getting a functioning model up and running will be  enough of a challenge for most students.

You can find a useful introduction to the use of the extension here:
http://modelingcommons.org/browse/one_model/2354

hth,
Alan Isaac

Mia Raths

unread,
May 19, 2014, 8:56:47 AM5/19/14
to au-ec...@googlegroups.com
Do you want us to submit the one paragraph proposal on blackboard or email it to you?

Kevin Carrig

unread,
May 19, 2014, 9:55:47 PM5/19/14
to au-ec...@googlegroups.com
The Federal Association of Scientists (FAS) publishes a wide-variety of agent-based models with applications in social network theory and geospatial analysis. I am looking for feedback on the feasibility of a project that replicates one of these experiments. Edward P. MacKerrow published an interesting paper in conjunction with the Defense Threat Research Agency (DTRA) titled: Understanding Why-Dissecting Radical Islamic Terrorism with Agent-Based Simulation. (http://www.fas.org/sgp/othergov/doe/lanl/pubs/las28/why.pdf )The goal of the paper is to borrow tools from the field of computational economics and sociology to develop agent-based models that simulate social networks and the spread of social grievances within those networks. By exposing a set of agents to a series of determinants, the model attempts to simulate the radicalization of these agents to identify the "precursor signals of the next terrorist attack".

I am looking for ways to properly scope this project to maintain some level of feasibility that follows the guidance of the KISS method. My idea is to refine the basis of the paper to a set of agents that are interacting within some pre-defined network. Twelve agent attributes are utilized in the original model: Age, Sex, Education, Education Type, Ethnicity, Religion, Extremism, Pedigree, Income, Marital Status, Employment Status, and location. A simpler model may refine these attributes to those that are strictly demographic or those with economic implications. An initial model may include a set of agents that fall into one of two categories: (1) radicalized "terrorists", or (2) civilians that exhibit a range of the attributes provided above. In the model, interactions between civilians and terrorists may result in the radicalization of the civilian depending on the levels of these attributes. Moving forward, a few of my scoping and feasibility concerns are outlined below:
  • To adequately explore the interactions and evolving networks in the model, would a Python implementation make sense here? My thoughts are that igraph or some other SNA utilities in Python may lend themselves more to this type of ABM than Netlogo (please elaborate if the network utilities in Netlogo could suffice).
  • Is there a particular element in the paper that lends itself to a Netlogo implementation and the parameters of this course?
  • Can we safely exclude the GIS application of the model? I.E. simplify the shapefiles used in the model to a more basic application in a tradition XY space?
Any feedback is appreciated.


Alan Isaac

unread,
May 20, 2014, 11:12:36 AM5/20/14
to au-ec...@googlegroups.com
Modeling Terrorism

This is naturally a very "hot" topic and you can find many papers on it.  I do not work in this area, but my impression is that "state of the art" papers in this area are often incorporating GIS information.

Your concern about scope is on the mark: this is a full-blown research agenda, more than just a dissertation topic, and much more than just a term paper. So as you suggest, the question is whether you can extract some considerations that are interesting enough to attract you to the project but simple enough to keep it feasible.

There are two possible approaches here.  One is to try to distill a simpler model out of the paper you cite. The other is to start with a very simple model (e.g., http://ccl.northwestern.edu/netlogo/models/community/Terrorism_vs_Altruism or possibly http://www.dsto.defence.gov.au/publications/scientific_record.php?prefix=1947&record=2605) and start adding features you feel are important and missing.  To ensure feasibility over a period of a few weeks, I encourage the second approach.  For the same reason, I encourage the use of NetLogo.  While the NetLogo ships with a fairly limited network extension, I have had good experiences with it.  The big loss in choosing NetLogo rather than say Python is that you won't have access to real inheritance (although you can use breeds as a partial substitute).  However, you may well not really need inheritance; you can probably model roles as breeds.

In short, I think the project of trying to replicate that paper is huge, unless you are lucky enough to have access to the code and to the data, and even then is much more than a term project.  I am inclined to instead direct you towards the opinion dynamics literature, which I think will provide excellent background for the interests you are expressing.  For example, you might take a look at a simple effort in the Community Models (http://ccl.northwestern.edu/netlogo/models/community/Social%20influence%20in%20networks), since it is always good to have working code to look at, or a more complex published effort (http://jasss.soc.surrey.ac.uk/16/3/4.html), for which there is also code (http://www.openabm.org/model/3418/version/1).

hth,
Alan Isaac

Adin Dobkin

unread,
May 22, 2014, 10:55:05 AM5/22/14
to au-ec...@googlegroups.com
As someone similarly interested in defense topics, I too was looking at doing something similar (although on the other side of the equation).  

I was looking at implementing a *very* basic model of counterinsurgency vs. force tactics and their effects on an indigenous population.  Looking at the NetLogo models, it could possibly be a derivative of the rebellion model under 'social sciences'

Essentially, the first turtle group (the non-indigenous group) would have one of two options - counterinsurgency tactics or force tactics.  Counterinsurgency tactics would have some set probability of converting a second, neutral group to the first turtle group, but wouldn't remove any of the third, antagonistic turtle group.  Force tactics would have a greater probability of removing the third turtle group, but also have a certain probability of converting the second turtle group into the third.

I suppose my primary consideration for this (if it's feasible at all in this class) is whether some long-term equilibrium can be achieved under such a model, or whether additional variables would be required that complicate it too much.

Adin Dobkin

unread,
May 22, 2014, 10:57:24 AM5/22/14
to au-ec...@googlegroups.com
Kevin,

The think tank that I work at has been exploring this general concept (although not necessarily in NetLogo/Python) for a bit of time.  Maybe we could brainstorm possible methods (as I'm working on something not entirely irrelevant to the concept).

Alan Isaac

unread,
May 22, 2014, 12:15:51 PM5/22/14
to au-ec...@googlegroups.com
Rebellion Model

A modification of the Rebellion Model in the NetLogo Models Library can definitely be a feasible term project.  You should make a list of the changes that seem most important to you, and attempt them one at a time.  Do not try to make them all at once!

As for whether a long-run equilibrium will result, you will find out by implementing your changes.  In this case, a more interesting result than "equilibrium" (depending on what you mean by that) will probably be sporadic but recurrent rebellions.  If you have had econometrics, an interesting extension will be to see if you can predict outbreaks of rebellion one or more periods ahead, using the data generated by your model.

Alan Isaac

unread,
May 22, 2014, 9:02:23 PM5/22/14
to au-ec...@googlegroups.com
Counterinsurgency

I would love it if you two would cooperate on your projects.  Also, feel free to establish a new Counterinsurgency (or whatever) thread to discuss here in our group, and to solicit feedback from your classmates.

Kevin Carrig

unread,
May 22, 2014, 10:27:46 PM5/22/14
to au-ec...@googlegroups.com
I think it would be really informative if we swapped ideas and exchanged some themes. I'll go ahead and start a new topic called "Counterinsurgency/Defense-Based ABM" and I'll post my project proposal in its current state- feel free to do the same.

Alan Isaac

unread,
May 23, 2014, 10:59:56 AM5/23/14
to au-ec...@googlegroups.com
Submission Reminder

While most have submitted their project-description paragraphs, a couple students have not yet done so.  I will accept these late.

But note: I cannot accept the upcoming programming assignments late!  Plan ahead.  All assignments and due dates have been posted since the beginning of the class:
These assignments assume you are keeping up with the NetLogo programming exercises, and they will take a substantial amount of time to complete.
Message has been deleted

Adin Dobkin

unread,
May 24, 2014, 12:39:16 PM5/24/14
to au-ec...@googlegroups.com
Perfect - I'll start throwing some ideas around in the thread as I come along with them.  

Adaora Isichei

unread,
May 24, 2014, 5:21:01 PM5/24/14
to au-ec...@googlegroups.com

After giving it some thought, I would like to research urbanization and pollution; this project will focus on C02 emission. My theory is, increase in population density in major cities leads to an increase in atmospheric pollution from cars, factories, etc. Therefore the more congested a city the higher the level of C02 emission.  

I welcome your advise and recommendations.


On Monday, May 12, 2014 11:53:11 AM UTC-4, Alan Isaac wrote:

Sebastien Lundby-Thomas

unread,
May 27, 2014, 9:57:14 PM5/27/14
to au-ec...@googlegroups.com
After looking at some other models I would be interested in doing one that specifically targeted investors and how they invest. In particular I would like to look at risk based on some variables including different time horizons and risk tolerance. This could become very complicated very quickly so I will have to find a way to make it more focused. Any suggestions? There are some previous models, the earliest of which was in 1995 that look at investors, but I am going to see if there are different variables that I can include which may change the outcome or information gathered by my own model.

Alan Isaac

unread,
May 28, 2014, 10:49:57 AM5/28/14
to au-ec...@googlegroups.com
Investor Behavior

You can work with the investment model at
http://www.vismath.org/research/landscapedyn/models/markets/rev09index.html 
(Use the "base model, slim version", and use word instead of + for string concatenation.) 
Or the simpler Lux and Marchesi model at
http://web.econ.unito.it/terna/tesine/luxandmarchesi.htm

A good chunk of your paper (and research) would just be explaining in detail how the basic model works.
Your contribution will be to
i. run interesting experiments with the model, which you will report on
ii. make a small but interesting change, and rerun the experiments, to see how your results change

Note that you need mastery of the course material to date in order to work with these models.
(Also note that your proposal must be submitted via Blackboard.)

Kevin Carrig

unread,
Jun 2, 2014, 11:10:51 PM6/2/14
to au-ec...@googlegroups.com
Post a link to the most important paper you have found related to your course project.

My final project builds on the findings of the two papers highlighted below. The goal of the model is to simulate a world of civilians and terrorists that operate in a confined space. Each civilian agent 'owns' a random 'propensity for extremism' value. Civilians and terrorists interact over a series of iterations, with such meetings resulting in the conversion of a civilian to a terrorist if their extremism value is above a specified threshold. We also introduce a randomly distributed set of drone attacks that operate in the space.If civilian agents are within a specified distance of one of the attacks, their extremism values increase by a set interval (or, alternatively, a value that is scaled according to their distance from the attack).Thus, civilian agents that would otherwise not 'convert' to terrorism agents before an attack may convert if they are in the vicinity of one of the random drone strikes and their extremism value increases above our threshold.

Some critics argue that drone strikes are actually a popular mobilization strategy as civilian deaths may inadvertently encourage people to join militant groups. Guided by the papers below, we want to understand how proximity to drone strikes may influence the incidence of extremism and 'conversion' to terrorism.

Some help refining this scope and selecting relevant demographic variables to assign to each agent (turtle) would be great.


Understanding Why-Dissecting Radical Islamic Terrorism with Agent-Based Simulation

Countering Radicalization:An Agent-Based Model of Precision Strike Models
forms2.la.psu.edu/...countering-radicalization-an-agent-based-model-of-...

Alan Isaac

unread,
Jun 3, 2014, 7:19:14 AM6/3/14
to au-ec...@googlegroups.com
Scope

My recollection is that you will approach this project by modifying the Rebellion model.  I also believe you plan to use Python for your project. (?)  If so, the first step is to implement the Rebellion model in Python.  Have you done that?

Alan Isaac

Kevin Carrig

unread,
Jun 3, 2014, 10:10:55 AM6/3/14
to au-ec...@googlegroups.com
Yes- I believe we settled on some replication of the Rebellion model with the introduction of additional attributes to each class of agents (if time permits). For a Python implementation, it seems as if some familiarity with Python's class mechanism is necessary. Do you recommend any readings for object orientated programming in Python? For scoping purposes, it may also make sense to settle on one uniform module to use through the course of the project. I like the approach and readability of PyCX (see below for a link), but I am also open to other packages.Once I am settled on a package, I will work towards creating a skeleton of the Rebellion model.

PyCX: A Python-Based Simulation Code Repository for Complex Systems Education:


PyCX Project



Adin Dobkin

unread,
Jun 3, 2014, 11:05:09 AM6/3/14
to au-ec...@googlegroups.com
Keller, Desouza, Lin - Dismantling Terrorist Networks: Evaluating Strategic Options Using Agent-based Modeling

In this report, the authors examine the various methods of destroying terrorist networks.  The four primary methods examined are leader, grassroots, geographic, and random.  They make note that these networks are unlike other social connections found in the sense that there are complex structures of allegiance found, as well as the inclusion of a scale-free network where a large number of agents have a small number of connections, and a small number of agents have a high number of connections.  

Nonetheless, they believe that one must focus on the individual in order to study this subject effectively as an important consideration is how these networks recruit.  They make mention of the Threat Anticipation Program and the Seldon Toolkit as previously existing resources for examining these networks.

Martinez, Fitzpatrick - Agent-based Modeling of Counterinsurgency Operations

In this paper, the authors create a simple model wherein the development of an insurgency network is modeled over time in relation to various forms of operations.  The four key considerations they discuss in terms of the development of this network are the individual tendencies to favor one group, the influence of others in the network, the effect of positive measures, and the effect of negative measures.  While physical interaction is required for these positive (hearts & minds) campaigns, it is not required for many of these negative campaigns (e.g. drone strikes).  

On Monday, May 12, 2014 11:53:11 AM UTC-4, Alan Isaac wrote:

Natalie Chambers

unread,
Jun 3, 2014, 2:03:49 PM6/3/14
to au-ec...@googlegroups.com
The following link will take you to an article entitled: FDI and Economic Growth:The Role of Local Financial Markets. Amanda and I will be attempting to replicate this model for our final project. 

Amanda Saville

unread,
Jun 3, 2014, 8:42:21 PM6/3/14
to au-ec...@googlegroups.com
As Natalie posted above, we will be attempting to replicate the model as an ABM per a suggestion by Dr. Isaac.

Just to give a bit of background before any of you go into reading about this model, the authors have performed regression analysis to determine what (if any) mechanism exists between the level of development of local financial markets and incoming FDI to a given country. As is often expressed in literature about economic growth and emerging economies, Increased FDI is associated with economic growth for a whole host of reasons. But is there a threshold of financial market development that must be met before increased FDI is accompanied by positive spillover effects? This is the question the authors seek to answer through their econometric study, and the same question Natalie and I will address in our course project.

To provide some more-detailed summary, all agents in a given country are give two choices: to work for the foreign company in the FDI sector of the economy or to take-on an entrepreneurial venture by starting their own firms. The decision of an agent to develop his own firm depends on his ability (given at birth but varies among agents) and his availability to capital (thus on the level of development of financial markets).

I realize our project is quite ambitious, and I think what I am most concerned about is the amount of seemingly nested variables that will be present in our model. Additionally, while we have had discussion on the logic that will drive our agents to make the decision to work for the FDI sector or to pursue entrepreneurial endeavors, I am not yet sure how we will incorporate this all into economic growth more broadly...

As for the projects that will deal with terrorism and counterinsurgency, I am very much looking forward to reading these articles (hopefully tomorrow morning). I went to an all-day talk downtown on Friday on terrorism, and was actively thinking about your projects and how useful ABM is/can be in that policy realm.

Message has been deleted
Message has been deleted

Kevin Carrig

unread,
Jun 4, 2014, 9:25:29 AM6/4/14
to au-ec...@googlegroups.com
Are there parts of your project description that do not seem to fit into the ODD protocol? If so, what are they?

Initialization is described as the initial conditions we use to set up the model World at the beginning of the simulation. Are there guiding principles in how we allocate an initial number of agents and the initial values given to their state variables? I would assume these parameters are determined on a case-by-case basis, but I am struggling to scope this properly for my project. For example, should the introduction of n number of agents assume that n somehow reflects the magnitude of agents in our real world case? Or, is it the case that we are relatively unconcerned with n for the purpose of this project because we are only hoping to observe the interactions among the two classes of agents (civilians and terrorists). 


Natalie Chambers

unread,
Jun 4, 2014, 10:07:10 PM6/4/14
to au-ec...@googlegroups.com
Amanda and I are working on out ODD currently and we had a couple of thoughts we would like feedback on. We are modeling a world with two sectors (as Amanda described above): foreign (FDI) and domestic. We were thinking about ways to best model our patches so that we can simulate the movement of turtles on the patches like people moving across sectors or raising their returns within their current sector. We discussed an idea similar to the Butterfly model where we use hills and elevation to help simulate how people will move. For instance we were discussing having two hills that each cover a large portion of half of the world (or nearly an entire sector). Initially zero or one patch would be colored (say green) on each hill (at the peak) which would simulate zero economic growth or a stagnant economy. Then as production increased an increasing number of patches would turn green (moving down the hill to signify the spread of production). This production would increase as financial markets become increasingly developed. Say you have perfect development of financial markets then the maximum surface area of the world would be covered with green patches. Meanwhile as financial markets develop more people will be able to earn larger returns in the domestic sector than in the foreign sector (and will therefore move there) as the the difference between the borrowing rate and the lending rate decreases. 

We would appreciate and advice or suggestions? Also if you think it sounds outrageous we would like to know that. :)  

Alan Isaac

unread,
Jun 5, 2014, 2:26:39 PM6/5/14
to au-ec...@googlegroups.com

Two Sector Model

Just a reminder: rank your goals (attending to interest and feasibility), start by conceptualizing and implementing just part of what you want to do.  Small and complete beats visionary and unimplemented.

That said, after reading about your interest, I am wondering if you would like to see how much you can implement of section 3 of:
http://www.uvm.edu/~wgibson/Research/Gibson_ABM_informal.pdf
Is that close enough to your interests?

Ordinarily, display considerations will come late in the game.  Focus on the substance of our project, and ideally you will discover as you implement what visuals will be useful.


Alan Isaac

unread,
Jun 5, 2014, 2:41:33 PM6/5/14
to au-ec...@googlegroups.com

Number of Agents

This is an interesting and difficult question, and the answer depends on your goals.  In some settings, it is appropriate to have a computer agent for each real-world agent.  Often this is not feasible.  Often it is not desirable even when it is feasible.

The big background question of course is whether the model results scale. That is, are your results sensitive to the number of agents?  The more sensitive your results are to the number of agents, the more important it will be to have a realistic number of agents for your application.

In this class, I am not asking you to calibrate your models to real-world data.  Furthermore, I don't want you sitting around waiting for results instead of programming.  So I encourage you to use a small number of agents (dozens or at most hundreds).  However, if you suspect your results depend sensitively on the number of agents, it would be a good idea to do a sensitivity analysis (e.g., set n=50, 500, 5000).

Note that it is unfortunately easy to write code that runs quickly for 50 agents and won't ever terminate for 5,000 agents. (Try enumerating all possible subsets, for example.)  You will need to be sensitive to this.

I hope this starts to answer your question.  Otherwise, ask again.

Alan Isaac

unread,
Jun 5, 2014, 3:08:57 PM6/5/14
to au-ec...@googlegroups.com
Object-Oriented Programming

Material of OOP comes later in the course, but I understand that you feel you need it now.  So take a look at
and my introduction

As for PyCX, I think you that for the needs your describe, you would be better off with my gridworld module.  Just drop it in your directory and import it.

But use whatever you find most helpful.

Alan Isaac

unread,
Jun 5, 2014, 3:20:08 PM6/5/14
to au-ec...@googlegroups.com
gridworld

I should mention this paper
which functions as an introduction to gridworld and to object oriented programming in Python.

Adin Dobkin

unread,
Jun 5, 2014, 5:16:11 PM6/5/14
to au-ec...@googlegroups.com
Most of the outline seems pretty straightforward to me, but I'm having a bit of trouble understanding the 'design concepts' section of the ODD.  I've read over Table 3.1 in Chapter 3 - are we expected to answer all of the relevant questions on there, or generalize some of them in a paragraph or two (I'm already at two pages as it is w/o this section).  Thanks so much!

Alan Isaac

unread,
Jun 5, 2014, 9:36:29 PM6/5/14
to au-ec...@googlegroups.com
Design Concepts

This is where the rubber really hits the road: how carefully have you thought your project through?  While not all of the aspects need to be addressed in every project, it is helpful to try to address each topic individually before making a decision about whether or not it is relevant.  You can find a good discussion here:

It is also the case that you are likely to be more ready to write the "design concepts" section after your are nearly finished with the project then when you are still working it through.  For example, you may have no clue as to whether emergence will prove interesting when you start your model.  (It is hard to plan for emergence!)  I'd encourage you to try to address at least the following: stochasticity, interaction, and observation.  For observation, try to anticipate what data you would like to gather from the model.  (You have experience making NetLogo graphs and producing CSV files, which are two way of collecting data.)

Alan Isaac

Adaora Isichei

unread,
Jun 7, 2014, 8:53:14 AM6/7/14
to au-ec...@googlegroups.com

My project will focus on environmental Kuznets theory. Environmental Kuznets Curve used to describe the relationship between economic growth and environmental quality.
Hypothesis of an inverted U-shaped relationship between economic output per capita and some measures of environmental quality. AS GDP per capita rises, so does environmental degradation. However, beyond a certain point, increases in GDP per capita lead to reductions in environmental damage. My research will propose that environmental regulations cause the decrease in emissions

The following links are published articles on this study.
ftp://131.252.97.79/Transfer/ES_Pubs/ESVal/EnviroKuznetCurve/agentbasedkuznet.pdf
http://isecoeco.org/pdf/stern.pdf

Amanda Saville

unread,
Jun 7, 2014, 9:21:03 AM6/7/14
to au-ec...@googlegroups.com
Hello all,

Attached is our outline (myself and Natalie are working together).  We welcome any and all feedback, and look forward to reading your outlines as well!
CP ODD Outline.docx

Amanda Saville

unread,
Jun 7, 2014, 10:44:11 AM6/7/14
to au-ec...@googlegroups.com
I wasn't quite sure if this was the appropriate place to post about implementation verification (I thought about the Gambler's Ruin thread), but it seems like it is most appropriate here:

The readings on implementation verification provided a whole spectrum of ways to test code, which I think will be very useful for our projects.  I know I have already gotten into the habit of using the "check" syntax button, but several of the other tests should be included in all of our regular habits.  In Gambler's Ruin, I implemented "show" so that I could see what was going on in the model.  I wasn't sure if my random pairs were re-pairing, so I added "show pairs," and observed how they repaired in the command center.  After reading the chapter in the Railsback and Grimm book, I think it might have been easier to digest had I had created a file.

It was not until later that I realized my players were actually going into negative wealth, which meant my command to reshuffle and exclude players with 0 wealth as observers was not working.  I did not observe this until the single player I was following in my line plot went negative, but it should have been something I tested for earlier.  I think creating files with the output will be one of the most useful tests, and one of the ones I begin to perform at multiple stages of code-writing.  Had I created a file output of players' wealths through the simulation, I could have more easily spotted negative wealths.

Other important implementation verification tools that I think we should all be very familiar with at the conclusion of this course include 1) the "step" button, which will implement the program just once, so we can watch what goes on in a slower, isolated perspective and 2) stress tests, which models under extreme conditions.


Alan Isaac

unread,
Jun 7, 2014, 12:10:58 PM6/7/14
to au-ec...@googlegroups.com
Verification

Good points about verification.  Yes, it can be very helpful to output data to files in order to analyze the behavior of your models.

Do not forget about NetLogo's error command. It is very useful.  E.g.,
if (min array:to-list wealth < 0) [error "should not see negative wealth"]

Use such construct often!

Matthew Reardon

unread,
Jun 7, 2014, 9:07:20 PM6/7/14
to au-ec...@googlegroups.com
My project will focus on replicating the threshold results found in Melitz's trade model.  The original paper can be found at Melitz 2003 and shows how a threshold level for firm entry/exit decisions based on firm productivity levels.  Additionally, "opening" an economy provides similar results by extending the market size.  I plan on adapting the model to use a search function like we've seen (in ABS models) to move the focus away from labor demand towards consumer demand. 

Alan Isaac

unread,
Jun 9, 2014, 8:20:46 AM6/9/14
to au-ec...@googlegroups.com
Be sure to take a look at the project outlines of other students. 
You will learn a lot, and your suggestions will be welcome.
And furthermore, discussion of these outlines counts towards your discussion grade!
Message has been deleted

Adaora Isichei

unread,
Jun 10, 2014, 1:02:15 PM6/10/14
to au-ec...@googlegroups.com
I am trying to find a way to let firms (turtles) in my model optimize their maximum utility. Does anyone have any suggestions?

Kevin Carrig

unread,
Jun 10, 2014, 9:00:51 PM6/10/14
to au-ec...@googlegroups.com
Attached is my current project outline. I would appreciate any feedback- especially any novel ideas for agent interaction or attributes in the model. 

One of the more important questions I have been struggling with is the implementation of some time decay feature in the model. In the model's current state, we are certain to arrive at an equilibrium in which every civilian agent (regardless of patch location) becomes a terrorist agent at the end of the simulation. I was hoping to implement a feature that presents some time decay to control the population of these terrorists. At the moment, our randomly distributed event (drone strikes) only affects the sentiments of those agents in that patch. While it may make sense to remove those terrorists in a patch where a drone strike is implemented, my fear is the earlier iterations of the model (in which our terrorist population is limited) may go extinct before the simulation gains momentum.  


Course_Project_Proposal.docx

Alan Isaac

unread,
Jun 10, 2014, 10:55:25 PM6/10/14
to au-ec...@googlegroups.com
Firm Behavior in Adaora's Model

My recommendation is to stick as closely as possible to the model of the paper you chose, especially as you get started.  (Unfortunately it is difficult to understand because of how it is written.)  You should expect it to be challenging to fully implement the model. The first task you should take on is implementing the vision aspect.  You did some class reading relevant to this:
 
However they seem instead to use in-radius, with a radius of 40.

You want to make a 200 x 200 collection of patches.  As I understand the paper, you can let patches represent "data objects": technology combinations of output and pollution. Frontier data objects are those where there is not available higher output with lower pollution.  As far as I can tell, initialization of the patches is random but not specified in the paper, so you will need to try your own approaches.  Not every patch is a "data object"!

Alan Isaac

unread,
Jun 11, 2014, 12:42:36 PM6/11/14
to au-ec...@googlegroups.com
stats extension

It looks like Adaora may end up wanting the stats extension for her model, so I added an example use under her name in our Subversion repository.  If others want to use this extension, you will need to make a copy of her stats folder, immediately below your model folder.  (This extension is not included with your NetLogo installation.)

Amanda Saville

unread,
Jun 11, 2014, 4:32:55 PM6/11/14
to au-ec...@googlegroups.com
Kevin,

Your project sounds very interesting.  Are you working on this with Adin?

I was just wondering if you could clarify--I know you said that all civilians would randomly be assigned a "propensity for extremism" attribute, and for every drone that hits their patch, this attribute would increase by 1, but does this random propensity vary among agents within one patch?  I ask because in your flow chart example, it seems that there was not much variation (but for one of your squares) between populations living in the same patch.

I'm not sure that you really need to consider any (or many) more attributes for your agents, or it may over-complicate your model.  Of course there are always additional ones you can think about to explore maybe after you've implemented and observed the results of your core model (maybe links among families/ethnicities that can cut across patches [this would be one way to affect civilians located in patches that did not experience drone strikes], or quality of life that could be a composition of some level of safety or public services [which could be provided by terrorists or by non-terrorists]).

As for the "decay" feature, is it realistic that every civilian agent will become a terrorist agent?  Maybe so in your model, but I would argue that there should be some random turtles that have zero propensity for extremism regardless of the number of drone strikes... If the simulation is supposed to explore whether or not drone strikes are useful tools for terrorist recruitment, you must still build a (sturdy enough) straw man to represent the goal of the drone strike in the first place.  Is there a drone strike happening every iteration (maybe you said this and I forgot, and if so I apologize)?  Perhaps if there were not a drone strike every iteration, but rather every x number of iterations, it would give terrorists more time to make rounds to different neighborhoods to convert those who already meet the threshold.  If you did this, I am not convinced that your terrorist population would go extinct too early--maybe sometimes this would happen, and maybe other times it would not.  This would be more dependent on the probabilistic nature of your simulation, I would think.

I'm not sure if that was helpful feedback, but I'm looking forward to further discussion of your model!

Alan Isaac

unread,
Jun 12, 2014, 9:18:43 AM6/12/14
to au-ec...@googlegroups.com
extinction

Extinction is a valid outcome.  For example, if an epidemiological model, not every infection becomes an epidemic.  Some just die out.  Opinion dynamics models have some relationship to such epidemiological models and this is an example: an opinion should be able to die out.  (This a general observation, not a statement of a requirement for your model.) 

Here is another possibility: you may want to allow a person to "recover" from radical ideas with a certain probability.  (After that, will they be immune from "reinfection"?)

Please post code to the Subversion repository so that we can have a more focused discussion.

Adin Dobkin

unread,
Jun 12, 2014, 10:56:47 AM6/12/14
to au-ec...@googlegroups.com
Amanda,

Our projects are similar and I'm sure we'll trade some thoughts as I begin to implement mine.  The primary difference between the two is the option of soft power as an alternative to hard power (in Kevin's case, drone strikes).  I'm also utilizing a few different behaviors for the indigenous population rather than a recruitment network, although a number of reports that I based my simulation around were, in fact, specifically about these networks.

Adaora Isichei

unread,
Jun 14, 2014, 5:03:34 PM6/14/14
to au-ec...@googlegroups.com
I don't think I stated my question efficiently. My model has to factor in GDP/capita growth , therefore firms within the model have an internal system driving growth.
It was a bit tasking finding articles that model GDP growth but I found the following  http://www.lem.sssup.it/WPLem/files/2005-04.pdf .

Adaora Isichei

unread,
Jun 14, 2014, 5:33:48 PM6/14/14
to au-ec...@googlegroups.com
Hey Matthew,

I am really interested in your model. I was wondering how you aim to implement variation in productivity level among firms. Will the firms a have a mechanism guiding profit driven growth?

Natalie Chambers

unread,
Jun 14, 2014, 7:40:26 PM6/14/14
to au-ec...@googlegroups.com
Adin, I was rereading your project proposal (or the papers your posted about your project) and I was interested to see how you would plan to model the different behaviors of the indigenous population. Will these behaviors change over time? For instance, if a insurgency begins would the behaviors of the population be altered? I think it would be interesting to consider this because from my knowledge it would seem that insurgencies would perpetuate themselves. 

Alan Isaac

unread,
Jun 15, 2014, 9:46:02 AM6/15/14
to au-ec...@googlegroups.com
Extremism as Social Contagion

Kevin and Adin may be particularly interested in this:

Adin Dobkin

unread,
Jun 18, 2014, 8:09:32 PM6/18/14
to au-ec...@googlegroups.com
Natalie,

I think for this (relatively) limited example, I will focus on the behaviors of individuals changing over time.  Eventually, I think a greater weight should be placed upon the interactions of groups, and how they affect individuals and vice versa, but I feel like I would get bogged down with too many variables in that case.

Adin Dobkin

unread,
Jun 18, 2014, 8:15:09 PM6/18/14
to au-ec...@googlegroups.com
The use of 'digital traces' is a particularly interesting one in recent years, although I didn't know as much work on the academic side of things was occurring in regards to it.  The question of violent v. non-violent protesters was also asked of me recently -- I'll certainly admit that the line is far often less distinct than I'm making it in my project.  Another add-on might be some type of continuous variable rather than discrete.  

Alan Isaac

unread,
Jun 19, 2014, 8:37:57 AM6/19/14
to au-ec...@googlegroups.com
Digital Traces

If you include "big data" in your understanding of "digital traces", the economists have been at the forefront.  E.g.,
http://people.ischool.berkeley.edu/~hal/Papers/2013/ml.pdf

Adin Dobkin

unread,
Jun 19, 2014, 6:28:30 PM6/19/14
to au-ec...@googlegroups.com
Interesting, I also just finished reading a book on political campaign data that talks about this sort of thing for targeting.  The social media 'traces' seem particularly interesting, especially with something that appears so qualitative (like activism)

Adin Dobkin

unread,
Jun 20, 2014, 1:51:05 PM6/20/14
to au-ec...@googlegroups.com
As a large part of my model relies on turtle-turtle interaction, I have naturally been interested in that section of the textbook to try and figure out the best manner of coding these parts.  I was wondering if anyone has found additional resources specific to turtle interactions that might prove to be useful.

I also noticed some discussion on direct v. mediated interactions.  Not sure that it's entirely applicable for my simulation, but I was interested to see it in practice if anyone had insight on that.

Alan Isaac

unread,
Jun 20, 2014, 2:41:53 PM6/20/14
to au-ec...@googlegroups.com
If you give a specific example of what you are trying to do, we might be able to help.  Vague queries do not allow us to help you.  Also, when you put your code in the repository (today please!), we can look at it and comment even more concretely.

So, what interaction are you trying to implement? (Be specific!)

Alan Isaac

Alan Isaac

unread,
Jun 20, 2014, 2:51:37 PM6/20/14
to au-ec...@googlegroups.com
Your last assignments and the required reading in Epstein and Axtell include examples of mediated interaction.  In the assignment, turtles extract a resource from patches; this affects the amount of resource that is available to others.  An even clearer example of mediated interaction is the "tragedy of the commons".


On Friday, June 20, 2014 1:51:05 PM UTC-4, Adin Dobkin wrote:

Adin Dobkin

unread,
Jun 22, 2014, 11:36:00 AM6/22/14
to au-ec...@googlegroups.com
I see - didn't realize that patches could be a mediator as well (for some reason, naturally assumed that it must be observer-based).

I've also come up with another problem while in the final stages of debugging my simulation.  I'll try to use a specific example here with the hope of greater clarity:

I coded the interactions such that the initiating agent (for this example a soldier) checks to see whether each type of breed is on the same patch.  If a specific breed is on this same patch, it then asks whether a random-float number no greater than it's kill percentage >= the count of that breed on the patch.  If it is, it asks n-of a random-float of that number of breed to die.

What I've found is that sometimes, two breeds that can both kill off a certain type of agents will occupy the same patch.  Depending on how it is computed, the initiating agent can enter into that function under the assumption of a certain number of agents there, but then get stuck if they're killed off by another agent before they exit the loop.

My question is whether there is any way to prevent this, other than minimizing the number of agents in the simulation.  I'm not sure if a double-check once in the loop is necessary, or whether there's some way to exit mid-loop if the conditions change.  Has anyone else encountered something like this problem?

Alan Isaac

unread,
Jun 22, 2014, 1:17:36 PM6/22/14
to au-ec...@googlegroups.com
Debugging

Procedures do not work the way you describe.  When you enter a procedure, that procedure retains control until it reaches end.  So the situation you describe cannot arise in the way you describe.  You must be breaking the process of deciding how many to kill and killing them into multiple procedures (or separate ask commands).  In which case the answer is: don't do that.

You will find it much easier to get help debugging if your code is in the repository.  This is one of the purposes of committing it, and it is one of the reasons this is required for Econ 650 students.  Even though you are in Econ 450, I urge you to commit your code now!  This is very simple, and you can request help from the class on this list if you run into problems.

Kevin Carrig

unread,
Jun 23, 2014, 10:40:56 AM6/23/14
to au-ec...@googlegroups.com
A quick question on a Python-based Gridworld simulation. In my model, we create two classes of agents (we'll call these Agent01 and Agent02), both of which are redefined as classes that override the Agent method imported from the Gridworld module. For the Agent01 class, I want to create a function that asks, at each iteration, if a certain attribute of the agent falls above a specified threshold (parameter). When this condition is met, I would like for this agent to change its class from Agent01 to Agent02. This function must also include a deduction from the number of Agent01 parameter and an addition to the Agent02 parameter. How exactly I should reference the Agent02 class in this function, I'm not very sure. Is there some uniform method for referencing a secondary agent class in an initial agent class?

Alan Isaac

unread,
Jun 23, 2014, 11:04:19 AM6/23/14
to au-ec...@googlegroups.com
gridworld question

Hi Kevin.  First of all, you forgot to commit your code, so I cannot look at it.  Please commit it so the discussion can be more informed.

Object cannot change classes.  If you think you want this, you may want to be using roles. If each agent can only have a single role, this can be pretty simple.
E.g., See below.

Alan Isaac

class Role01(object):
 
def respond(self):
   
return "attack"

class Role02(object):
 
def respond(self):
   
return "run away"

class MyAgent(Agent):
 
def initialize(self, role):
   
self.role = role
 
def respond(self):
    response
= self.role.respond()
   
if response == "attack": do_something()
   
elif response == "run away": do_something_else()
   
else: raise ValueError ("unrecognized response")


Kevin Carrig

unread,
Jun 23, 2014, 11:08:57 AM6/23/14
to au-ec...@googlegroups.com
Great- exactly what I needed. Code was committed this morning as final_project_code.py at the following link: https://subversion.american.edu/svn/econ450650e2014/trunk/kevincarrig/  
Please let me know if this is not accessible on your end and I will recommit.

Alan Isaac

unread,
Jun 23, 2014, 11:37:44 AM6/23/14
to au-ec...@googlegroups.com
I see it.  Thanks.
Alan Isaac

Kevin Carrig

unread,
Jun 24, 2014, 11:08:33 AM6/24/14
to au-ec...@googlegroups.com
In my model, I have two classes of agents- one of which is stationary at a randomized location on the grid, and the other moves randomly through the grid at each iteration. Is there a way to introduce some tracker for each cell that records the time and magnitude of the visits by the dynamic agents?

More specially, I want to initiate some group of statements that say: if a cell has not been visited for X consecutive iterations by the dynamic,moving terrorist agent, take the attribute value of all civilian agents in that cell and return them to the initial attribute value they are assigned at the onset of the model. 



 

Alan Isaac

unread,
Jun 24, 2014, 12:47:24 PM6/24/14
to au-ec...@googlegroups.com
gridworld agent list

In principle you could override the register_agent and unregister_agent Patch methods to help accomplish this.  I am going to suggest a simpler way.

Add a last_visited attribute to each patch.  Modify the move method of your terrorist agents to reset the value of last_visited to the current iteration.  Each iteration you can then test the last_visited attribute of all your patches. If enough time has lapsed for a patch, you can get the agents there with the get_agents method and change them how you wish.

Alan Isaac

unread,
Jul 7, 2014, 2:14:29 PM7/7/14
to au-ec...@googlegroups.com
A student wrote me with an interest in reading the other papers produced for this class.  I like the idea that papers would be shared with the class.  If you are willing to share your paper with others, please post in this (Project Topics) thread.  You can attach your paper or better yet post a link to it.  (You can provide a link by first uploading the paper to a service like Google Drive or DropBox.)

Thanks!
Alan Isaac

Amanda Saville

unread,
Jul 10, 2014, 2:51:20 AM7/10/14
to au-ec...@googlegroups.com
Hi all,

I would be happy for some of you to read my paper, and the link is below.  I am even more interested in reading some of yours, so I hope that you are willing to post!

Sometimes Dropbox doesn't work so well for me on my computer, and as I am currently in Azerbaijan I am just going to hope it will for you--I know it works for me if I download the document.


Hope you are all having a great summer!

Amanda
Reply all
Reply to author
Forward
0 new messages