rgammashift: The centered gamma distribution

Description Usage Arguments Value Author(s) Examples

Description

Random generation for the Gamma distribution with parameters shape and scale centered so as to have mean zero.

Usage

1
rgammashift(n, shape, scale)

Arguments

n

number of observations to generate.

shape

shape parameter, must be strictly greater than zero.

scale

scale parameter, must be strictly greater than zero.

Value

a vector of length n of realizations from the centered gamma distribution with shape parameter shape and scale parameter scale.

Author(s)

Karl Gregory kgregory@mail.uni-mannheim.de, http://www.stat.tamu.edu/~kbgregory.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## The function is currently defined as
function (n, shape, scale) 
{
    x <- rgamma(n = n, shape = shape, scale = scale) - shape*scale
    return(x)
}


x <- rgammashift(500,4,2)

plot(density(x))

highD2pop documentation built on May 2, 2019, 5:11 a.m.