rexp_truncated {genscore} | R Documentation |
Generates translated and truncated exponential variables.
Description
Generates translated and truncated exponential variables.
Usage
rexp_truncated(n, lo, hi)
Arguments
n |
An integer, the number of samples to return. |
lo |
A double, the lower limit of the distribution, cannot be |
hi |
A double, the upper limit of the distribution. |
Details
Returns n
random variables from the translated truncated exponential distribution with density \exp(-(x-lo))/(1-\exp(lo-hi))
on [lo,hi]
.
Value
n
random variables from the translated truncated exponential distribution.
Examples
hist(rexp_truncated(1e4, 0, Inf), breaks=200)
hist(rexp_truncated(1e4, 10, 12), breaks=200)
hist(rexp_truncated(1e4, -2, 2), breaks=200)
hist(rexp_truncated(1e4, -10, 0), breaks=200)
hist(rexp_truncated(1e4, -100, Inf), breaks=200)
hist(rexp_truncated(1e4, -100, -95), breaks=200)
[Package genscore version 1.0.2.2 Index]