Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

warnProb

Calculate posterior probability of the weaning parameters


Description

warnProb calculate posterior probabilities under a given class "warn" object and a given parameter range.

Usage

## Default S3 method:
warnProb(object, weaning.par = "age", range.x, range.y = NA)

Arguments

object

an object of class "warn".

weaning.par

character for the intended weanig parameter. The allowed values are "age" (the default), "enrich", and "wnfood".

range.x, range.y

numeric vectors of length 2, giving the range of the intended weanig parameters. For example, range.x corresponds to the age at the start of weaning if weaning.par = "age". range.y is used only if weaning.par = "age", and corresponds to the age at the end of weaning. Fractional point lower than e-002 is rounded.

Details

warnProb calculates posterior probability of the weaning parameter that ranges between designated range. Parameter distribution is represented as the product of kernel density estimation performed in warn. Weaning ages are estimated from two-dimensional probability distribution, and nitrogen isotope ratios (d15Ns) of enrichment factor and weaning food derived collagen are from one-dimensional.

Value

warnProb returns an object of class "warnProb" which is a subclass of "warn".
The functions summary and plot are used to obtain and indicate a summary and figure of the results, respectively.
An object of class "warnProb" at least has following list components in addition to those succeeded from "warn":

probability

posterior probability of parameter that range between the designated range.

range

a vector giving the range of the intended weanig parameter.

weaning.par

a character indicating the weaning parameter used.

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

Examples

## 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 probabilities for a given parameter range.
warnprob.age <- warnProb(warn.lerna, "age", c(0.0, 1.1), c(0.8, 2.3))
warnprob.enrich <- warnProb(warn.lerna, "enrich", c(1.5, 3.5))
warnprob.wnfood <- warnProb(warn.lerna, "wnfood", c(7.3, 8.8))

## Indicate summary.
summary(warnprob.age)
summary(warnprob.enrich)

## Plot.
plot(warnprob.age)
plot(warnprob.wnfood)

## Plot with image.
plot(warnprob.age, is.image = TRUE)

WARN

Weaning Age Reconstruction with Nitrogen Isotope Analysis

v1.2-4
GPL (>= 3)
Authors
Takumi Tsutaya
Initial release
2019-10-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.