simulateCalendarDates {ADMUR}R Documentation

Converts calendar dates to 14C dates

Description

Randomly samples calendar dates from a model, including dates slightly outside the model date range to avoid edge effects.

Usage

simulateCalendarDates(model, n)

Arguments

model

A data frame including columns 'year' and 'pdf'

n

The number of dates to sample.

Details

Samples n random calendar dates from a model pdf. This model must be defined in terms of a PDF vector and the corresponding calendar years. This can be provided at any preferred temporal resolution. For example, an exponential model can be provided with the PDF in annual intervals, whilst CPL model needs only the hinge points. convertPars will convert parameters into the required model format.

Value

Returns a vector of calendar dates

Examples

	# under a uniform model
	model <- convertPars(pars=NULL, years=5000:6000,type='uniform')
	sims <- simulateCalendarDates(model, 1000)
	range(sims)
	
	# simulate under an exponential model
	model <- convertPars(pars=0.001, years=5000:6000,type='exp')
	sims <- simulateCalendarDates(model, 1000)
	range(sims)
	
	# under a CPL model
	model <- convertPars(pars=runif(5), years=5000:6000,type='CPL')
	sims <- simulateCalendarDates(model, 1000)
	range(sims)
	

[Package ADMUR version 1.0.3 Index]