p3 {StratPal} | R Documentation |
simulate Poisson point process
Description
Simulates events in the interval from
to to
based on a Poisson point process with rate rate
. If the parameter n
is used, the number of fossils is conditioned to be n
In the context of paleontology, these events can be interpreted as fossil occurrences or first/last occurrences of species. In this case, the rate is the average number of fossil occurrences (resp first/last occurrences) per unit
Usage
p3(rate, from, to, n = NULL)
Arguments
rate |
strictly positive number, rate of events (avg events per unit) |
from |
lowest boundary of observed interval |
to |
upper boundary of observed interval |
n |
integer of NULL (default). Number of events to return. If NULL, the number is random and determined by the rate parameter |
Value
a numeric vector with timing/location of events.
See Also
p3_var_rate()
for the variable rate implementation
Examples
# for fossil occ.
x = p3(rate = 5, from = 0, to = 1) # 5 fossil occurrences per myr on avg.
hist(x, xlab = "Time (Myr)", ylab = "Fossil Occurrences" )
x = p3(rate = 3, from = 0, to = 4)
hist(x, main = paste0(length(x), " samples")) # no of events is random
x = p3(rate = 3, from = 0, to = 4, n = 10)
hist(x, main = paste0(length(x), " samples")) # no of events is fixed to n
# see also
#vignette("event_data")
# for details on usage and applications to paleontology