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.

 

CAA 2016 Session Videos

Continuing on the video theme: awhile back we encouraged folks to attend this year’s Computer Applications in Archaeology conference in Oslo. It was a blast to attend, and Oslo is a really cool city to spend a week in. I even briefly considered staying on to start a career doing car advertisements..

carmodel

 

However, if you weren’t able to make it up to Oslo, Doug Rocks-Macqueen, author of the excellent blog Doug’s Archaeology, has you covered: his session recordings have been making their way out on to the interwebs via his YouTube channel, Recording Archaeology. Now you can relive all of the action of CAA Oslo right in your own home!

Here’s a few of the sessions, helpfully organized as playlists of individual talks:

Linked pasts: Connecting islands of content

Methodology of archaeological simulation. Meeting of the Special Interest Group in Complex Systems Simulation

The road not taken: Modelling approaches to transport on local and regional scales

Can you model that? Applications of complex systems simulation to explore the past

Networking the past: Towards best practice in archaeological network science

Theorising the Digital: Digital Theoretical Archaeology Group (digiTAG) and the CAA

Interpretations from digital sensations? Using the digital sensory turn to discover new things about the past

For more videos, check out Recording Archaeology. And don’t forget to register for CAA 2017 in Atlanta!

 

CfP: Computer Applications in Archaeology, March 14 – 17, Atlanta, GA USA

The folks at CAA have recently announced a call for papers for the 2017 conference, to be held at Georgia State University in Atlanta. From the conference website:

The 45th CAA conference will bring together scholars from across the globe to share their cutting edge research from a diverse range of fields in a focused, but informal, setting.  One thing that the CAA prides itself on is a strong sense of community, and we hope to continue to grow that community by welcoming new participants this year.  This is only the 3rd time the conference has been held in the United States, and we are excited to have old and new members join us in Atlanta this coming spring.

There are a TON of sessions to choose from this year, showcasing the diversity of computational approaches in archaeology as well as interest in theory and ways of knowing. The full list of sessions is here.

The authors of this blog will be co-chairing a few different sessions at the conference, including:

 

Data, Theory, Methods, and Models. Approaching Anthropology and Archaeology through Computational Modeling

Quantitative model-based approaches to archaeology have been rapidly gaining popularity. Their utility in providing an experimental test-bed for examining how individual actions and decisions could influence the emergence of complex social and socio-environmental systems has fueled a spectacular increase in adoption of computational modeling techniques to traditional archaeological studies. However, computational models are restricted by the limitations of the technique used, and are not a “silver bullet” solution for understanding the archaeological and anthropological record. Rather, simulation and other types of formal modeling methods provide a way to interdigitate between archaeology/anthropology and computational approaches and between the data and theory, with each providing a feedback to the other. In this session we seek well-developed models that use data and theory from the anthropological and archaeological records to demonstrate the utility of computational modeling for understanding various aspects of human behavior. Equally, we invite case studies showcasing innovative new approaches to archaeological models and new techniques expanding the use of computational modeling techniques.

Everything wrong with…

This is a different kind of session. Instead of the normal celebration of our success this session will be looking at our challenges. But, not degrading into self-pity and negativity, as it will be about critical reflection and possible solutions. The goal of this session is to raise the issues we should be tackling. To break the mold of the typical conference session, in which we review what we have solved, and instead explore what needs to be solved. Each participant will give a short (max 10 minutes but preference will be for 5 mins.) presentation in which they take one topic and critically analysis the problems surrounding it, both new and old. Ideally, at the end each participant would have laid out a map of the challenges facing their topic. The floor will then be opened up to the audience to add more issues, refute the problems raised, or propose solutions. This is open to any topic- GIS, 3D modelling, public engagement, databases, linked data, simulations, networks, etc. It can be about a very narrow topic or broad ranging e.g. everything that is wrong with C14 dating, everything wrong with least cost path analysis in ArcGIS, everything wrong with post-prossussalism, etc. However, this is an evaluation of our methods and theories and not meant to be as high level as past CAA sessions that have looked at grand challenges e.g. the beginning of agriculture. Anyone interested in presenting are asked to submit a topic (1-2 sentences) and your estimated time to summarize it (5 or 10 minutes). Full abstracts are not necessary.

The ups and downs of archaeological simulation

The continuing rise of computational modelling applications, in particular simulation approaches, resembles the ‘hype’ cycles our discipline experienced in the past. The introduction of statistics, data management or GIS all started with inflated expectations and an explosion in applications, followed by a ‘correction’ phase seeing the early optimism dwindling and a heavy critique towards exaggerated claims and examples of misapplication. The next phase, ‘maturity’, is reached when the use of a particular technique is not questioned any more (although particular applications of it may still be) as it becomes part of the standard research toolkit. The verdict is still out whether the use of simulation techniques in archaeology is reaching the peak of the ‘optimism’ phase or is perhaps still in the midst of the ‘correction’ phase. However, lessons learned from other, now commonly used, computational methods or coming from other disciplines could accelerate the process of establishing simulation in the mainstream of archaeological practice. The Special Interest Group in Complex System Simulation would like to open the discussion to a wide audience of archaeologists and therefore invites all CAA2017 participants to take an active part in the roundtable. During the meeting we will consider the current place of simulation in archaeological practice, the main challenges facing modellers and the road map for the future.

The conference promoters are also looking for folks interested in putting together workshops for the day before the session. The deadline for abstract submissions is midnight on Friday, October 28th. For more information, visit the CAA conference website.

Featured image: Midtown HDR Atlanta by Mmann1988 (Wikimedia Commons CC BY 2.0)

 

Simulados: a short video explaining what ABM is and how we use it to understand the past

This video, brought to you by our friends over at the Barcelona Supercomputing Center, does a great job of explaining in easy-to-understand terms what agent-based modeling is, and how it can be useful for both understanding the past and making the past relevant to the present. No small feat to accomplish in about 3 minutes. Have a look!