GammaDistribution: Gamma distribution class

GammaDistributionR Documentation

Gamma distribution class

Description

This class defines the gamma distribution. It provides methods for fitting the distribution to data and generating random samples.

Super class

BaseDistribution -> GammaDistribution

Methods

Public methods

Inherited methods

GammaDistribution$new()

Creates a new gamma distribution.

Usage
GammaDistribution$new(shape = 1, scale = 1)
Arguments
shape

A numeric value specifying the shape parameter of the gamma distribution. Defaults to 1.0.

scale

A numeric value specifying the scale parameter of the gamma distribution. Defaults to 1.0.

Returns

An instance of the gamma distribution as an object of class GammaDistribution.


GammaDistribution$get_shape()

Retrieves the shape parameter of the gamma distribution.

Usage
GammaDistribution$get_shape()
Returns

A numeric value storing the shape parameter of the gamma distribution.


GammaDistribution$get_scale()

Retrieves the scale parameter of the gamma distribution.

Usage
GammaDistribution$get_scale()
Returns

A numeric value storing the scale parameter of the gamma distribution.


GammaDistribution$clone()

The objects of this class are cloneable with this method.

Usage
GammaDistribution$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

gd <- GammaDistribution$new(
  shape = 1,
  scale = 5
)
gd$get_shape()
gd$get_scale()
gd$get_mean()
gd$get_variance()
gd$random(10)
gd$fit(gd$random(100))
gd$get_shape()
gd$get_scale()

midi documentation built on July 6, 2026, 1:08 a.m.