gammadistribution: Gamma Distribution

density_gammaR Documentation

Gamma Distribution

Description

Density, cumulative distribution function and random generation for a Gamma distribution.

Usage

density_gamma(shape, scale, x)

cdf_gamma(shape, scale, x)

random_gamma(shape, scale, n)

Arguments

shape, scale

shape and scale parameters.

x

vector of quantiles.

n

number of observations.

Value

numeric vector

Functions density_XXX and cdf_t return numeric vectors of same length as x. Function random_XXX returns a numeric vector of length n.

Examples


# Probability density function for a Gamma distribution
z <-density_gamma(shape = 7.5, scale =0.5 , x=.001 * seq(0, 300, 1))
# Computing the probability that the random variable X following a Gamma distribution
# with shape 1 and scale 2 is lower than x
z<-cdf_gamma(shape = 1, scale = 2, x = 1:10)
z
# Generating a random vector with each component drawn from a Gamma distribution
# with shape 1 and scale 2
z<- random_gamma(shape = 1, scale = 2, n = 10)
z


rjd3toolkit documentation built on Sept. 21, 2026, 5:06 p.m.