R/bayesian_inference_functions.R
calc_half_life_from_peak.Rd
For each sample, calculate the time it takes for the density to decrease by half from the peak (or by another use-provided ratio)
calc_half_life_from_peak( bayesian_soln, density_model, rc_meas = list(), calib_df = list(), prop_change = 0.5, bayesian_summary = NA, peak_range = NA )
bayesian_soln | The solution, a list-like object of class bd_bayesian_soln (see sample_theta). |
---|---|
density_model | The density model (see set_density_model). |
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). |
prop_change | The relative decrease in density to use for the duration calculation (default: 0.5). |
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). |
peak_range | A range over which to search for the peak of the density function (default: NA, which means that tau_min to tau_max is used for the range). |
A vector of "half-lives" (proportional change set by prop_change)
For each sample, calculate the time it takes for the density to decrease by half from the peak. Optionally, a different proportion can be used than the default prop_change = 0.5. For example, with prop_change = 0.1 the time it takes for the density to decrease by 10% is used. If the relative density is not reached, the half life for the sample is set to NA. If there is no interior peak in the range peak_range, which is tau_min to tau_max by default, the half life is set to NA.
import_rc_data()
for the format of rc_meas
set_density_model()
for the format of density_model
load_calib_curve()
for the format of calib_df