rgamma_mu: Simulation for a Gamma Distribution with mean parametrization

Description Usage Arguments Details Value Author(s) Examples

Description

Random generator for the Gamma distribution, using parameters mean and sigma. This is an alternative to rgamma function.

Usage

1
rgamma_mu(n, mu, sigma)

Arguments

n

Number of observations.

mu

Mean parameter of the Gamma distribution.

sigma

Scale parameter of the Gamma distribution.

Details

The Gamma distribution with parameters mean = mu and sigma = s is defined as

f(x) = (s/mu)^s /Gamma(s) x^(s-1) e^-(s*x/mu)

for x >= 0, mu > 0 and s > 0.

The mean and variance of this parametrization are E(x) = mu and Var(X) = mu^2/sigma

Value

A vector of length n, representing the realization of the Gamma distribution with parameters mean and sigma.

Author(s)

Erick A. Chacon-Montalvan

Examples

1
rgamma_mu(100, 5, 5)

ErickChacon/datasim documentation built on March 25, 2020, 7:53 p.m.