postPredSPD: SPD-based Posterior Predictive Check

View source: R/postPredSPD.R

postPredSPDR Documentation

SPD-based Posterior Predictive Check

Description

Generates SPDs from posterior samples.

Usage

postPredSPD(
  x,
  errors,
  calCurve,
  model,
  a,
  b,
  params,
  nsim,
  method = NULL,
  spdnormalised = TRUE,
  datenormalised = TRUE,
  ncores = 1,
  verbose = TRUE
)

Arguments

x

a vector of observed uncalibrated radiocarbon ages.

errors

a vector of standard deviations corresponding to each estimated radiocarbon age.

calCurve

character string naming a calibration curve already provided with the rcarbon package (currently 'intcal20','intcal13','intcal13nhpine16','shcal20','shcal13','shcal13shkauri16',ā€¯marine13','marine20').

model

growth model

a

lower (earliest) limit of the distribution (in BP).

b

upper (latest) limit of the distribution (in BP).

params

list of vectors containing model parameters. The names attribute of each vector should match growth model parameters.

nsim

number of SPDs to be generated. Default is the length of the parameter vectors supplied in the argument params.

method

method for the creation of random dates from the fitted model. Either 'uncalsample' or 'calsample'.

spdnormalised

a logical variable indicating whether the total probability mass of the SPD is normalised to sum to unity for both observed and simulated data. Default is TRUE.

datenormalised

a logical variable indicating whether dates should be normalised to sum to unity or not. Default is TRUE.

ncores

number of cores used for for parallel execution. Default is 1.

verbose

a logical variable indicating whether extra information on progress should be reported. Default is TRUE.

Value

An object of class spdppc with the following elements

  • obs A data.frame containing the years (in Cal BP) and the corresponding summed probability in the observed data.

  • spdmat A matrix containing the summed probability distribution of the simulated data.


nimbleCarbon documentation built on Aug. 14, 2023, 5:08 p.m.