GammaR: The Gamma Distribution (Regression Parameterization)

View source: R/GammaR.R

GammaRR Documentation

The Gamma Distribution (Regression Parameterization)

Description

A gamma distribution in regression parameterization with mean mu and scale parameter sigma.

Usage

GammaR(mu = numeric(), sigma = numeric())

Arguments

mu

mean of the distribution. Must be positive.

sigma

scale parameter. Must be positive.

Details

We recommend reading this documentation on https://zeileis.github.io/distributions3/, where the math will render with additional detail.

In the following, let X be a Gamma random variable in regression parameterization with mean mu = \mu and scale sigma = \sigma. The first four moments are given below. For computing densities, probabilities, quantiles, etc., the distribution is reparameterized internally to use shape \alpha = 1/\sigma^2 and rate \beta = 1/(\mu \sigma^2) as in the classic Gamma() distribution.

Support: x \in (0, \infty)

Mean: \mu

Variance: \mu^2 \sigma^2

Skewness: 2 \sigma

Excess kurtosis: 6 \sigma^2

Value

A GammaR object.

Examples


set.seed(27)

X <- GammaR(mu = 2, sigma = 0.5)
X

random(X, 10)

pdf(X, 1)
log_pdf(X, 1)

cdf(X, 1)
quantile(X, 0.7)

cdf(X, quantile(X, 0.7))
quantile(X, cdf(X, 1))

distributions3 documentation built on Nov. 27, 2026, 5:07 p.m.