rgammashift {highDmean} | R Documentation |
Random sample from shifted gamma distribution
Description
This function generates random samples from shifted gamma distribution. That is, random samples are first generated from gamma distribution with shape parameter shape
and scale parameter scale
and then the mean of the gamma distribution, shape
*scale
, is subtracted from the sample.
Usage
rgammashift(n, shape, scale)
Arguments
n |
number of observations. |
shape |
the shape parameter of gamma distribution |
scale |
the scale parameter of gamma distribution #' |
Value
A vector of n
values. It is equivalent to rgamma(n, shape, scale)- shape * scale.
Examples
# Generate a sample of shifted gamma observations with shape parameter 4 and scale parameter 2.
set.seed(10)
rgammashift(n = 5, shape =4, scale = 2)
# It is equivalent to
set.seed(10)
rgamma(n = 5, shape=4, scale=2)- 4 * 2
[Package highDmean version 0.1.0 Index]