Topic Modeling an archaeological database: today’s adventures
If you follow me on twitter, and saw a number of bizarre/cryptic tweets today, I was live tweeting my work stream. This is what I did today – think of this as stream of consciousness over the last five hours.
- imported portable antiquities scheme database into access so I could work with it.
- queried it, selecting just those columns I was interested in
- exported back to csv
- cleaned up the data by removing ‘=’ signs (circular reference error in excel), names of liason officers, meta notes from PAS on the quality of the record, and indications that the record was sourced from the work of Guest and Wells (nb, not any citations to them). also celtic coins index note.
- run a simple defaults topic model to get a sense of what words I need to add to a custom stopwords list.
- 552438 rows (id numbers run to 548561, so I must have lost some).
it occurs to me that I should have left the names of the liason officers in, in case they get associated with a particular topic. d’oh.
bin\mallet import-file –input pasnebraska/everything.csv –output paseverything.mallet –keep-sequence –token-regex ‘[\p{L}\p{M}\p{N}]+’ –remove-stopwords
bin\mallet train-topics –input paseverything.mallet –num-topics 50 –optimize-interval 20 –output-state topic-state.gz –output-topic-keys everything_keys.txt –output-doc-topics everything_composition.txt
- then run this? http://article.gmane.org/gmane.comp.ai.mallet.devel/1483/ yes, as per options suggested by @mwidner on twitter on may 14.
- I think these results will be more useful than the previous ones. Although I believe I forgot to optimize-interval. Yes, I did.
so, running this:
bin\mallet run cc.mallet.topics.tui.TopicTrainer –input paseverything.mallet –num-topics 50 –optimize-interval 20 –diagnostics-file everythingdiagnostics.xml –output-topic-keys everythingdiag_keys.txt –output-doc-topics everythingdiag_topics.txt –xml-topic-pharse-report everythingdiag_phrase.txt –xml-topic-report everythingdiag_topicreport.xml –topic-word-weights-file everythingdiag_word_weights.txt –word-topic-counts-file everythingdiag_word_counts.txt –output-state output-state.gz
looking at the results, it looks like the first two columns, first three? were taken to be labels. shite.
- reformat csv so that I have an id, and a text, per row.
- found formula to combine all columns into a single column. but blank rows are buggering things up:
=stoneage!B1&” “&stoneage!C1&stoneage!D1&” “&stoneage!E1&” “&stoneage!F1&” “&stoneage!G1&stoneage!H1&” “&stoneage!I1&” “&stoneage!J1&” “&stoneage!K1&stoneage!L1&” “&stoneage!M1&” “&stoneage!N1&” “&stoneage!O1&stoneage!P1&” “&stoneage!Q1&” “&stoneage!R1&” “&stoneage!S1&stoneage!T1&” “&stoneage!U1&” “&stoneage!V1&” “&stoneage!W1&stoneage!X1&” “&stoneage!Y1&” “&stoneage!Z1&” “&stoneage!AA1&stoneage!AB1&” “&stoneage!AC1
- returned to access database. gone with the april pas database (csv, download). importing selected columns, ignoring column shift. filtering out blank rows (and/or rows where everything’s colunm shifted all over the place)
- exporting by period. leaving liason officers in. too bloody awkward to deal with the entire database at once.
- put all the columns into a single column, so now I have just two: an id number, and a ‘text’.
- imported, with regex, and diagnostics topic model,
wierd errors when running the model.
- reimporting without regex.
- rerunning with diagnostics. looks much better.
topic composition file is crazy talk.
- ok, screw diagnostics. run normal. optimization 20, topics 50, for stoneage (9680 records).
ok, still the same problem with the composition file. What the hang?
- re-running without optimization.
nope, still getting this kind of thing:
#doc name topic proportion …
“0 51″ “FLAKE 10 0.480592529670674 44 0.3208674000538096 32 0.10756601869328378
“15 422″ BLADE NEOLITHIC -4000 -2200 “Black/grey 22 0.8415325393137797 30 0.12728676320083662
So, that says to me that something weird happened in the initial import. Yet topic keys seem to make sense.
Sigh…
Wait, over on Mallet page it says,
… the first token of each line (whitespace delimited, with optional comma) becomes the instance name, the second token becomes the label, and all additional text on the line is interpreted as a sequence of word tokens.
Simple as that? So I just need a bloody extra column in there. For the love of god…
- add column. filled it with document id (again).
- reimporting. no regex.
- running the topic model with diagnostics. 50 topics, optimized interval of 20.
By god, that was it.
Almost. Something still weird with the document names. Ah, found it. A blank in the first few rows.
- reimporting. no regex.
- running the topic model with diagnostics. 50 topics, optimized interval of 20.
SUCCESS!
Now to repeat with other periods (I elided palaeo, meso, and neolithic into a separate csv file). Then to interpret what all this means.
And I think I really need to reformulate my idea of ‘document’ to not be the individual rows, but rather the districts. I could pull all that out by hand, but I really want to figure out how to make the computer do that.
Anyway, some of the ‘topics’ from today’s adventures (what are ‘topics’ anyway? what might it mean, archaeologically, to think of these as ‘discourses’?, are some questions I need to ask):
implement lithic mesolithic neolithic flint flake bc blade dating date waste possibly period atherton rachel worked core flakes circa
grey flint colour brown dark neolithic light flake mottled cortex mid white cream flakes patina pale coloured knapped translucentneolithic age bronze early flint date late scraper bc flake probable tool dating complete retouched knife made part tertiary
scraper end neolithic tool flint retouch semi edge circular thumb distal dorsal face abrupt side cortex nail thumbnail plan
core platform flint mesolithic single flakes removed cortex worked scars platforms tl pebble neolithic striking multi removals small blades
flake flint cortex rface dorsal grey retouch neolithic edge small damage face remaining scars edges brown secondary made white
bulb flake percussion platform striking end ventral rface flint proximal dorsal face neolithic scars small grey mid distal patina
side plan end profile margin left distal retouched dorsal proximal shaped flake flint convex scraper ventral snapped edge plano
mm mea length res width weighs flake flint neolithic ring wide long weighing adams kurt thick thickness west blade
section implement plan neolithic lithic triangular shaped date cross shape object oval rectangular rface sides roughly worked edge knapped
hill graham south flake west cornwall paul penwith flint sw margin cream end grey brown distal fig dorsal translucent
arrowhead neolithic leaf shaped flint tanged worked tip barbed point triangular broken early faces transverse missing oblique invasive tang
blade end distal mesolithic proximal snapped broken retouch flint ends parallel dorsal edges break incomplete missing sides damage long
Topic Modeling an Archaeological Database 2
Some things I have learned in recent days:
- data must be cleaned. Really. It’s probably still too noisy, even when you think it isn’t. Eliminate frequently occuring meta-notes (as it were). All citations to Guest & Wells on Coins in the UK, for instance, really muck things up.
- you can enter a single csv file as an input for MALLET. I knew this; but I had forgotten it, faced with a few hundred thousand rows of material (as I type this, the thought also occurs that I could run MALLET on the entire single file download I got from PAS, all ~500 000 rows. Presumably, locations and periods would sort themselves out into different topics?)
- MALLET considers letter characters to make up words. If you’ve got other stuff in there – numerals, for instance – that are significant, you’ll need to become familiar with – -token regex , which you’d use during that initial file-import. It was suggested to me to try these
– token-regex \s\d+\s
–token-regex ‘[\p{L}\p{M}\p{N}]+’
What else? Oh, that’s about all, for now. Oh, wait: custom stopwords. Instead of –remove-stopwords, you’ll want –extra-stopwords yourlist.txt . And your list has to be formatted so that there is whitespace between the words. I’m not sure if that means ‘white space’ like how you and I would figure it, or if that means ‘white space’ in some kind of crazy hidden code kind of way (like this in regex: \s (see this)). If you open one of the default stopword lists, there doesn’t look like there’s any hit-the-space-bar-kind-of white space that I’d normally assume.
Onwards!
Topic Modeling the Portable Antiquities Scheme
I got my hands on the latest build of the Portable Antiquities Scheme database. I want to topic model the items in this database, to look for patterns in the small material culture of Britain, across time and space.
The data comes in a single CSV, with approximately 500 000 individual rows. The data’s a bit messy, as a result of extra commas slipping in here and there. The names of the Finds Liaison Officers slip into a column meant to record epigraphic info from coins, for instance, from time to time. Not a big deal, over 500 000 records.
The first issue I had was that after opening the CSV file in Excel, Excel would regard all of those epigraphic conventions (the use of =, +, or [ ] and so on) as formulae. This would generate ‘circular reference’ errors. I could sort that out by inserting a ‘ at the beginning of that column. But as you can imagine, sorting through, filtering, or any kind of manipulation of a single table that large would slow things considerably – and frequently crashed this poor ol’ desktop. I tried using Open Refine to clean up the data. I suspect with a bit of time and effort I’d be able to use that product well, but yesterday all I achieved, once I imported my csv file and clicked ‘make project’, was an ‘undefined error’ (after several minutes of chugging). This morning, I turned to Access and was able to import the csv, and begin querying it, cleaning things up a bit, and so on.
So I decided to focus on the Roman records, for the time being. There are some 66 000 unique records, coming from over 80 unique districts of the UK. This leaves me with a table with the chronological range for the object, a description of the object, and some measurements. I have a script that can take each individual row, and turn it into a txt file which I can then import into MALLET. Each individual row can also include the district name.
So I’m wondering now: should I just cut and paste all of the rows for a single district into a single txt file (and thus the routine will not have the place-name in the analyzed text)? Or should I preserve the granularity, and just topic model over every record, preserving the place name? Ie, a collection of 80 txt files where there are no place names, or a collection of 66 000 txt files where every file has the place name – will they swamp the signals?
It’s too early in the morning for this kind of thinking.
Some Assembly Required: teaching through/with/about/by/because of, the Digital Humanities (slides & notes)
I’m giving a keynote address to the Canadian Network for Innovation in Education conference, at Carleton on Thursday (10.30, River Building). I’ve never done a keynote before, so I’ll confess to being a bit nervous. ‘Provoke!’ I’ve been told. ‘Inspire! Challenge!’ Well, here goes….
These are the slides and the more-or-less complete speaker’s notes. I often write things out, and then completely adlib on the day, but this is more or less the flavour I’m going for.
[Title]
I never appreciated how scary those three words were until I had kids. ‘Some assembly required’. That first Christmas was all, slide Tab A into Slot B. Where’s the 5/8ths gripley? Is that an Allen key? Why are there so many screws left over? The toys, with time, get broken, get fixed, get recombined with different play sets, are the main characters and the exotic locales for epic stories. I get a lot of mileage out of the stories my kids tell and act out with these toys.
My job is the DH guy in the history department. DH, as I see it, is a bit like the way my kids play with the imperfectly built things – it’s about making things, about breaking things, about being playful with those things. This talk is about what that kind of perspective might imply for our teaching and learning.
[2]
I don’t know what persuaded my parents that it’d be a good idea to spend $300 in 1983 dollars on a Vic20, but I’m glad they did. You turn on your ipad, it all just happens magically, whoosh! In those days, if you had a computer, you had to figure out how to make it do stuff, the hard way. A bit disappointing, that first ‘Ready’ prompt. Ready to do what? My brothers and I wanted to play games. So, we sat down to learn how to program them. If you had a vic-20, do you remember how exciting it was when that ball first bounced off the corners of your screen? A bit like the apes in the opening scene of ’2001′. At least, in our house.
[3]
‘Wargame’, film with Matthew Broderick. This scared me; but I loved the idea of being able to reach out to someone else, someone far from where I lived in Western Quebec. So we settled for occasional trips to the Commodore store in Ottawa, bootleg copies of Compute! Magazine, and my most treasured book, a ‘how to make adventure games’ manual for kids, that my Aunt purchased for me at the Ontario Science centre.
[4]
Do you remember old-school text adventures? They’re games! They promote reading! Literacy! They are a Good Thing. Let’s play a bit of this game, ‘Action Castle’, to remind us how they worked.
To play an interactive fiction is to foreground how the rules work; it’s easy to see, with IF. But that same interrogation needs to happen whenever we encounter digital media.
[5]
Games like Bioshock – a criticism of Randian philosophy. Here, the interplay between the rules and the illusion of agency are critical to making the argument work.
When you play any kind of game, or interact with any kind of medium, you generally achieve success once you begin to think like the machine. What do games teach us? How to play the game: how to think like a computer. This is a ‘cyborg’ consciousness. The ‘cyb’ in ‘Cyborg’ comes from the greek for ‘governor’ or ‘ship’s captain’. Who is doing the governing? The code. This is why humanities NEEDS to consider the digital. It’s too important to leave to the folks who are already good at thinking like machines. This is the first strand of what ‘digital humanities’ might mean.
[6]
A second strand comes from that same impulse that my brothers and I had – let’s make something! Trying to make something on the computer inevitably leads to deformation. This deformation can be on purpose, like an artist; or it can be accidental, a result of either the user’s skill or the way that the underlying code imagines the world to work.
[7]
‘Historical Friction’ is my attempt to realize a day-dream: what if the history of a place was thick enough to impede movement through it? I knew that I could find a) enough information about virtually everywhere on Wikipedia; that b) I could access this through mobile computing and c) something that often stops me in my tracks is not primarily visual but rather auditory. But I don’t have the coding chops to build something like that from scratch.
What I can do, though, is mash things together, sometimes. But when I do that, I’m beholden to design choices others have made. ‘Historical Friction’ is my first stab at this, welding someone else’s Wikipedia tool to someone else’s voice synthesizer. Let’s take a listen.
…So this second strand of DH is to deform (with its connotations of a kind of performance) different ways of knowing.
[8]
A third strand of DH comes from the reflexive use of technology. My training is in archaeology. As an archaeologist, I became Eastern Canada’s only expert in Roman Brick Stamps. Not a lot of call for that.
But I recognized that I could use this material to extract fossilized social networks, that the information in the stamps was all about connections. Once I had this social network, I began to wonder how I could reanimate it, and so I turned to simulation modeling. After much exploration, I’ve realized that what I resurrect on these social networks is NOT the past, but rather the story I am telling about the past. I simulate historiography. I create a population of zombie Romans (individual computing objects) and I give them rules of behavior that describe some phenomenon in the past that I am interested in. These rules are formulated at the level of the individual. I let the zombies go, and watch how they interact. In this way, I develop a way to interrogate the unintended or emergent consequences of the story I tell about the past: a kind of probabilistic historiography.
So DH allows me to deform my own understandings of the world; it allows me to put the stories I tell to the test.
[9]recap
There’s an awful lot of work that goes under the rubric of ‘digital humanities’. But these three strands are I think the critical ones for understanding what university teaching informed by DH might look like.
[10]
Did I mention my background was in archaeology? There’s a lot that goes under the rubric of ‘experimental’ archaeology that ties in to or is congruent with the digital humanities as well. Fundamentally, you might file it under the caption of ‘making as a way of knowing’.
[11]
Experimental archaeology has been around for decades. So too has DH (and its earlier incarnation as ‘humanities computing’) which goes back to at least the 1940s and Father Busa, who famously persuaded IBM to give him a research lab and computer scientists to help him create his concordance of the work praesans in the writings of Thomas Aquinas.
So despite the current buzz, DH is not just a fad, but rather has (comparatively) deep antecedents. The ‘Humanities’ as an organizing concept in universities has scarcely been around for much longer.
[12]
So let’s consider then what DH implies for university teaching.
[13]salt
But I feel I should warn you. My abilities to forecast the future are entirely suspect. As an undergrad, in 1994, I was asked to go on the ‘world wide web’, this new thing, and create an annotated bibliography concerning as many websites as I could that dealt with the Etruscans. The first site I found (before the days of content filters) was headlined, ‘the Sex Communist Manifesto’. Unimpressed, I wrote a screed that began, “The so-called ‘world wide web’ will never be useful for academics.”
Please do take everything I say then with a grain or two of salt.
[14]
Let me tell you about some of the things I have tried, built on these ideas of recognizing our increasingly cyborg consciousness, deformation of our materials, and of our perspectives. I’m pretty much a one-man band, so I’ve not done a lot with a lot of bells and whistles, but I have tried to foster a kind of playfulness, whether that’s role-playing, game playing, or just screwing around.
[15]epic fails
Some of this has failed horribly; and partly the failure emerged because I didn’t understand that, just like digital media, our institutions have rule sets that students are aware of; sometimes, our ‘best’ students are ‘best’ not because they have a deep understanding of the materials but rather because they have learned to play the games that our rules have created. In the game of being a student, the rules are well understood – especially in history (which is where I currently have my departmental home). Write an essay; follow certain rhetorical devices; write a midterm; write a final. Rinse. Repeat. Woe betide the prof who messes with that formula!
I once taught in a distance ed program, teaching an introduction to Roman culture class. The materials were already developed; I was little more than a glorified scantron machine. I was getting essay after essay that contained clangers along the lines of, ‘Vespasian won the civil war of AD 69, because Vespasian was later the Emperor.’ I played a lot of Civilization IV at the time, so I thought, I bet if I could get students to play out the scenario of AD69, students would understand a lot more of the contingency of the period, that Vespasian’s win was not foreordained. I crafted the scenario, built an alternative essay around it (’play the scenario, contrast the game’s history with ‘real’ history’), found students who had the game. Though many played it, they all opted to just write the original essay prompt. My failure was two-fold. One,‘playing a game for credit’ did not mesh with ‘the game of being a student’; there was no space there. Two, I created a ‘creepy treehouse’, a transgression into the student’s world where I did not belong. Profs do not play games. It’d be like inviting all my students to friend me on Facebook. It was creepy.
I tried again, in a history course last winter. The first assessment exercise – an icebreaker, really – was to play an interactive fiction that recreated some of the social aspects of moving through Roman space. The player had to find her way from Beneventum to Pompeii, without recourse to maps. What panic! What chaos! I lost a third of the class that week. Again, the concern was, ‘how does playing a game fit into the game of being a student’. Learning from the previous fiasco, I thought I’d laid a better foundation this time. Nope. The thing I neglected: there is safety in the herd. No one was willing to play as an individual and submit an individual response – ‘who wants to be a guinea pig?’ might have been the name of THIS game, as far as the students were concerned. I changed course, and we played it as a group, in class. Suddenly, it was safe.
[16]epic wins
But from failure, we learn, and we sometimes have epic wins (failures almost always are more interesting than wins). Imagine if we had a system that short-circuited the game of being a student, to allow students the freedom to fail, to try things out, and to grow! One of the major fails of my Year of the Four Emperors experiment was that it was I who did all the building. It should’ve been the students. When I built my scenario, I was doing it in public on one of the game’s community forums. I’ve since started crafting courses (or at least, trying to) where the students are continually building upwards from zero, where they do it in public, and where all of their writing and crafting is done in the open, in the context of a special group. This changes the game considerably.
[17]
To many of you, this is no doubt a coals-to-newcastle, preaching-to-the-choir kind of moment.
[18]
And again, I hear you say, what would an entire university look like, if all this was our foundation? Well, it’s starting to look a little better than it did when we first asked the question…
[19]dh will save us
…but DH has been pushed an awful lot lately. DH will save us! It’ll make the humanities ‘relevant’: to funding bodies, to government, to parents! Just sprinkle DH fairy dust, and all will be safe, right?
[19]memes & dark side
You’ve probably heard that. It’s happened enough that there’s even memes about it.
Yep. No doubt – a lot of folks are sick of hearing about ‘the digital humanities’. At the most recent MLA, there was a good deal of pushback, including a session called ‘the dark side of DH’. Wendy Chun wrote,
“For today, I want to propose that the dark side of the digital humanities is its bright side, its alleged promise: its alleged promise to save the humanities by making them and their graduates relevant, by giving their graduates technical skills that will allow them to thrive in a difficult and precarious job market. Speaking partly as a former engineer, this promise strikes me as bull: knowing GIS or basic statistics or basic scripting (or even server side scripting) is not going to make English majors competitive with engineers or CS geeks trained here or increasingly abroad […] It allows us to believe that the problem facing our students and our profession is a lack of technical savvy rather than an economic system that undermines the future of our students.”
(That’s not a DH that I recognize, by the way, as I hope you’ll have noticed given my three strands).
Now, I wasn’t at that meeting, but I saw a lot of chatter flutter by that day, as in that same session MOOCs were conflated with the digital humanities; that somehow the embrace of DH enables the proliferation of MOOCs. As Amanda French, who has coordinated an extraordinary number of digital humanities ‘THATCamp’ conferences, has said, ‘I don’t know a single digital humanist who likes MOOcs.”
We’ve heard a lot about MOOCs today, and I’m certainly in no position to critique them as I’ve never offered nor successfully finished one. But as I’ve identified the strands of DH today, there *is* an affinity though with the so-called ‘cMOOC’.
[21]Know Your MOOCs
Before there was coursera, udacity, and glorified talking heads over the internet, there was the cMOOC. The Canadian MOOC. The personal learning environment. Isn’t it interesting that Pearson, a text book publisher, is a heavy investor in the MOOC scene? Frankly, as xMOOCs are currently designed, they seem to me to be a challenge to publishers of textbooks rather than to teaching. We can do better, and I think DH ties well with the idea of personal learning environments. ‘Massive’ is not, in and of itself, a virtue, and we’d do well to remember that.
[22]Rainbow Castle
So, following my three strands, we’d:
[23]
-identify the ways our institutions and our uses of technology force particular ways of thinking
-we’d deform the content we teach
-we’d set up our institutions and our uses of technology to deform the way our students think: including the ways our institutions are set up.
[24]
So let’s turn the university inside out. It’s been about silos for so long (also known as ivory towers). I grew up on a farm: do you know what gets put into a silo, what comes out? It’s silage, chopped up, often a bit fermented, cattle food: pre-processed cud. Let’s not do that anymore.
[25]Walled Gardens, online dating
For all their massiveness, MOOCs and Universities are still walled gardens. And what’s the unit of connection? It’s the course. It’s the container. I used to work with a guy who often said, ‘once we get the contract, we’ll just get monkeys to do the work’. That guy is no longer in business. I used to work for a for-profit university in the States that had a similar approach to hiring online faculty.
MOOCs are not disruptive in that sense. Want to be really disruptive? Let’s turn to a model that massively connects people together who have a shared interest. I hereby banish the use of any metaphor that frames the relationship at a university in terms of clients, or customers. Instead, what if the metaphor used was more in line with a dating service?
In online dating, the site brings together two kinds of people, both looking for the same thing. Typically, the men pay a fee to be on the site; women are wooed to the site by all sorts of free promos etc. No point having a dating site that does not have any available ‘others’ on it. In which case, the university could be in the business of bringing together students [the ‘men’] with faculty [the ‘women’]. If a university had that metaphor in its mind, it would be thinking, ‘what can we do to make our site – the university – an attractive place for faculty to be?’ Imagine that!
Students would not be signing up for classes, but rather, to follow and learn from particular profs. Typically on something like eBay or a dating site, there are reputation systems embedded in the site. You do not buy from the person with the bad rep in eBay; you do not contact the person whose profile has gotten many negative reviews. Since the university knows the grades of the students and has teaching evaluations and other indicators of faculty interests and reputations, it has the ability to put together faculty and students in a dynamic way. “Others who have enjoyed learning about Roman civilization with Dr. Graham have loved learning about Bronze Age Greece with…”. Wouldn’t it be something to allow students to select their areas of interest knowing the reputation of the profs who work in a particular area; and for profs to select their students based on their demonstrated interests and aptitudes? Let faculty and students have ‘tokens’ – this is my first choice, this is my second choice, this is my third choice prof/student to work with for the session. Facilitate the matching of students and faculty. Let the student craft their way through university following individuals, and crafting a ‘masterpiece’ for their final demonstration of making as a way of knowing, for their BA? Hmmm. Kinda sounds like a return to the Guild, as it were.
You might not like that, which is fine; there are probably better ideas out there. We’ve got all this damned information around! Maybe there are earlier models that could work better with our new technologies, maybe there are new models for our new techs. But surely we can do better than merely replicate processes that were designed for the late 19th and early 20th century? Whatever metaphor we use to frame what the university does, it goes a long way to framing the ways learning can happen. That’s what DH and its exploration of a cyborg consciousness should make us at least explore.
[26]domain of one’s own
And once we’ve done that, let’s have some real openness. Let the world see that faculty-student, and student-student, relationship develop. Invite the rest of the world in. Folks like Ethan Watrall at MSU already do that for their on-campus courses putting all course materials and assessment activities on open websites, inviting the wider world to participate and to interact with the students.
Give every student, at the time of registration, a domain of their own, like Mary Washington is starting to do. Pay for it, help the student maintain it, for their time at university. At graduation, the student could archive it, or take over its maintenance. Let the learning community continue after formal assessment ends. The robots that construct our knowledge from the world wide web – Google and the content aggregators – depend on strong signals, on a creative class. If each and every student at your institution (and your alumni!) is using a domain of their own as a repository for their own IP, a personal learning environment, a node in a frequently re-configuring network of learners, your university would generate real gravity on the web, become the well out of which the wider world draws its knowledge. Use the structure and logic of the web to embed the learning life of the university so deeply into the wider world that it cannot be extricated!
[27]
Because right now, that’s not happening. If you study the structure of the web for different kinds of academic knowledge (here, Roman archaeology), there’s a huge disconnect between where the people are, and where the academics are. If we allow that to continue, it becomes increasingly more easy for outsiders to frame ‘academic’ knowledge as a synonym ‘pointless’. With the embedded university, the university inside out, there are no outsiders. If we embed our teaching through the personal learning environments of our students, our research production will become similarly embedded.
[28]
If the university is inside out, and not in splendid isolation, then it is embedded.
Forget massively ‘open’.
Think massively embedded.
Think massively accessible.
(Not the best image I could fine, but hey! that boulder, part of a structure, is embedded in a massively accessible landscape.)
[29]Check mark list
So what’s tuition for, then? Well, it’s an opportunity to have my one-on-one undivided attention; it’s icetime, an opportunity to skate. But we need to have more opportunities for sideways access to that attention too, for people who have benefited from participating in our openness, our embeddedness to demonstrate what they’ve learned. There’s much to recommend in Western Governors’ University’s approach to the evaluation of non-traditional learners.
[30]
The digital humanities, as a perspective, has changed the way I’ve come to teach. I didn’t set out to be a digital humanist; I wanted to be an archaeologist. But the multiple ways in which archaeological knowledge is constructed, its pan-disciplinary need to draw from different wells, pushed me into DH. There are many different strands to DH work; I’ve identified here what I think are three major ones that could become the framework, the weave and the weft, for something truly disruptive.
Historical Friction
I want to develop an app that makes it difficult to move through the historically ‘thick’ places – think Zombie Run, but with a lot of noise when you are in a place that is historically dense with information. I want to ‘visualize’ history, but not bother with the usual ‘augmented reality’ malarky where we hold up a screen in front of our face. I want to hear the thickness, the discords, of history. I want to be arrested by the noise, and to stop still in my tracks, be forced to take my headphones off, and to really pay attention to my surroundings.
So here’s how that might work.
1. Find wikipedia articles about the place where you’re at. Happily, inkdroid.org has some code that does that, called ‘Ici’. Here’s the output from that for my office (on the Carleton campus):
http://inkdroid.org/ici/#lat=45.382&lon=-75.6984
2. I copied that page (so not the full wikipedia articles, just the opening bits displayed by Ici). Convert these wikipedia snippets into numbers. Let A=1, B=2, and so on. This site will do that:
http://rumkin.com/tools/cipher/numbers.php
3. Replace dashes with commas. Convert those numbers into music. Musical Algorithmns is your friend for that. I used the default settings, though I sped it up to 220 beats per minute. Listen for yourself here. There are a lot of wikipedia articles about the places around here; presumably if I did this on, say, my home village, the resulting music would be much less complex, sparse, quiet, slow. So if we increased the granularity, you’d start to get an acoustic soundscape of quiet/loud, pleasant/harsh sounds as you moved through space – a cost surface, a slope. Would it push you from the noisy areas to the quiet? Would you discover places you hadn’t known about? Would the quiet places begin to fill up as people discovered them?
Right now, each wikipedia article is played in succession. What I really need to do is feed the entirety of each article through the musical algorithm, and play them all at once. And I need a way to do all this automatically, and feed it to my smartphone. Maybe by building upon this tutorial from MIT’s App Inventor. Perhaps there’s someone out there who’d enjoy the challenge?
I mooted all this at the NCPH THATCamp last week – which prompted a great discussion about haptics, other ways of engaging the senses, for communicating public history. I hope to play at this over the summer, but it’s looking to be a very long summer of writing new courses, applying for tenure, y’know, stuff like that.
Edit April 26th – Stuart and I have been playing around with this idea this morning, and have been making some headway per his idea in the comments. Here’s a quick screengrab of it in action: http://www.screencast.com/t/DyN91yZ0
Data Mining an Archaeological Database

I’m using their materials with permission.
In July, I’m presenting work related to data mining an archaeological database, in this case, the Portable Antiquity Scheme.
I wondered, if I treated each district in the UK as a ‘document’, and the items recovered in its territory as the words, would I see any interesting or useful patterns if I ran some topic models?
To give you a sense of the scale of this data, there are over 160 000 individual records in the material I obtained from PAS. An individual record might include a ‘hoard’, so there are *well* over 160 000 individual objects. When you sort this material into broad chronological materials, you find:
Paleolithic: 305 records
Mesolithic: 2281
Neolithic: 3608
Prehistoric: 426
Bronze Age: 2620
Iron Age:4695
Roman: 63479
Greek/Roman Provincial:25
Byzantine: 25
Early Medieval: 8421
Medieval: 44982
Post Medieval: 27879
Modern: 306
“Unknown”: 1486
Blank cells: 1278
Quite a lot of material. So, after massaging the data, cleaning things up, I began to work with a very small subset of materials – records tagged ‘bronze age’ from 14 districts (104 records). This was merely an exploration, to see if there’s any meat to my intuitive belief that there should be some sort of latent structure. The 14 districts I selected (the first 14 when I sorted ‘Bronze Age’) are:
Ashford
Bromley
Dover
East hampshire
Hart
Medway
New Forest
Sevenoaks
Test Valley
Winchester
Wokingham
I put every record from Wokingham District into a single txt file, then every one from Winchester, until I was done (and I really need to automate that). Then I fed the text files through MALLET, using the JAVA Gui for this initial exploration (using the JAVA Gui’s default settings. In a more robust exploration, I would go direct from the command line, tweaking until I found the best number of topics, etc).
So here’s what I found.
List of Topics
1. alloy palstave mm copper green surface slight cast dark penannular
2. mouth sides loop dims looped corners armorican axeheads core cast
3. blade axehead prominent casting iron hoard intact uneven single narrow
4. age fragment late surfaces alan spear body faces head flanged
5. age socket collar sectioned alloy slightly ridge seams front square
6. record flint grey scraper antiquities dorsal tool angle black visible
7. bronze patina end stop made remains flat decoration found corroded
8. database central rectify working recording standards usual fall aware began
9. bronze copper flashes part side edge large ridges shallow top
10. socketed straight axe rounded complete horizontal moulded rectangular expanding upper
What do those topics mean? To a human, they are all variations on the description of the artefacts. Given that multiple humans described these artefacts in the first place, perhaps (and it depends too on the kind of guidance and rigour that the PAS uses in its data entry) these topics gather some of the blurriness of categorization, a way of bypassing the clumpers and the splitters amongst us. Obviously, some more thought about what these may mean is necessary. But onwards!
I brought the resultant ‘documents: topics, % contribution’ list into gephi for some visualization. Since it was a small dataset, I did no pruning. Topic 4 does the most lifting in this network. In its ‘module’, you find topics 9, 10, 3, 5 (coloured purple) and districts of Gravesham, Bromley, Dover, Canterbury, Test Valley, and New Forest. But how much weight does this visualization carry? Since it’s two-mode, and these metrics are really only appropriate for a one-mode graph, probably not much. So I collapsed this graph into a one-mode graph of district to district, based on weighted ties by topic.
The resultant graph is probably more useful for archaeology, for it ties areas together based on all of the material culture recorded in the database. At the recent SAA in Honolulu, in the Connected Past session, folks were constructing networks from artefacts using Brainerd Robinson coefficients. The methodology I’m trying ought to be compared with those studies (see for instance Barbara Mill’s et al recent article). I then ran modularity and betweeness statistics again. Why betweeness? If the ‘topics’ that emerge in this database reflect something within the underlying material culture, then interconnections between sites constructed from topics show some kind of flow (of ideas? culture? economics?), thus ‘between’ sites straddle the most important of those flows – in which case the most ‘between’ districts might be rather more important.
Remarkably (and this could be an artefact of the method, rather than the underlying data), I get next to no variation in betweeness – every district except for East Hamphsire, Ashford, and New Forest has the same score (and these three all have the same score too). Modularity finds two groups. Perhaps it’s an east/west dichotomy? I laid the network out with the nodes at their geographic locations (typically, the district council office). No east-west dichotomy. (Incidentally, you can now export to Google Earth, overlaying your network against pretty satellite pictures).
So… there seems to be something to it. The thing to do now is to do every record, every district, and every period, mapping out changes over time. In the interests of being able to assess this, though, I should perhaps stick to my knitting and just do the Roman period.
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:
- Where there are complex emergent global processes and dynamics from simple local behaviour.
- 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.]
Hodder’s ‘Tanglegram’ as Network
I am reading Ian Hodder’s book, ‘Entangled: An Archaeology of the Relationship between Humans and Things’ Hodder writes that the tanglegram cannot be represented as a network, since a network doesn’t consider the nature of the relationships or nodes. This is not in fact the case. Representing these complex relationships as a network is quite possible, and allows the ‘tanglegram’ to actually become a object to query in its own right, rather than a suggestive illustration. I’ve uploaded the network data to Figshare:
http://dx.doi.org/10.6084/m9.figshare.654626
I used NodeXL to enter the data. If there was a bidirectional tie, I made two entries: A -> B, B -> A. If it was only one way, I entered it with the directionality of the original tanglegram. I saved it as a .net file, opened it in gephi, and ran gephi’s statistics.
This was all rather rough and ready; because I was working from a blown-up photocopy of the original figure, and I’m trying to get ready for a trip, there could be errors. One would need Hodder’s original data to do this properly, but I offer it up here to show that it’s possible, and indeed worthwhile: why else would you bother drawing a tanglegram, if not to use it to help your analysis?
In the image below, I resize the nodes to represent betweenness centrality (which elements of the tanglegram are doing the heavy lifting?) and recolour it according to modularity. Modularity finds five groups (nodes listed in descending order of betweenness centrality):
Group 0: house, groundstone, burial, plaster, figurines, pigment, skins, painting, personal artefacts, animal heads, food storage, human heads, special food, human body parts, burials, storage rooms, bins
Group 1: hoard, chipped stone, sheep, mats, dung, wild animals, fields, bone, cereals, wooden object, weeds.
Group 2: food, hearth, fuel, ash, clay balls, oven, traps, wood
Group 3: clay, baskets, extraction pits, wetland, reeds, birds, dryland, marl, ditches, fish, clean water, landscape, field, eggs
Group 4: midden, dogs, colluvium, mortar, pen, mudbrick
Seems quite suggestive! For the files for yourself, please see:
Hodder’s Figure 9.2, Entangled, as network. Shawn Graham. figshare.
http://dx.doi.org/10.6084/m9.figshare.654626
Practical Necromancy talk @Scholarslab – part I
Below is a draft of the first part of my talk for Scholarslab this week, at the University of Virginia. It needs to be whittled down, but I thought that those of you who can’t drop by on Thursday might enjoy this sneak peak.
Thursday, March 21 at 2:00pm
in Scholars’ Lab, 4th floor Alderman Library.
When I go to parties, people will ask me, ‘what do you do?’. I’ll say, I’m in the history department at Carleton. If they don’t walk away, sometimes they’ll follow that up with, ‘I love history! I always wanted to be an archaeologist!’, to which I’ll say, ‘So did I!’
My background is in Roman archaeology. Somewhere along the line, I became a ‘digital humanist’, so I am honoured to be here to speak with you today, here at the epicentre, where the digital humanities movement all began.
If the digital humanities were a zombie flick, somewhere in this room would be patient zero.
Somewhere along the line, I became interested in the fossilized traces of social networks that I could find in the archaeology. I became deeply interested – I’m still interested – in exploring those networks with social network analysis. But I became disenchanted with the whole affair, because all I could develop were static snapshots of the networks at different times. I couldn’t fill in the gaps. Worse, I couldn’t really explore what flowed over those networks, or how those networks intersected with broader social & physical environments.
It was this problem that got me interested in agent based modeling. At the time, I had just won a postdoc in Roman Archaeology at the University of Manitoba with Lea Stirling. When pressed about what I was actually doing, I would glibly respond, ‘Oh, just a bit of practical necromancy, raising the dead, you know how it is’. Lea would just laugh, and once said to me, ‘I have no idea what it is you’re doing, but it seems cool, so let’s see what happens next!’
How amazing to meet someone with the confidence to dance out on a limb like that!
But there was truth in that glib response. It really is a form of practical necromancy, and the connections with actual necromancy and technologies of death is a bit more profound than I first considered.
So today, let me take you through a bit of the deep history of divination, necromancy, and talking with the dead; then we’ll consider modern simulation technologies as a form of divination in the same mold; and then I’ll discuss how we can use this power for good instead of evil, of how it fits into the oft-quote digital humanities ethos of ‘hacking as a way of knowing’ (which is rather like experimental archaeology, when you think about it), and how I’m able to generate a probabilistic historiography through this technique.
And like all good necromancers, it’s important to test things out on unwilling victims, so I would also like to thank the students of HIST3812 who’ve had all of the ideas road-tested on them earlier this term.
Zombies clearly fill a niche in modern western culture. The president of the University of Toronto recently spoke about ‘zombie ideas’ that despite our best efforts, persist, infect administrators, politicians, and students alike, trying to eat the brains of university education.
Zombies emerge in popular culture in times of angst, fear, and uncertainty. If hollywood has taught us anything, it’s that Zombies are bad news. Sometimes the zombies are formerly dead humans; sometimes they are humans who have been transformed. Sometimes we deliberately create a zombie. The zombie can be controlled, and made to do useful work; zombie as a kind of slavery. More often, the zombies break loose, or are the result of interfering with things humanity was wont not too; apocalypse beckons. But sometimes, like ‘Fido’, a zombie can be useful, can be harnessed, and somehow, be more human than the humans. [Fido]
If you’d like to raise the dead yourself, the answer is always just a click away [ehow].
There are other uses for the restless dead. Before our current fixation with apocalypse, the restless dead could be useful for keeping the world from ending.
In video games, we call this ‘the problem space’ – what is it that a particular simulation or interaction is trying to achieve? For humanity, at a cosmological level, the response to that problem is through necromancy and divination.
I’m generalizing horribly, of course, and the anthropologists in the audience are probably gritting their teeth. Nevertheless, when we look at the deep history and archaeology of many peoples, a lot can be tied to this problem of keeping the world from ending. A solution to the problem was to converse with those who had gone before, those who were currently inhabiting another realm. Shamanism was one such response. The agony of shamanism ties well into subsequent elaborations such as the ball games of mesoamerica, or other ‘game’ like experiences. The ritualized agony of the athlete was one portal into recreating the cosmogonies and cosmologies of a people, thus keeping the world going.
The bull-leaping game at Knossos is perhaps one example of this, according to some commentators. Some have seen in the plan of the middle minoan phase of this palace (towards the end of the 2nd millenium BC) a replication in architecture of a broader cosmology, that its very layout reflects the way the Minoans saw the world (this is partly also because this plan seems to replicate in other Minoan centres around the Aegean). Jeffrey Soles, pointing to the architectural play of light and shadow throughout the various levels of Knossos argues that this maze-like structure was all part of the ecstatic journey, and ties shamanism directly to the agonies of sport & game in this location. We don’t have the Minoans’ own stories, of course, but we do have these frescoes of bull-leaping, and other paraphernalia which tie in nicely with the later dark-age myths of Greece
So I’m making a connection here between the way a people see the world working, and their games & rituals. I’m arguing that the deep history of games is a simulation of how the world works.
This carries through to more recent periods as well. Herodotus wrote about the coming of the Etruscans to Italy: “In the reign of Atys son of Menes there was a great scarcity of food in all Lydia. For a while the Lydians bore this with patience; but soon, when the famine continued, they looked for remedies, and various plans were suggested. It was then that they invented the games of dice, knucklebones, and ball, and all the other games of pastime, except for checkers, which the Lydians do not claim to have invented. Then, using their discovery to forget all about the famine, they would play every other day, all day, so that they would not have to eat… This was their way of life for eighteen years. Since the famine still did not end, however, but grew worse, the king at last divided the people into two groups and made them draw lots, so that one should stay and the other leave the country’.
Here I think Herodotus misses the import of the games: not as a pasttime, but as a way of trying to control, predict, solve, or otherwise intercede with the divine, to resolve the famine. In later Etruscan and Roman society, gladiatorial games for instance were not about entertainment but rather about cleansing society of disruptive elements, about bringing everything into balance again, hence the elaborate theatre of death that developed.
The specialist never disappears though, the one who has that special connection with the other side and intercedes for broader society as it navigates that original problem space. These were the magicians and priests. But there is an important distinction here. The priest is passive in reading signs, portents, and omens. Religion is revealed, at its proper time and place, through proper observation of the rituals. The magician is active – he (and she) compels the numinous to reveal itself, the spirits are dragged into this realm; it is the magician’s skill and knowledge which causes the future to unfurl before her eye.
The priest was holy, the magician was unholy.
Straddling this divide is the Oracle. The oracle has both elements of revelation and compulsion. Any decent oracle worth its salt would not give a straight-up answer, either, but rather required layers of revelation and interpretation. At Delphi, the God spoke to the Pythia, the priestess, who sat on the stool over the crack in the earth. When the god spoke, the fumes from below would overcome her, causing her to babble and writhe uncontrollably. Priests would then ‘interpret’ the prophecy, in form of a riddle.
Why riddles? Riddles are ancient. They appear on cuneiform texts. Even Gollum knew what a true riddle should look like – a kind of lyric poem asking a question that guards the right answer in hints and wordplay.
‘I tremble at each breath of air/ And yet can heaviest burders bear. [implicit question being asked is who am I? – water]
Bilbo cheated.
We could not get away from a discussion of riddles in the digital humanities without of course mentioning the I-ching. It’s a collection of texts that, depending on dice throws, get combined and read in particular ways. Because this is essentially a number of yes-or-no answers, the book can be easily coded onto a computer or represented mechanically. In which case, it’s not really a ‘book’ at all, but a machine for producing riddles.
Ruth Wehlau writes, “Riddlers, like poets, imitate God by creating their own cosmos; they recreate through words, making familiar objects into something completely new, rearranging the parts of pieces of things to produce creatures with strange combinations of arms, legs, eyes and mouths. In this transformed world, a distorted mirror of the real world, the riddler is in control, but the reader has the ability to break the code and solve the mystery (wehlau 1997)
Riddles & divination are related, and are dangerous. But they also create a simulation, of how the world can come to be, of how it can be controlled.
One can almost see the impetus for necromancy, when living in a world described by riddles. Saul visits the Witch of Endor; Oddyseus goes straight to the source.
…and Professor Hix prefers the term ‘post mortem communications’. However you spin it, though, the element of compulsion, of speaking with the dead, marks it out as a transgression; necromancers and those who seek their aid never end well.
It remains true today, that those who practice simulation, are similarly held in dubious regard. If that was not the case, tongue in cheek articles titles such as this would not be necessary.
I am making the argument that modern computational simulation, especially in the humanities, is more akin to necromancy than it is to divination, for all of these reasons.
But it’s also the fact that we do our simulation through computation itself that marks this out as a kind of necromancy.
The history of the modern digital computer is tied up with the need to accurately simulate the yields of atomic bombs, of blast zones, and potential fallout, of death and war. Modern technoculture has its roots in the need to accurately model the outcome of nuclear war, an inversion of the age old problem space, ‘how can we keep the world from ending’ through the doctrines of mutually assured destruction.
The playfulness of those scientists, and the acceleration of hardware technology lead to video games, but that’s a talk for another day (and indeed, has been recently well treated by Rob MacDougall of Western University).
‘But wait! Are you implying that you can simulate humans just as you could individual bits of uranium and atoms, and so on, like the nuclear physicists?’ No, I’m not saying that, but it’s not for nothing that Isaac Asimov gave the world Hari Seldon & the idea of ‘psychohistory’ in the 1950s. As Wikipedia so ably puts it, “Psychohistory is a fictional science in Isaac Asimov’s Foundation universe which combines history, sociology, etc., and mathematical statistics to make general predictions about the future behavior of very large groups of people, such as the Galactic Empire.”
Even if you could do Seldon’s psychohistorical approach, it’s predicated on a population of an entire galaxy. One planetfull, or one empire-full, or one region-full, of people just isn’t enough. Remember, this is a talk on ‘practical’ necromancy, not science-fiction.
Well what about so-called ‘cliodynamics’? Cliodynamics looks for recurring patterns in aggregate statistics of human culture. It may well find such patterns, but it doesn’t really have anything to say about ‘why’ such patterns might emerge. Both psycohistory and cliodynamics are concerned with large aggregates of people. As an archaeologist, all I ever find are the traces of individuals, of individual decisions in the past. It always requires some sort of leap to jump from these individual traces to something larger like ‘the group’ or ‘the state’. A Roman aqueduct is, at base, still the result of many individual actions.
A practical necromancy therefore is a simulation of the individual.
There are many objections to simulation of human beings, rather than things like atoms, nuclear bombs, or the weather. Our simulations can only do what we program them to do. So they are only simulations of how we believe the world works (ah! Cosmology!). In some cases, like weather, our beliefs and reality match quite well, at least for a few days, and we know much about how the variables intersect. But, as complexity theory tells us, starting conditions strongly affect how things transpire. Therefore we forecast from multiple runs with slightly different starting conditions. That’s what a 10% chance of rain really means: We ran the simulation 100 times, and in 10 of them, rain emerged.
And humans are a whole lot more complex than the water cycle. In the case of humans, we don’t know all the variables; we don’t know how free will works; we don’t know how a given individual will react; we don’t understand how individuals and society influence each other. We do have theories though.
This isn’t a bug, it’s a feature. The direction of simulation is misplaced. We cannot really simulate the future, except in extremely circumscribed situations, such as pedestrian flow. So let us not simulate the future, as humanists. Let us create some zombies, and see how they interact. Let our zombies represent individuals in the past. Give these zombies rules for interacting that represent our best beliefs, our best stories, of how some aspect of the past worked. Let them interact. The resulting range of possible outcomes becomes a kind of probabilistic historiography. We end up with not just a story about the past, but also about other possible pasts that could have happened if our initial story we are telling about how individuals in the past acted is true, for a given value of true.
We create simulacra, zombies, empty husks representing past actors. We give them rules to be interpreted given local conditions. We set them in motion from various starting positions. We watch what emerges, and thus can sweep the entire behavior space, the entire realm of possible outcomes given this understanding. We map what did occur (as best as we understand it) against the predictions of the model. For the archaeologist, for the historian, the strength of agent based modeling is that it allows us to explore the unintended consequences inherent in the stories we tell about the past. This isn’t easy. But it can be done. And compared to actually raising the dead, it is indeed practical.
[and here begins part II, which runs through some of my published ABMS, what they do, why they do it. All of this has to fit within an hour, so I need to do some trimming.]
[Postscriptum, March 23: the image of the book of random digits came from Mark Sample's 'An Account of Randomness in Literary Computing, & was meant to remind me to talk about some of the things Mark brought up. As it happens, I didn't do that when I presented the other day, but you really should go read his post.]





