rtrunc_gamma {DTEBOP2} | R Documentation |
Generate Random Variables from a Truncated Gamma Distribution.
Description
Simulates random variables from a truncated gamma distribution, where the gamma distribution is bounded between user-specified lower and upper limits. This function is typically used to define priors (e.g., for the separation time in delayed treatment effect models).
Usage
rtrunc_gamma(n, L, U, shape, scale)
Arguments
n |
Integer. Number of random variables to generate. |
L |
Numeric. Lower bound of the truncation interval. Must satisfy |
U |
Numeric. Upper bound of the truncation interval. Must satisfy |
shape |
Numeric. Shape parameter of the underlying gamma distribution. |
scale |
Numeric. Scale parameter of the underlying gamma distribution. |
Value
A numeric vector of length n
, containing random variables drawn from a gamma distribution truncated to the interval [L, U]
.
Examples
rtrunc_gamma(10, 1, 1, 1, 1)
[Package DTEBOP2 version 1.0.3 Index]