IDEAS home Printed from https://ideas.repec.org/p/boc/dsug19/04.html
   My bibliography  Save this paper

Agent based models in Mata

Author

Listed:
  • Maarten Buis

    (Universität Konstanz)

Abstract

An Agent Based Model (ABM) is a simulation in which agents that each follow simple rules interact with one another and thus produce an often surprising outcome at the macro level. The purpose of an ABM is to explore mechanisms through which actions of the individual agents add up to a macro outcome by varying the rules that agents have to follow or varying with whom the agent can interact (for example, varying the network). A simple example of an ABM is Schelling's segregation model, in which he showed that one does not need racists to produce segregated neighborhoods. The model starts with 25 red and 25 blue agents, each of which live in a cell of a chessboard. They can have up to 8 neighbors. In order for an agent to be happy, they need to have some, e.g. 30%, agents in the neighborhood of the same color. If the agent is unhappy, they will move to another empty cell that will make them happy. If we repeat this until everybody is happy or nobody can move, we will often end up with segregated neighborhoods. Implementing a new ABM will always require programming, but a lot of the tasks will be similar across ABMs. For example, in many ABMs the agents live on a square grid (like a chessboard), and can only interact with their neighbors. I have created a set of Mata functions that will do those tasks, and someone can also import their own ABM. In this presentation, I will illustrate how to build an ABM in Mata with these functions.

Suggested Citation

  • Maarten Buis, 2019. "Agent based models in Mata," German Stata Users' Group Meetings 2019 04, Stata Users Group.
  • Handle: RePEc:boc:dsug19:04
    as

    Download full text from publisher

    File URL: http://repec.org/dsug2019/germany19_buis.zip
    File Function: presentation materials
    Download Restriction: no
    ---><---

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:dsug19:04. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/stataea.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.