All posts by izaromanowska

Iza Romanowska is a postgraduate research student at the Institute for Complex Systems Simulation and the Centre for the Archaeology of Human Origins, University of Southampton, UK. Her research focuses on Agent-based modelling, Pleistocene dispersals and Palaeolithic archaeology. For more info: cmg website or Follow @Iza_Romanowska.

The plot thickens…

PUN! Now that I got your attention with this uncle Oscar style pun here’s a bit of a letdown. This post will be about plots, visualisations, libraries, colours, etc. Yay, fun!

Well, to be honest once you reemerge from the land of data analysis and stats, plotting the results is almost like going to the beach so all together it’s not too bad.

Most of people plot in Excel and then try to cover it up. Seeing the default ‘plot style’ in a publication or a presentation triggers ‘judge, judge, judge’ response almost automatically, even though in the vast majority of cases it is absolutely fine.

But since we’re moving away (at a snail pace though) from a point-and-click software and towards scripting languages, I thought it may be useful to knock together a little guide to show what is out there and how to use it (if it’s in Python, because that’s what I use).

First, the major visualisation libraries are: ggplot2 for R, and matplotlib for Python (and others for other languages that I know very little about). ggplot2 produces pretty, pretty pictures (like the one below) and has this nice distinctive style, which became everyone’s favourite. It was also my favourite until I discovered a little trick that meant I didn’t need to switch to R for doing graphs any more and I abandoned R all together. This means that the rest of this post will be about Python but if you want to know about making pretty graphs in R, Stefani has covered it extensively in this post.

gaussian copy

Python has been renowned for its clunky graphics. Like these:

results

Yeah, that does look rubbish compared to the ggplot aesthetics. Good it is easily correctable. Add the following line at the beginning of your code:

plt.style.use('ggplot')

and this comes out:

results

BANG! Looks like ggplot, right? In fact, I cheated earlier – the first image has not been generated in R using ggplot, I did it in Python and used this little hack to make it look like R. You can also use the default pandas (data analysis library) setup with the following line of code and the results are equally pleasing.

pd.options.display.mpl_style = 'default'

results

Ok so let’s get to the juice, that is: how to plot in Python.

First let’s generate some fictional data. Let’s pretend it’s proportions of different types of lithics on different sites.

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

plt.style.use('ggplot')
data = pd.DataFrame(np.random.rand(10,3), columns = ['flakes','tools','handaxes'])

data.head()

The first three lines import the libraries we need. The last line is to check how the data looks like (if you’re running it from a script, not from a console you need to wrap the last line in a print()).

You can almost guess how to plot it:

data.plot()

DONE!

Ok, not really done, because it looks rubbish and it does not make much sense with the lines. What we need is bars. So here you go:

data.plot(kind='bar')

or

data.plot(kind='barh')

This is much better. But to be able to compare them better let’s stack them up.

data.plot(kind='barh', stacked = True)

Voila! Lovely plots, all in Python. You can obviously keep on going with extra features like axis labels or the title, it’s all available in the plot command.

To save them to a file use:

plt.savefig('pretty_graph.png')

pretty_graph

 

Software tools for ABMs

A key consideration when embarking on an agent-based modelling focused project is ‘what are we going to write the model in?’. The investment of time and effort that goes into learning a new software tool or a language is so considerable that in the vast majority of cases it is the model that has to be adjusted to the modellers skills and knowledge rather than the the other way round.

Browsing through the OpenABM library it is clear that Netlogo is archaeology’s, social sciences and ecology first choice (51 results), with other platforms and languages trailing well behind (Java – 13 results, Repast – 5 results, Python – 5 results)*. But it comes without saying that there are more tools out there. A new paper published in Computer Science Review compares and contrasts 85 ABM platforms and tools.

It classifies each software package according to the easy of development (simple-moderate-hard) as well as its capabilities (light-weight to extreme-scale). It also sorts them according to their scope and possible subjects (purpose-specific, e.g., teaching, social science simulations, cloud computing, etc., or subject-specific, e.g., pedestrian simulation, political phenomena, artificial life) so that you have a handy list of software tools designed for different applications. This is, to the best of my knowledge, the first survey of this kind since this, equally useful but by now badly outdated, report from 2010.

Abar, Sameera, Georgios K. Theodoropoulos, Pierre Lemarinier, and Gregory M.P. O’Hare. 2017. “Agent Based Modelling and Simulation Tools: A Review of the State-of-Art Software.” Computer Science Review 24: 13–33. doi:10.1016/j.cosrev.2017.03.001.

 

* Note that the search terms might have influenced the numbers, e.g., if the simulation is concerned with pythons (the snakes) it would add to the count regardless of the language it was written in.

Image source: wikipedia.org

Digital Archaeology Sessions at the Brazilian Archaeological Society Congress

Our colleagues in Brazil are planning two sessions on digital archaeology at the Brazilian Archaeological Society Congress (Teresina, 10-15 September). So if you working in or with South American archaeology, this may be of interest. Note the close deadline: 7th of July. For more information see below or get in touch with Grégoire van Havre (gvanhavre at gmail dot com).

Image source: wikipedia.org

——————————————————————————————————————————————–

Call for Papers - Brazilian Archaeology Society Congress

The Brazilian Archaeology Society will meet in Teresina (Brazil) in September 10-15, and there are two session proposals (yes, two!) dedicated to computers and digital archaeology. Check out the official website for more details (in Portuguese): http://www.sab2017.com.br. The call for papers was extended to July, 7.

Both sessions are calls to gather computer archaeologists from around the country, as well as people from abroad working in Southern American contexts, and discuss experiences and problems.

1. Computer resources for archaeology: from excavation to data analysis
2. IPads in the Trenches: Digital Archaeology in Brazil - where are we?

This will be the first time digital archaeology and computer matters will be directly addressed in a national congress in Brazil.

Come to Cancun to talk about the Evolution of Cultural Complexity

The annual Conference on Complex Systems is one of the scientific gatherings where researchers present, discuss and debunk all things complex. This year it would be a double shame to miss it since it takes place in Cancun, Mexico between 17-22 September. If anyone needs any more encouragement, we are organising an exciting session focused on the evolution of broadly defined cultural complexity. Please send your abstracts by the 26th of May here. Any questions? Drop us an email: ccs17-at-bsc-dot-es
Details below and on the website: https://ccs17.bsc.es/

– – – – – – – – – – – – – – – – – – – – – – – – – – –

Scientific Background

Human sociocultural evolution has been documented throughout the history of humans and earlier hominins. This evolution manifests itself through development from tools as simple as a rock used to break nuts, to something as complex as a spaceship able to land man on other planets. Equally, we have witnessed evolution of human population towards complex multilevel social organisation.

Although cases of decrease and loss of this type of complexity have been reported, in global terms it tends to increase with time. Despite its significance, the conditions and the factors driving this increase are still poorly understood and subject to debate. Different hypothesis trying to explain the rise of sociocultural complexity in human societies have been proposed (demographic factor, cognitive component, historical contingency…) but so far no consensus has been reached.

Here we raise a number of questions:

  1. Can we better define sociocultural complexity and confirm its general tendency to increase over the course of human history?
  2. What are the main factors enablingan increase of cultural complexity?
  3. Are there reliable way to measure the complexity in material culture and social organisationconstructs, that is?
  4. How can we quantify and compare the impact of different factors?
  5. What causes a loss of cultural complexity in a society? And how often these losses occurred in the past?

Goals of the session

In this satellite meeting we want to bring together a community of researchers coming from different scientific domains and interested in different aspect of the evolution of social and cultural complexity. From archaeologists, to linguists, social scientists, historians and artificial intelligence specialists – the topic of sociocultural complexity transgresses traditional discipline boundaries. We want to establish and promote a constructive dialogue incorporating different perspectives: theoretical as well as empirical approaches, research based on historical and archaeological sources, as well as actual evidences and contemporary theories. We are particularly interested in formal approaches which enable more constructive theory building and hypothesis testing. However, even establishing common vocabulary of terms and concepts and discussing the main methodological challenges in studying sociocultural complexity is an important step towards a more cohesive framework for the understanding of cultural evolution in general and for individual research case studies in particular. Our approach is informed by the convergence between simulation and formal methods in archaeological studies and recent developments in complex systems science and complex network analysis.

The session will focus but is not limited to:

  • Social dynamics of innovation.
  • Cumulative Culture and social learning.
  • Evolution of Technology and technological changes
  • Cognitive Process,Creativity, cooperation and innovation
  • Population Dynamics and Demographic Studies
  • Computer tools to understand the cultural evolutionary change

Come to Atlanta, learn ABM

This year the simulating complexity team is yet again teaching a 2-day workshop on agent-based modelling in archaeology as a satellite to the CAA conference.  The workshop will take place on Sunday and Monday 12-13 March 2017. The workshop is free of charge, however, you have to register to the conference (which has some good modelling session as well).

Last year we had an absolute blast with over 30 participants, 10 instructors and 96% satisfaction rate (of the students, instructors were 100% happy!).

The workshop will follow along similar lines to last year although we have a few new and exciting instructors and a few new topics. For more details check here and here or simply get in touch!

This event is possible thanks to the generous support of the Software Sustainability Institute.

 

Socio-Environmental Dynamics over the Last 12,000 Years workshop, Kiel, Germany 2-24, March 2017

University of Kiel, Germany will be hosting a workshop “Socio-Environmental Dynamics over the Last 12,000 Years: The Creation of Landscapes IV” between 20-24th March 2017.   It includes several sessions on simulation, modelling and ABM with a special emphasis on socio-natural systems.  The abstract submission deadline is a still quite some time (30th November) but it may be worth putting the event into your calendars if you are not planning on crossing the ocean for the CAA in Atlanta or the SAAs in Vancouver.

For more information see the workshop website: http://www.workshop-gshdl.uni-kiel.de

 

Image source: https://en.wikipedia.org/wiki/Kiel#/media/File:Postcard_Panorama_of_Kiel_(1902).jpg

Complex social dynamics in a few lines of code

To prove that there is a world beyond agents, turtles and all things ABM, we have created a neat little tutorial in system dynamics implemented in Python.

Delivered by Xavier Rubio-Campillo and Jonas Alcaina just a few days ago at the annual Digital Humanities conference (this year held in the most wonderful of all cities – Krakow), it is tailored to humanities students so it does not require any previous experience in coding.

System dynamics is a type of mathematical or equation-based modelling. Archaeologists (with a few noble exceptions) have so far shunned from, what is often perceived as, ‘pure math’ mostly citing the ‘too simplistic’ argument when awful mathematics teacher trauma was probably the real reason. However, in many cases an ABM is a complete overkill when a simple system dynamics model would be well within one’s abilities. So give it a go if only to ‘dewizardify’* the equations.

Follow this link for the zip file with the tutorial: https://zenodo.org/record/57660#.V4YIIKu7Ldk

*the term ‘dewizardify’ courtesy of SSI fellow Robert Davey (@froggleston)

CSS2016 Amsterdam

If the most important annual conference in complex systems simulation is anything to go by then researchers in humanities are slowly infiltrating the ranks of complexity scientists.

This year the CSS (Complex Systems Society) conference is taking place in Amsterdam between 19-22 September. It is structured a bit differently than traditional conferences, that is, it consists of two main parts:

  • Core sessions such as “Foundations of Complex Systems” or “Socio-ecological Systems”, which are held every year, and
  • Satellite sessions, usually focusing on smaller topics or subdisciplines, which are proposed independently and, therefore, change from one year to another.

Archaeology (and humanities in general) has been on and off the agenda since 2013 but usually this meant one dedicated session and perhaps a paper or two in the core sessions classified as social systems simulations. However, this year there seems to be a bit of an explosion (let’s call it ‘exponential growth’!) in the number of sessions led by folk who have interest in the past. These three are particularly relevant:

10. Complexity and the Human Past: Unleashing the Potential of Archaeology and Related Disciplines
Organizer: Dr. Sergi Lozano

26. Complexity History. Complexity for History and History for Complexity 
Organizer: Assoc Prof. Andrea Nanetti

27. The Anthropogenic Earth System: Modeling Social Systems, Landscapes, and Urban Dynamics as a Coupled Human+Climate System up to Planetary Scale
Organizer: Dr. John T. Murphy

In addition, there are a number of satellite sessions that, although not dealing specifically with past systems, may be of interest for anyone who deals with evolution, urban development, economic systems or networks and game theory.  Finally, the most excellent student conference on complex systems (SCCS) will run just prior to the main event, between 16-18 September.

To submit an abstract, get in touch with the session organiser (you can find their emails here). The official deadline is 10th July, but the organisers may have imposed a different schedule so get in your abstract soon. And see you all in Amsterdam!

Image above: http://www.ccs2016.org

 

 

Should I cite?

In the old day things were simple – if you borrowed data, an idea, a method, or any specific piece of information, you knew you need to cite the source of such wisdom. With the rise of online communication these lines have become more blurred, especially in the domain of research software.

Although we use a wide variety of software to conduct our research it is not immediately obvious which of them deserve a formal citation, which should be mentioned and which can be left out completely. Imagine three researchers doing exactly the same piece of data analysis: the first one uses Excel, the second – SPSS, the third coded it up in R. The chances are that the Excel scholar won’t disclose which particular tool allowed him to calculate the p-values, the SPSS user will probably mention what they used, including the version of the software and the particular function employed, finally the R wizard is quite likely to actually cite R in the same way as they would cite a journal paper.

You may think this is not a big deal and we are talking about the fringes of science, but in fact it is. As everyone who has ever tried to replicate (or even just run) someone else’s simulation will tell you, without detailed information on software that was used, the chances of succeeding vary between  virtually impossible to very difficult. But apart from the reproducibility of research there is also the issue of credit. Some (probably most) of the software tools we are using were developed by people in research positions – as their colleagues were producing papers, they have spent their time developing code. In the world of publish or perish they may be severely disadvantaged if their effort is not credited in the same way as their colleagues. Spending two years developing a software tool that is used by hundreds of other researchers and not getting a job because the other candidate had published three conference papers in the meantime, sounds like a rough deal.

To make it easier to navigate this particular corner of academia, we teamed up with research software usurers and developers during the Software Sustainability Institute Hackday and created a simple chart and a website to help you make the decision of when to and when not to cite research software.

shoudacite_comic

If you’re still unsure check out the website we put together for more information about research software credit, including a short guide on how to get people to cite YOUR software:    Also, keep in mindt hat any model uploaded to OpenABM gets a citation and a doi, making it easy to cite.

 

 

 

 

 

 

How useful is my model? Barcelona, 24-26 May

Our colleagues from Barcelona are organising a two-day workshop on the challenges of relating formal models (not only ABMs but other types of simulation and computational models as well) to the archaeological data. See below for an extended summary. The deadline for abstract submission has been extended to 25th April. For more information, check out their website.

 

—————————————————————————————————

Aim

The last decade saw a rapid growth of quantitative and computational methods apt to analyse long-term cultural and biological processes. In particular, the wide diffusion of agent-based simulation platforms and the enhanced accessibility of computer-intensive statistical analyses are offering the possibility to replace explanations based on natural language with formal models.

While these advances are providing powerful tools that are enabling us to tackle old and new research questions, their use is rarely coupled with appropriate epistemological discussions on how to ultimately relate the model to the data. Problems such as the choice of an appropriate statistic describing the empirical record, the balance between parsimony, complexity, and goodness-of-fit, the integration of taphonomic and sampling biases, or the inferential framework for selecting or rejecting alternative hypotheses rarely occupy the spotlight. In the case of simulation models, discussions are often limited to the model-building stage, and comparisons between prediction and observation are too often qualitative and not supported by sufficient statistical rigour. Yet this is the fundamental step that enables us to evaluate our models. In historical sciences, where the challenges imposed by the nature and the quality of our samples is at its greatest, this issue deserves more discussions and solutions. We believe that this is a critical issue that transcends the specific used in each discipline and cannot be dismissed as a challenge for statisticians.

We invite experts at different stage of this endeavour, sharing the same challenge of evaluating archaeological, historical, and anthropological model to the empirical evidence. We welcome the widest range of expertise (e.g. agent-based simulation, phylogenetics, network analysis, Bayesian inference, etc.) in order to promote the cross-fertilisation of techniques, as well as to engage into deeper theoretical and methodological discussions that transcends the specific of a given geographical and historical context. Participants will present examples showcasing problems (and solutions) on a variety of topics, including: uncertainty in the observed data, parameter search and estimation, model reusability and reproducibility, and more broadly applications of hypothesis testing and model-comparison frameworks in archaeology, anthropology, and history.

Call For Papers
Abstract Deadline: 25th April 2016 
Abstract Length : max 300 words
Please submit via email to the address simulpast@gmail.com with the subject: “WK-Empirical Challenge”

Image source: https://en.wikipedia.org/wiki/Palau_de_la_Música_Catalana#/media/File:Palau_-_Vitrall_platea.jpg