powered by
This function is a simple wrapper around the rexp function, allowing users to directly sample values from a left-truncated exponential distribution.
rexp
rtexp(n, rate, l=NULL)
Returns a numeric vector of length n.
n
How many draws to make.
A numeric vector of numbers > 0, specifying the rate parameter of the exponential distribution.
A numeric vector of numbers > 0, specifying the value at which the distribution should be left-truncated.
Robin Denz
This function mostly exists so it can be used conveniently when performing discrete-event simulations.
library(simDAG) rtexp(n=10, rate=0.05, l=20) # without replacement dag <- empty_dag() + node("A", type="rtexp", rate=0.01, l=100) data <- sim_from_dag(dag, n_sim=5) head(data)
Run the code above in your browser using DataLab