Description Usage Arguments Note Examples
View source: R/mc_rv_simulation.R
Simulate gamma random variates
1 |
n |
Positive integer; the number of samples. |
shape |
Positive number; the shape of the gamma distribution. |
scale |
Positive number; the scale of the gamma distribution. |
method |
'base' or 'inv_tf'; 'base' refers to 'stats::rgamma' while 'inv_tf' refers to inverse transform. |
Inverse transform is slower, but it is provided to remedy that base R uses two algorithms to simulate gamma random variables in different parameter regions, which creates a discontinuity in the pathwise derivative.
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.