View source: R/simulate_event_counts.R
simulate_event_counts | R Documentation |
Simulate event counts.
simulate_event_counts(
process,
times,
nevents,
nsamples,
interval = NULL,
binning_resolution = -1,
BP = T,
c14 = T,
chronun_matrix = NULL,
new_times = NULL,
bigmatrix = NULL,
bigfileprefix = "count_ensemble",
parallel = T
)
process |
A vector describing the background event-count process (i.e., conditional mean of count-based random variable). This will be passed to R's 'sample()' function as the 'prob' parameter. |
times |
A vector of event times to sample from. |
nevents |
Integer number of events with uncertain event-times. |
nsamples |
Integer number of sample sequences to draw. |
binning_resolution |
Resolution of the desired time intervals (time bins). It should be negative if using the BP timescale (i.e, if BP = T). |
BP |
Logical (default T). Assume a Before Present timescale? |
c14 |
Logical (default T). Are the events dated with radiocarbon? If so, the R package 'IntCal' will be used to simulate c14 dates from the 'true' samples of the 'times' vector and then calibrate those dates. |
chronun_matrix |
A matrix containing discrete estimates describing chronological uncertainty. Each column should contain density estimates for a single event and the rows should each refer to discrete times. If c14 = F, then this matrix must be included. |
new_times |
A vector of times corresponding to the rows in the chronun matrix. |
bigmatrix |
A character vector containing a path pointing to folder for storing the bigmemory matrix descriptor file and matrix. Default is NULL, in which case it is assumed that a bigmatrix is not being used. |
bigfileprefix |
A character vector that will be used as a prefix for naming the bigmemory matrix descriptor file and matrix (*_desc and *_mat will be appended). Default is "count_ensemble"—not used if bigmatrix=NULL. |
parallel |
Logical (default = T). Use parallel (multiple processors) to speed up computation? |
A list with 1) a matrix containing probable event count sequences or a file path pointing to a file-backed bigmatrix (an event count ensemble); 2) a dataframe containing the true (chronological-error-free) event-count sample; 3) a vector of time-stamps corresponding to the rows in the event count ensemble matrix; and 4) a vector of simulated uncalibrated radiocarbon dates (NULL if c14 == FALSE).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.