
Sample values from a left-truncated exponential distribution
rtexp.RdThis function is a simple wrapper around the rexp function, allowing users to directly sample values from a left-truncated exponential distribution.
Details
This function mostly exists so it can be used conveniently when performing discrete-event simulations.
Examples
library(simDAG)
rtexp(n=10, rate=0.05, l=20)
#> [1] 81.29843 65.99487 35.53520 24.82525 37.02113 42.57515 30.69142 21.94689
#> [9] 22.20097 22.25078
# without replacement
dag <- empty_dag() +
node("A", type="rtexp", rate=0.01, l=100)
data <- sim_from_dag(dag, n_sim=5)
head(data)
#> A
#> <num>
#> 1: 232.8109
#> 2: 189.5243
#> 3: 533.3715
#> 4: 263.9551
#> 5: 326.7810