Title: | Archaeological Synchronism |
---|---|
Description: | Estimates unknown historical or archaeological dates subject to relationships with other dates and absolute constraints, derived as marginal densities from the full joint conditional distribution. Includes rule-based estimation of the production dates of artifact types. Collins-Elliott (2024) <https://volweb.utk.edu/~scolli46/sceGUTChronology.pdf>. |
Authors: | Stephen A. Collins-Elliott [aut, cre]
|
Maintainer: | Stephen A. Collins-Elliott <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.0.2 |
Built: | 2025-02-18 05:57:19 UTC |
Source: | https://github.com/scollinselliott/eratosthenes |
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 . 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.
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" )
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" )
sequences |
A |
finds |
Optional. A |
samples |
Number of samples. Default is |
tpq |
A
|
taq |
A
|
alpha |
An initial t.p.q. to limit any elements which may occur before the first provided t.p.q. Default is |
omega |
A final t.a.q. to limit any elements which may occur after the after the last provided t.a.q. Default is |
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 |
rule |
The rule for computing an estimated date of production of a find-type, either |
A list
object of class marginals
which contains the following:
deposition
A list
of samples from the marginal density of each context's depositional date.
externals
A list
of samples of the marginal density of each constrant (t.p.q. and t.a.q.]), as conditioned upon the occurrence of other depositional
production
If a finds
object has been input, samples of the marginal density of the production date of finds types will be included in the output.
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)
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)
For a list
of multple partial sequences (of vector
objects), generate another list
which, for each element, gives the elements that occur before it ("quae antea"), i.e., analogous to a recursive trace through all partial sequences from right to left. An element "alpha"
is added to all sets to avoid empty vectors. See also quae_postea
.
quae_antea(obj) quae_antea(obj)
quae_antea(obj) quae_antea(obj)
obj |
A |
A list
of vector
objects, which contain the elements that occur before any one given element in the input sequences.
x <- c("A", "B", "C") y <- c("B", "D", "E", "C", "F") z <- c("C", "G") a <- list(x, y, z) quae_antea(a)
x <- c("A", "B", "C") y <- c("B", "D", "E", "C", "F") z <- c("C", "G") a <- list(x, y, z) quae_antea(a)
For a list
of multple partial sequences (of vector
objects), generate another list
which, for each element, gives the elements that occur after it ("quae postea"), i.e., analogous to a recursive trace through all partial sequences from left to right. A final element "omega"
is added to all sets to avoid empty vectors. See also quae_antea
.
quae_postea(obj) ## S3 method for class 'list' quae_postea(obj)
quae_postea(obj) ## S3 method for class 'list' quae_postea(obj)
obj |
A |
A list
of vector
objects, which contain the elements that occur after any one given element in the input sequences.
x <- c("A", "B", "C") y <- c("B", "D", "E", "C", "F") z <- c("C", "G") a <- list(x, y, z) quae_postea(a)
x <- c("A", "B", "C") y <- c("B", "D", "E", "C", "F") z <- c("C", "G") a <- list(x, y, z) quae_postea(a)
Given an "input" sequence of elements and another "target" seqeunce that contains fewer elements in a different order, shift the order of the input sequence to match that of the target, keeping all other elements as proximate to one another as possible. This adjusted ranking is accomplished using piecewise linear interpolation between joint elements ranks. That is, joint rankings are plotted, with input rankings along the axis and target rankings on the
axis. Remaining rankings in the input sequence are assigned a ranking of
based on the piecewise linear function between joint rankings. If the rank order of elements in the target are identical to those in the input, the result is identical to the input. A minimum number of three joint elements in both the input and target are required.
seq_adj(input, target) ## S3 method for class 'character' seq_adj(input, target)
seq_adj(input, target) ## S3 method for class 'character' seq_adj(input, target)
input |
A vector of elements in a sequence. |
target |
A vector of elements in a sequence, containing at least three of the same elements as |
A vector of the adjusted sequence.
x <- c("A", "B", "C", "D", "E", "F", "G", "H", "I", "J") # the input sequence y <- c("D", "A", "J") # the target sequence seq_adj(x, y)
x <- c("A", "B", "C", "D", "E", "F", "G", "H", "I", "J") # the input sequence y <- c("D", "A", "J") # the target sequence seq_adj(x, y)
For a list
of partial sequences (of vector
objects), check to see that joint elements of each occur the same order. That is, for two sequences with elements and
, all joint elements must occur in the same order to pass the check. Two sequences
and
would not pass this check as the elements
and
occur in different orders in either sequence.
seq_check(obj) ## S3 method for class 'list' seq_check(obj)
seq_check(obj) ## S3 method for class 'list' seq_check(obj)
obj |
A |
TRUE
or FALSE
x <- c("A", "B", "C", "D", "E") y <- c("B", "D", "F", "E") a <- list(x, y) seq_check(a) z <- c("B", "F", "C") b <- list(x, y, z) seq_check(b)
x <- c("A", "B", "C", "D", "E") y <- c("B", "D", "F", "E") a <- list(x, y) seq_check(a) z <- c("B", "F", "C") b <- list(x, y, z) seq_check(b)
Using a list
two or more partial sequences, all of which observe the same order of elements, create a single "synthetic" ranking. This is accomplished by counting the total number of elements after running a recursive trace through all partial sequences (via quae_postea
). If partial sequences are inconsistent in their rankings, a NULL
value is returned.
synth_rank(obj, ties = "average") ## S3 method for class 'list' synth_rank(obj, ties = "average")
synth_rank(obj, ties = "average") ## S3 method for class 'list' synth_rank(obj, ties = "average")
obj |
A |
ties |
The way in which ties are handled per the |
A single vector containing the synthesized ranking.
x <- c("A", "B", "C", "D", "E") y <- c("B", "D", "F", "E") a <- list(x, y) synth_rank(a)
x <- c("A", "B", "C", "D", "E") y <- c("B", "D", "F", "E") a <- list(x, y) synth_rank(a)