pref_sample: Sample preferentially
Description
Sample values from an inhomogeneous Poisson process with intensity
c*f(t)^beta.Usage
pref_sample(f, lim = c(0, 1), c = 1, beta = 1, upper = NULL,
grid.len = 1000)
Arguments
f
function to be sampled from preferentially.
lim
lower and upper sampling bounds. Defaults to c(0,1).
c
numeric constant of proportionality for intensity. Defaults to 1.
beta
numeric power to which f is raised for intensity. Defaults to 1.
upper
numeric upper bound for function between limits defined by lim.
Used in thinning algorithm.
grid.len
integer if upper is undefined, automatically evaluates f at
grid.len points between min(lim) and max(lim) to find upper bound.