Calculate the relative density for two dates or, more generally, for two different specifications of the density aside from a simple date. The additional specifications that are supported are the peak value and the mean density on an interval. For a simple date, spec1/spec2 should be scalar real numbers. For a date range, spec1/spec2 should be real vectors with a length of 2. For the peak, spec1/spec2 should be the string 'peak'.

By default, this calculation is done for all the Bayesian samples in bayesian_soln which is the result of a call to sample_theta. Optionally, a subset can be specified via the input ind, which should be a vector of integer indices at which to do the calculation. To save computation if either spec1 or spec2 is 'peak', the result of a call to summarize_bayesian_inference for which do_summary was TRUE can be input.

calc_relative_density(
  bayesian_soln,
  density_model,
  spec1,
  spec2,
  rc_meas = list(),
  calib_df = list(),
  ind = NA,
  bayesian_summary = NA
)

Arguments

bayesian_soln

The result of a call to sample_theta

density_model

The density model (see set_density_model).

spec1

The specification for the first density (see details)

spec2

The specification for the second density (see details)

rc_meas

The radiocarbon measurements (see import_rc_data; optional: if not provided, bayesian_summary must be provided).

calib_df

The calibration data frame (see load_calib_curve; optional: if not provided, bayesian_summary must be provided).

ind

Indices at which to do the calculation (optional; by default, all the samples in bayesian_summary are used).

bayesian_summary

The result of a call to summarize_bayesian_inference. (optional; if not provided, it is calculated, which requires that rc_meas and calib_df be provided).

Value

A vector of relative densities (f_spec1 / f_spec2)

See also