rgammashift: The centered gamma distribution

Description Usage Arguments Value Author(s) Examples

View source: R/highD2popfunctions.R

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 [email protected], 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 29, 2017, 6:09 p.m.