## 1 Introduction

The theory of wiggle-matching using Bayesian statistics was developed by Christen and Litton (1995) and is based on the general framework for Bayesian radiocarbon calibration developed in the 1990s, see for example Christen (1994a) or Buck et al. (1996, chapter 9) and references therein. The latter reference is strongly recommended for a general view on applications of Bayesian statistics in archaeology and, in particular, Bayesian calibration.

In this paper we use the term 'wiggle-matching' when a known floating chronology of radiocarbon dates needs to be fixed in the calendar scale. For example, when tree-rings taken from a timber or log are radiocarbon dated, the relative ages for the sample, in the calendar scale, are known precisely and radiocarbon dating is used to establish an absolute dating for the resulting floating chronology. Other authors use the term 'wiggle-matching' more loosely to refer to calibration problems where relative chronologies are known with less precision; however, here we restrict ourselves to the former case.

Other approaches for wiggle-matching do exist and the corresponding implementations are available in public domain software. Kilian et al. (1995; 2000), advocate the use of a chi-squared test for wiggle-matching. The point estimates obtained, under broad regularity conditions, will coincide with the 'best match' (MAP estimate) provided by a Bayesian analysis. However, there are problems in assessing the errors involved in the point estimates (matches); see Bronk-Ramsey et al. (2001) for a review. The Bayesian approach to wiggle-matching has also been considered by other authors (see Goslar and Madray 1998, and the software OxCal). However, we present here a formal approach to outlier analysis (and therefore model fit), fully supported by the Bayesian paradigm, that is based on Christen (1994a; 1994b). The OxCal program calculates an alternative ad hoc 'overall fit', using reasonable heuristic arguments. Users therefore have the opportunity of comparing these various approaches, for a more robust analysis of their data sets.

This paper is planned as a non-linear document that at this point splits into three independent, although cross-referenced, readings. There is a section to explain the software Bwigg for Bayesian wiggle-matching, one on intuitive explanation of Bayesian wiggle-matching and, for statisticians, a section giving a more detailed technical explanation.

Select a section