
Generate Data 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] 37.36134 21.08078 32.87338 81.29843 65.99487 35.53520 24.82525 37.02113
#> [9] 42.57515 30.69142
# 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: 109.7345
#> 2: 111.0048
#> 3: 111.2539
#> 4: 232.8109
#> 5: 189.5243