warnCI: Calculate credible intervals for posterior probability of the...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/warn_s3.R

Description

warnCI calculate credible intervals (CIs) of posterior probabilities under a given class "warn" object and a given threshold of CIs.

Usage

1
2
## Default S3 method:
warnCI(object, threshold = 0.95)

Arguments

object

an object of class "warn".

threshold

numeric scalar or vector giving the threshold of CI for posterior probabilities of weaning ages, nitrogen isotope ratios (d15Ns) of enrichment factor, and d15Ns of collagen derived entirely from weaning foods. Minimum range with over (threshold * 100)% of summed posterior probability is calculated. If scalar is given, value is repeated. Values between 0 and 1 must be given.

Details

warnCI calculates minimum ranges with over (threshold * 100)% of summed posterior probability of the weaning parameters. Posterior probabilities are represented as the product of kernel density estimation performed in warn. CIs of weaning ages are obtained from two-dimensional probability distribution, and those of d15Ns of enrichment factor and collagen derived entirely from weaning foods are from one-dimensional. Posterior probability distributions with multiple notable peaks are not supported by warnCI.

Value

warnCI returns an object of class "warnCI" which is a subclass of "warn".
The function plot is used to indicate figures of the results.
An object of class "warnCI" has following list components in addition to those succeeded from "warn":

ci.age

a list containing the CIs for the combination of t1 and t2, and its summed posterior probability.

ci.enrich

a list containing the CI for the d15N-enrichment from mother to infant, and its summed posterior probability.

ci.wnfood

a list containing the CI for the d15N value of collagen derived entirelly from weaning foods, and its summed posterior probability.

ci.threshold

a vector showing the thresholds used to calculate the CIs.

Author(s)

Takumi Tsutaya developed this model.

References

Tsutaya, T., and Yoneda, M. (2013). Quantitative reconstruction of weaning ages in archaeological human populations using bone collagen nitrogen isotope ratios and approximate Bayesian computation. PLoS ONE 8, e72327.

See Also

WARN, warn, warnProb, plot.warnCI

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Data from the Lerna population.
nonadult <- subset(lerna, lerna$age <= 10)
adult <- subset(lerna, lerna$age > 17)
female <- subset(adult, adult$sex == "f")

## Calculate maximum density estimators using ABC.
warn.lerna <- warn(
  age = nonadult$age,
  d15N = nonadult$d15N,
  female.mean = mean(female$d15N),
  num.particle = 500,
  female.sd = sd(female$d15N),
  prior = c(0.2, 0.2, 1.6, 0.2, 2.5, 0.2, 8.1, 0.2, 0, 0.7),
  tolerances = c(1.5, 0.7))

## Calculate over (>=) 50% CIs.
warn.lerna.50ci <- warnCI(warn.lerna, 0.50)

## Indicate result.
warn.lerna.50ci

## Plot.
plot(warn.lerna.50ci, "age")
plot(warn.lerna.50ci, "enrich")

WARN documentation built on Oct. 30, 2019, 9:57 a.m.