| rtexp | R Documentation |
This function is a simple wrapper around the rexp function, allowing users to directly sample values from a left-truncated exponential distribution.
rtexp(n, rate, l=NULL)
n |
How many draws to make. |
rate |
A numeric vector of numbers > 0, specifying the rate parameter of the exponential distribution. |
l |
A numeric vector of numbers > 0, specifying the value at which the distribution should be left-truncated. |
This function mostly exists so it can be used conveniently when performing discrete-event simulations.
Returns a numeric vector of length n.
Robin Denz
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.