estimate_range: Estimate ranges from two or more calibrations

View source: R/Sensitivity.R

estimate_rangeR Documentation

Estimate ranges from two or more calibrations

Description

Calculates the ranges of summary statistics from the output of two or more runs of the MCMC algorithm. Results are given in calendar years for statistics that estimate them.

Usage

estimate_range(
  mcmc,
  position,
  app = "bcal",
  estimates = c("mean", "q1", "median", "q3", "ci.inf", "ci.sup"),
  quiet = "partial",
  bin_width = 1,
  decimal = ".",
  separator = ","
)

Arguments

mcmc

A vector of path names to the MCMC files.

position

Numeric vector containing the positions of the columns corresponding to the MCMC chains of interest, or a vector of column names.

app

Name of the application that created the MCMC files, one of bcal, oxcal, chronomodel.

estimates

Numeric vector containing the positions of the columns corresponding to the statistics of interest returned by the multi_marginal_statistics() function, or a vector of column names.

quiet

One of no (default) to allow messages and warnings, partial to suppress messages and allow warnings, or yes to suppress messages and warnings.

bin_width

If app is set to bcal, the bin width specified for the BCal calibration. Defaults to the BCal default of 1.

decimal

If app is set to chronomodel, either . (default) or ,, the two choices offered by ChronoModel.

separator

If app is set to chronomodel, the character used to separate fields in the CSV file. Defaults to ,.

Details

This function is useful for estimating the sensitivity of calibration results to different model parameters.

Value

A list with the following components:

range_table

A matrix of estimate ranges.

mean

The mean of the ranges in range_table.

sd

The standard deviation of the ranges in range_table.

min

The minimum of the ranges in range_table.

median

The median of the ranges in range_table.

max

The maximum value of the ranges in range_table.

Author(s)

Thomas S. Dye, tsd@tsdye.online

Examples

## Not run: 
## Generate 0's
res <- estimate_range(mcmc = c("http://tsdye.online/AP/ox.csv",
"http://tsdye.online/AP/ox.csv"), position = c(1, 2),
app = "oxcal", quiet = "yes")
sum(res$range_table)

## End(Not run)


ArchaeoPhases documentation built on June 22, 2022, 1:05 a.m.