Reanimating Networks with Agent Modeling

I’m presenting next week at the Society for American Archaeology Annual Meeting. I’m giving two papers. One argues for parsimonious models when we do agent based modeling.  The other reverses the flow of archaeological network analysis and instead of finding nets in the archaeology, I use agent based models to generate networks that help me understand the archaeology. (The session is ‘Connected Past’.) Here is the draft of my talk, with all the usual caveats that that entails. Parts of it have been drawn from an unpublished piece that discusses this methodology and the results in much greater detail. It will appear…. eventually.

Scott Weingart has been an enormous help in all of this. You should follow his work. 

My interests lie in the social networks surrounding primary resource extraction in the Roman world. The Roman epigraphy of stamped brick easily lends itself to network analysis. One string together, like pearls, individual landowners, estate names, individual brick makers, signa, brick fabrics, and locations. This leads to very complicated, multi-dimensional networks.

When I first started working with this material, I reduced this complexity by looking only at the humans, whom I tied together based on appearing in the same stamp type together. I called these ‘producer’ networks. I then looked at the ties implied by the shared use of fabrics, or the co-location of brick stamp types at various findspots, and called these ‘manufacturing’ networks.

I then sliced these networks up by reigning dynasty, and developed a story to account for their changing shapes over time.

This was in the late 1990s, and in terms of network theorists I had largely only Granovetter, Hanneman & Riddle, and Strogatz & Watts to go on. The story I told was little more than a just-so story, like how the Camel got its Hump.

I had the shape, I had points where I could hang the story, but I couldn’t account for how I got from the shape of the network in the Julio-Claudian period, to that of the Flavian, to that of the Antonines. I’ve done a lot of work on networks since then; now I want to know what generates these networks that we see archaeologically, in the first place.

In this talk today, I want to reverse the direction of my inquiry. We are all agreed that we can find networks in our archaeological materials. The problem, I think, for us, is to explain the network processes that produce these patterns, and then to use our understanding of those processes to narrow down the possible entangled human & thing interactions that could give rise to these possible processes.

We need to be able to understand the possible behaviour-spaces that could produce the networks we see, to tease out the inevitable from the contingent. We need to be able to rigorously explore the emergent or unintended consequences of the stories we tell. The only way I know how to do that systematically, is to encode those stories as computer code, to turn them from normal, archaeological storytelling rhetoric, to computational procedural rhetoric.

So this is what we did.

One story we tell about the Roman world, that might be useful for understanding things like the exploitation of land for building materials, is that its social economy functioned like a ‘bazaar’.

According to Peter Bang, the Roman economic system is best understood as a complex, agrarian tributary empire, of a kind similar to the Ottoman or Mughal (Bang 2006; 2008).  Bang (2006: 72-9) draws attention to the concept of the bazaar. The bazaar was a complete social system that incorporated the small peddler with larger merchants, long distance trade, with a smearing of categories of role and scale. The bazaar emerged from the interplay of instability and fragmentation. The mechanisms developed to cope with these reproduced that same instability and fragmentation. Bang identifies four key mechanisms that did this: small parcels of capital (to combat risk, cf Skydsgaard 1976); little homogenization of products (agricultural output and quality varied year by year, and region by region as Pliny discusses in Naturalis Historia 12 and 18); opportunism; and social networks (80-4). As Bang demonstrates, these characteristics correspond well with the archaeology of the Roman economy and the picture we know from legal and other text.

Bang’s model of the bazaar (2008; 2006), and the role of social networks within that model, can be simulated computationally. What follows is a speculative attempt to do so, and should be couched in all appropriate caveats and warnings. The model simulates the extraction of various natural resources, where social connections may emerge between individuals as a consequence of the interplay of the environment, transaction costs, and the agent’s knowledge of the world. If the networks generated from the computational simulation of our models for the ancient economy correspond to those we see in the ancient evidence , we have a powerful tool for exploring antiquity, for playing with different ideas about how the ancient world worked (cf. Dibble 2006). Computation might be able to bridge our models and our evidence. In particular, I mean, ‘agent based modeling’.

Agent based modelling is an approach to simulation that focuses on the individual. In an agent based model, the agents or individuals are autonomous computing objects. They are their own programmes. They are allowed to interact within an environment (which frequently represents some real-world physical environment). Every agent has the same suite of variables but each agent’s individual combination of variables is unique (if it was a simulation of an ice-hockey game, every agent would have a ‘speed’ variable, and an ‘ability’ variable, and so the nature of every game would be unique). Agents can be aware of each other and the state of the world (or their location within it), depending on the needs of the simulation. It is a tool to simulate how we believe a particular phenomenon worked in the past. When we simulate, we are interrogating our own understandings and beliefs.

The model imagines a ‘world’ (‘gameboard’ would not be an inappropriate term) in which help is necessary to find and consume resources. The agents do not know when or where resources will appear or become exhausted. By accumulating resources, and ‘investing’ in improvements to make extraction easier, agents can accrue prestige. When agents get into ‘trouble’ (they run out of resources) they can examine their local area and become a ‘client’ of someone with more prestige than themselves.  It is an exceedingly simple simulation, and a necessary simplification of Bang’s ‘Bazaar’ model, but one that captures the essence and exhibits subtle complexity in its results. The resulting networks can be imported into social network analysis software like Gephi.

It is always better to start with a simple simulation, even at the expense of fidelity to the phenomenon under consideration, on the grounds that it is easier to understand and interpret outputs. A simple model can always be made more complex when we understand what it is doing and why; a complex model is rather the inverse, its outcomes difficult to isolate and understand.

A criticism of computational simulation is that one only gets out of it what one puts in; that its results are tautological. This is to misunderstand what an agent based simulation does.  In the model developed here, I put no information into the model about the ‘real world’, the archaeological information against which I measure the results. The model is meant to simulate my understanding of key elements of Bang’s formulation of the ‘Imperial Bazaar’. We measure whether or not this formulation is useful by matching its results against archaeological information which was never incorporated into the agents’ rules, procedures, or starting points. I never pre-specify the shape of the social networks that the agents will employ; rather, I allow them to generate their own social networks which I then measure against those known from archaeology. In this way, I start with the dynamic to produce static snapshots.

We sweep the ‘parameter space’ to understand how the simulation behaves; ie, the simulation is set to run multiple times with different variable settings. In this case, there are only two agent variables that we are interested in (having already pre-set the environment to reflect different kinds of resources), ‘transaction costs’ and ‘knowledge of the world’. Because we are ultimately interested in comparing the social networks produced by the model against a known network, the number of agents is set at 235, a number that reflects the networks known from archaeometric and epigraphic analysis of the South Etruria Collection of stamped Roman bricks (Graham 2006a).

What is particularly exciting about this kind of approach, to my mind, is that if you disagree with it, with my assumptions, with my encoded representation of how we as archaeologists believed the ancient world to have worked, you can simply download the code, make your own changes, and see for yourself. If you are presented with the results of a simulation that you cannot open the hood and examine its inner workings for yourself, you have no reason to believe those findings. Thus agent based modeling plays into open access issues as well.

So let us consider then some of the results of this model, this computational petri dish for generating social networks.For my archaeological networks, I looked at clustering coefficient and average path length as indicator metrics, (key elements of Watts’ small world formulation).  We can tentatively identify a small-world then as one with a short average path length and a strong clustering coefficient, compared to a randomly connected network with the same number of actors and connections. Watts suggests that a small-world exists when the path lengths are similar but the clustering coefficient is an order of magnitude greater than in the equivalent random network (Watts 1999: 114).

In Roman economic history, discussions of the degree of market integration within and across the regions of the Empire could usefully be recast as a discussion of small-worlds. If small-worlds could be identified in the archaeology (or emerge as a consequence of a simulation of the economy), then we would have a powerful tool for exploring flows of power, information, and materials. Perhaps Rome’s structural growth – or lack thereof – could be understood in terms of the degree to which the imperial economy resembles a small-world (cf the papers in Manning and Morris 2005)?

The networks generated from the study of brick stamps are of course a proxy indicator at best. Not everyone (presumably) who made brick stamped it. That said, there are some combinations of settings that produce results broadly similar to those observed in stamp networks, in terms of their internal structure and the average path length between any two agents.

One such mimics a world where transaction costs are significant (but not prohibitive), and knowledge of the world is limited . The clustering coefficient and average path length observed for stamped bricks during the second century fall within the range of results for multiple runs with these settings. In the simulation, the rate at which individuals linked together into a network suggests that there was a constant demand for help and support. The world described by the model doesn’t sound quite like the world of the second century, the height of Rome’s power, that we think we know, suggesting something isn’t quite right, in either the model or our understandings. But how much of the world did brickmakers actually know, remembering that ‘knowledge of the world’ in the model is here limited to the location of new resources to exploit?

Agent based modeling also allow us to explore the consequences of things that didn’t happen. There were a number of simulated worlds that did not produce any clustering at all (and very little social network growth). Most of those runs occurred when the resource being simulated was coppiced woodland. This would suggest that the nature of the resource is such that social networks do not need to emerge to any great degree (for the most part, they are all dyadic pairs, as small groups of agents exploit the same patch of land over and over again). The implication is that some kinds of resources do not need to be tied into social networks to any great degree in order for them to be exploited successfully (these were also some of the longest model runs, another indicator of stability).

What are some of the implications of computationally searching for the networks characteristic of the Roman economy-as-bazaar? If, despite its flaws, this model correctly encapsulates something of the way the Roman economy worked, we have an idea of, and the ability to explore, some of the circumstances that promoted economic stability. It depends on the nature of the resource and the interplay with the degree of transaction costs and the agents’ knowledge of the world. In some situations, ‘patronage’ (as instantiated in the model) serves as a system for enabling continual extraction; in other situations, patronage does not seem to be a factor.

However, with that said, none of the model runs produced networks that had the classical signals of a small-world. This is rather interesting. If we have correctly modeled the way patronage works in the Roman world, and patronage is the key to understanding Rome (cf Verboven 2002), we should have expected that small-worlds would naturally emerge. This suggests that something is missing from the model – or our thinking about patronage is incorrect. We can begin to explore the conundrum by examining the argument made in the code of the simulation, especially in the way agents search for patrons. In the model, it is a local search. There is no way of creating those occasionally long-distance ties. We had initially imagined that the differences in the individual agents’ ‘vision’ would allow some agents to have a greater ability to know more about the world and thus choose from a wider range. In practice, those with greater ‘vision’ were able to find the best patches of resources, indeed, the variability in the distribution of resources allowed these individuals to squat on what was locally best. My ‘competition’ and prestige mechanisms seem to have promoted a kind of path dependence. Perhaps we should have instead included something like a ‘salutatio’, a way for the agents to assess patrons’ fitness or change patrons (cf Graham 2009; Garnsey and Woolf 1989: 154; Drummond 1989: 101; Wallace-Hadrill 1989b: 72-3). Even when models fail, their failures still throw useful light. This failure of my model suggests that we should focus on markets and fairs as not just economic mechanisms, but as social mechanisms that allow individuals to make the long distance links. A subsequent iteration of the model will include just this.

This model will come into its own once there is more and better network data drawn from archaeological, epigraphic, historical sources. This will allow the refining of both the set-up of the model and comparanda for the results. The model presented here is a very simple model, with obvious faults and limitations. Nevertheless, it does have the virtue of forcing us to think about how patronage, resource extraction, and social networks intersected in the Roman economy. It produces output that can be directly measured against archaeological data, unlike most models of the Roman economy. When one finds fault with the model (since every model is a simplification), and with the assumptions coded therein, he or she is invited to download the model and to modify it to better reflect his or her understandings. In this way, we develop a laboratory, a petri-dish, to test our beliefs about the Roman economy. We offer this model in that spirit.

[edited April 4th to make it less clumsy, and to fit in the 15 minute time frame]

 

Simulation as Deformation, or, the Role of Agent Based Modeling in Historical Archaeology

I’ll be at the Society for American Archaeology Annual Meeting next week, presenting in a session on  ‘modeling dynamics in coupled social-natural systems’, and in another on network methods for archaeology. For me, these two approaches are hard to tease apart. Below you’ll find my draft for the modeling session.

Over ten years ago, J.P. Marney and Heather Tarbert published a paper in the journal of artificial societies and social simulation called, ‘Why do simulation? Towards a working epistemology for practitioners of the dark arts’.

Today, we’re discussing the potential of modeling for exploring human-environmental interactions in a wide variety of contexts, across an enormous span of time. We’re thinking about society and ecosystems as highly complex systems, where material, energy, and information flows through massively interconnected positive and negative feedback loops.

A dark art, indeed.

Coming to simulation from a background in the humanities – especially Roman archaeology and ancient history – means that my work is oftentimes viewed askance. There are very deep reasons for this, beyond the usual caricatures of ‘social science vs humanities’. There’s a deep history in Western culture surrounding the ways we try to know the future. I generalize horribly, but it seems to me to come down to the difference between the priest and the magician in Greco-Roman society. The priest examines the entrails, watches the flight of birds, performs the rituals correctly, and is rewarded with some glimpse into divine will. The magician, on the other hand, compels the spirits to visit her, through spells and carefully guarded craft, and wrests the certain knowledge of what is to come by dint of her own skill. The priest is ‘fas’, whereas the magician is ‘nefas’, the root of our word ‘nefarious’, meaning contrary to divine law. So too the simulationist.

In the humanities, when we are concerned about the human past, we read the texts closely, we follow our rituals correctly, and we are rewarded with a story about history; in simulation, our skill enables us to raise the dead, putting them through their paces, and we are rewarded with not just one history, but an entire landscape of possible histories.

Indeed, when I talk to humanists about simulation, I sometimes call it ‘practical necromancy’ for this very reason. Classicists don’t generally like what I do, although ancient historians are sometimes ok with it, and archaeologists (non Roman archaeologists) usually just smile and nod and say, ‘yes, so what?’

I have been creating simulations of various aspects of Greco-Roman antiquity for a while now. What I’d like to speak about to you today, is the degree to which these simulations have found traction amongst ancient historians, and what I’ve learned about how to incorporate agent based modeling into the exploration of a historical society like that of the ancient Mediterranean.

The first issue is that there is a sense that it is not at all needed. ‘Agent modeling might be useful for those non-literate societies, but we’ve got more than enough materials to work on here, Shawn’ is the gist of a conversation I once had with a distinguished Romanist. In Marney and Tarbert’s piece, they argue that simulation is perhaps the only way of addressing situations:

  1. Where there are complex emergent global processes and dynamics from simple local behaviour.
  2. Where coordinated global outcomes are generated by the heterogeneous local decision rules. [amongst others]

…which describes Rome pretty nicely. Or human culture more generally.

The next criticism that my distinguished Romanist colleague raised was that my models – any computational model – was simply tautological, that we only get out what we get in. This is such a weary chestnut to deal with, and perhaps folks in this room don’t need reminding of it, for it fundamentally mis-understands a significant characteristic of complex systems – that the dynamics of one level of organization do not lead linearly or necessarily imply the dynamics of another level. Hence if we are interested in culture, we model at the level of an individual. Thus what comes out of the model is the emergent byproduct of countless individual interactions. What comes out is definitely not what went in.

More Roman historians and archaeologists need to be reading the literature of complex systems studies, I think.

A final issue is about what, exactly, we are modeling. Are we really raising the dead, and simulating the past? No, we are not. We are actually creating zombies. Normally, creating zombies never ends well, but as long as they don’t escape from our computers, all should be ok.

I call these autonomous software agents ‘zombies’ for the very good reason that I need to clearly specify what it is I believe about some phenomenon in the past in order for them to perform that behaviour. What I end up simulating then is not the past, but the story I am telling about the past. This lets me escape nearly all of the criticisms that my colleagues in the humanities raise about this dark art of simulation.

If I am simulating in effect a historiography, then the results, the landscape of possible emergent outcomes, are the consequences of that story I am telling about the past. Simulation becomes a way for me to explore the unintended outcomes about my beliefs about the past. I perform the past; I deform it.

The method forces me to become clear about what it is I believe about the past in an utterly transparent way. If I cannot encode those beliefs, then clearly I need to think more deeply. I use Netlogo for my agent modeling for a couple of reasons. One, its near-english syntax makes it easier for me to develop simulations.  It also makes it possible for my colleagues to examine the procedural rhetoric of my simulation as well. A simulation is not complete until somebody else opens the hood and examines your code for your mistakes, your assumptions, and for the rhetorics hidden therein. I often tell my students that unless they can look at the code for themselves, they have no reason to believe the results of a simulation. My students are history students, without any great affinity for computing – but with a bit of help, they can easily flow-chart a Netlogo simulation to get a sense of what is going on.

(This, incidentally, is what excites me about the movement towards data-as-publication. I am beginning to put all of my models on Figshare to allow this kind of examination.)

The end result then is that I have found that I have to keep my models as tightly focused as possible. If my model becomes too ambitious, I typically have had two problems. One, it becomes difficult for me to tell the story of what is going on in my model, to tease apart the critical interactions that are producing the landscape of possibilities that have emerged. Two, there is little engagement with my code by those who could best critique it, as it becomes seemingly too complex.

Let me give you an example. In my PhD research, I became interested in the social networks surrounding landholding in the immediate vicinity of Rome during the first three centuries AD. I did some network analysis of this data (stitched together from the epigraphy of stamped bricks), but I wanted to reanimate these patterns. There are many episodes in Roman history of elite self-extermination, as different factions vying for power eliminate rivals through murder, forced suicide, or exile. How much disruption could these networks endure?  Thus, I became interested in the sources of civil violence in the Roman world.

I created a simulation where a population of agents were interlinked in the patterns suggested from the archaeology. Over this network would flow prestige, gifts, and money as the agents vied for status, drawing on the literature connected with the Roman tradition of the ‘salutatio’, or morning greeting given by a client to his patron(s). No patron has to accept a client who is not suitably prestigious, no one gains prestige without clients, thus shutting individuals out of the networks: the source for civil violence in the Roman world, I argued.

I was able to put these agents in a world where the economy ranged from one where everything was roses, to one where everything was sackclothes and ashes; I imagined that there would be no violence in the rose-world, and lots of violence in the sackclothes-world. And yes, this is duly what I saw, but there were interesting, non-predicted bouts of violence where there should be peace, and peace where there should be violence.

Teasing all of this apart became the subject of a journal article – a very long, tedious, article. Google scholar tells me that this article has had precisely zero impact. And I’m quite certain that no one has engaged with the code.

Another model I created has had quite a different trajectory. In this model, I simulate a very excruciatingly simple mechanic representing the contentious process of ‘Romanization’. In my model, which is based on an even simpler model of disease transmission, an agent is ‘non-romanized’ until they run into an agent who has become ‘romanized’. Poof, the agent now becomes Romanized. Zombies indeed. (And of course, there are models of zombie infection too! Now we’re just getting recursive).

The key element here was that the agents were not wandering around in an amorphous space. Rather, they were constrained to move along the paths suggested by the third century Antonine Itineraries, the lists of towns one would use in order to figure out how to get from point A, to point B. To get to Honolulu from Ottawa, go to Toronto, Winnipeg, Calgary, Vancouver, Seattle, Honolulu.

Thus, I was interested in exploring the consequences of this list-like, networked conception of geographic space. I could measure the amount of model time it took for everyone in the model to become ‘Romanized’ as they moved over the network of Roman Spain, versus Roman Britain, versus Roman Gaul, versus Roman Italy. I graphed these results, and the shape of this diffusionist model implied something about the way ideas of Romanness would penetrate, and how deeply, in these different regions. Thus the model then became a guide for looking at the archaeology in a new way.

This model, according to Google Scholar, has had much much more traction. Even better, the code has been queried, taken apart, and made better, being used in both teaching contexts, and in others’ research.

Smaller, more constrained models, can have bigger impact, I think – at least in the humanities.

This use of agent based simulation fits into a kind of experimental archaeology mindset, of building as a way of knowing – indeed, it also puts it in the developing traditions of the digital humanities. Trevor Owens, a digital archivist with the Library of Congress, recently blogged about the mutual incomprehension of computer scientists and humanists, and it’s worth quoting him in full:

“[…]I don’t think the issue here is different ways of knowing, incompatible paradigms, or anything big and lofty like that. I think the issue at the heart of this back and forth dialog is about two different contexts. This is about what you can do in the generative context of discovery vs. what you get can do in the context of justifying a set of claims.”

What Owens argues is that, in the humanities, computational approaches are best suited for ‘the generative world of discovery’. He continues:  “If you aren’t using the results of a digital tool as evidence then anything goes. More specifically, if you aren’t trying to attribute particular inferential value to a particular process that process is simply producing another artifact which you can then go about considering, exploring, probing and analyzing.  I take this to be one of the key values of the idea of “deformance.” The results of a particular computational or statistical tool don’t need to be treated as facts, but instead can be used as part of an ongoing exploration.”

Because we are not simulating the past, but rather instantiating what we believe to be true about the past in a computer model, my sense is that agent modeling will take off in archaeology when it ceases to be about the context of trying to justify our stories about the past, but rather for generating new stories, new ways of looking at our evidence about the past. And the models need to be small-ish, digestible, and not needing a team of researchers to explore (to build, well, that’s another matter I suppose).

So here are two new models I am working on, to put my money where my mouth is.

I’ve recently been reading Ian Hodder’s ‘Entangled: An archaeology of the Relationships between Humans and Things’. In the book, Hodder develops an argument for looking at things not just as if they had agency, but rather all tangled up in making humans human. He then offers up, by way of a methodological approached to this entangled perspective, a ‘tanglegram’, where all of the dependences and dependencies between humans and things at Catalhoyuk are mapped. He goes on to talk about flows of information or energy through these entanglements.

This to me seems to be a prime candidate for the kind of simulation that I do. If we can tie material culture, place, and humans together in this kind of tanglegram, what are the implications for energy flow? What are the emergent consequences? I begin by turning his figure 9.2 into a network diagram. I use a code snippet from Netlogo to import this same information into Netlogo, transforming the nodes into active agents connected by active links.

Because of the modularity of Netlogo, I don’t necessarily have to begin from scratch to explore the dynamics of this entanglement. Instead, I turned to my old friend, the virus-on-a-network, and gave it the tanglegram to run on.

The question becomes, well, so what? What does this prove? Right now, I’m working on that. On first blush, there seems to be a behaviour space where this tanglegram, this entangled pattern of things and humans, leads to extreme stability over most parameters (ie, ‘life’ continues), and a small window that leads to paralysis (ie, the ‘life’ of the model stops). That perhaps could be the beginning of a conversation where we look at entanglements at other times and places, modeling their dynamics, coming up with a comparative study of what patterns lead to change and transformation.

In my other model, my zombies represent amphorae type. Here, I’m interested in why different kinds of amphorae styles in the Aegean converge – and why some types are always unique. In this model, I have a population of amphorae which are all different. There are humans who flit into this world, and throw away the amphorae that (for whatever reason) are undesireable. Amphorae reproduce, with a certain amount of mutation. Over time, and without centralized direction, there is a convergence of different amphorae types (having different origins, different clays) to share the same outward stylistic characteristics.

This model is still undeveloped; it tells a story of stylistic evolution where it is the amphorae themselves that do the evolving. The stories we often tell, when it comes to pottery styles (and perhaps this is more of a problem in the classical world than elsewhere; I do not know), often seem to me to be a kind of just-so story, of how the camel got its hump. Whether or not you agree with the story I tell in this model, one can at least see how it works, and change the code to tell a better story, using the emergent results to generate a new perspective.

To conclude, then, I think you’ll all agree that we can find archaeological patterns and reanimate some kind of dynamic on those patterns.

But what I’m trying to suggest to you today, is that we need to resist building extremely complex models on top of those archaeological patterns. There’s lots of low-hanging fruit around, when it comes to agent based models. Small models, tightly focussed models, allow us to iterate quickly, to develop quickly, and to use multiple lines of attack on various problems.

If we want buy-in from our other colleagues interested in the human past – whether historians, historical archaeologists, classicists, or ancient historians – then the models have to be immediately digestible, and we have to acknowledge that we use these as generative, as a way of ‘deforming’ our perspectives and our own beliefs about the past, to develop new perspectives and insights.

[edited April 2 to reduce redundancies, fix awkwardness, and to fit it into the 15 minute time slot allotted to me. 300 words removed.]