gibbs_ad {eratosthenes}R Documentation

Gibbs Sampler for Archaeological Dating

Description

A Gibbs sampler for archaeological dating, to fit relative sequences to absolute, calendrical dates. Elements can be associated with termini post quem (t.p.q.) and termini ante quem (t.a.q.), which are treated as a given probability density function f(t). This function may take any form, a single date (i.e., with a probability of 1), a continuous uniform distribution (any time between two dates), or a bespoke density (as with calibrated radicarbon dates). Inputs of this function take samples drawn from their respective density functions.

Usage

gibbs_ad(
  sequences,
  finds = NULL,
  samples = 10^5,
  tpq = NULL,
  taq = NULL,
  alpha = -5000,
  omega = 1950,
  trim = TRUE,
  rule = "naive"
)

## S3 method for class 'list'
gibbs_ad(
  sequences,
  finds = NULL,
  samples = 10^5,
  tpq = NULL,
  taq = NULL,
  alpha = -5000,
  omega = 1950,
  trim = TRUE,
  rule = "naive"
)

Arguments

sequences

A list of relative sequences of elements (e.g., contexts).

finds

Optional. A list of finds related to (contained in) the elements of sequences. If one includes this ob

samples

Number of samples. Default is 10^5.

tpq

A list containing termini post quem. Each object in the list consists of:

  • id A character ID of the t.p.q., such as a reference or number.

  • assoc The element in code to which the t.p.q. is associated.

  • samples A vector of samples drawn from the appertaining probability density function of that t.p.q.

taq

A list containing termini ante quem. Each object in the list consists of:

  • id A character ID of the t.a.q., such as a reference or number.

  • assoc The element in code to which the t.p.q. is associated.

  • samples A vector of samples drawn from the appertaining probability density function of that t.p.q.

alpha

An initial t.p.q. to limit any elements which may occur before the first provided t.p.q. Default is -5000.

omega

A final t.a.q. to limit any elements which may occur after the after the last provided t.a.q. Default is 1950.

trim

A logical value to determine whether elements that occur before the first t.p.q. and after the last t.a.q. should be ommitted from the results (i.e., to "trim" elements at the ends of the sequence, whose marginal densities depend on the selection of alpha and omega). Default is TRUE.

rule

The rule for computing an estimated date of production of a find-type, either "earliest", selecting a production date between the earliest deposition of that type and the next most earliest context, or "naive" (the default), which will select a production date any time between the distribution of that "earliest" date and the depositional date of that artifact.

Value

A list object of class marginals which contains the following:

Examples

x <- c("A", "B", "C", "D", "E", "F", "G", "H", "I", "J")
y <- c("B", "D", "G", "H", "K")
z <- c("F", "K", "L", "M")
contexts <- list(x, y, z)

f1 <- list(id = "find01", assoc = "D", type = c("type1", "form1"))
f2 <- list(id = "find02", assoc = "E", type = c("type1", "form2"))
f3 <- list(id = "find03", assoc = "G", type = c("type1", "form1"))
f4 <- list(id = "find04", assoc = "H", type = c("type2", "form1"))
f5 <- list(id = "find05", assoc = "I", type = "type2")
f6 <- list(id = "find06", assoc = "H", type = NULL)

artifacts <- list(f1, f2, f3, f4, f5, f6)
 
# external constraints
coin1 <- list(id = "coin1", assoc = "B", type = NULL, samples = runif(100,-320,-300))
coin2 <- list(id = "coin2", assoc = "G", type = NULL, samples = runif(100,37,41))
destr <- list(id = "destr", assoc = "J", type = NULL, samples = 79)

tpq_info <- list(coin1, coin2)
taq_info <- list(destr)

result <- gibbs_ad(contexts, finds = artifacts, samples = 10^4, tpq = tpq_info, taq = taq_info)

[Package eratosthenes version 0.0.2 Index]