Main Content

Gamma Distribution

Fit, evaluate, and generate random samples from gamma distribution

Statistics and Machine Learning Toolbox™ offers multiple ways to work with the gamma distribution.

  • Create a probability distribution object GammaDistribution by fitting a probability distribution to sample data or by specifying parameter values. Then, use object functions to evaluate the distribution, generate random numbers, and so on.

  • Work with the gamma distribution interactively by using the Distribution Fitter app. You can export an object from the app and use the object functions.

  • Use distribution-specific functions with specified distribution parameters. The functions can accept parameters of multiple gamma distributions.

  • Use the generic distribution functions with the specified distribution name "Gamma" and corresponding parameters.

To learn about the gamma distribution, see Gamma Distribution.


GammaDistributionGamma probability distribution object


Distribution FitterFit probability distributions to data
Probability Distribution FunctionInteractive density and distribution plots


expand all

Create GammaDistribution Object

makedistCreate probability distribution object
fitdistFit probability distribution object to data

Work with GammaDistribution Object

cdfCumulative distribution function
gatherGather properties of Statistics and Machine Learning Toolbox object from GPU (Since R2020b)
icdfInverse cumulative distribution function
iqrInterquartile range of probability distribution
meanMean of probability distribution
medianMedian of probability distribution
negloglikNegative loglikelihood of probability distribution
paramciConfidence intervals for probability distribution parameters
pdfProbability density function
plotPlot probability distribution object (Since R2022b)
proflikProfile likelihood function for probability distribution
randomRandom numbers
stdStandard deviation of probability distribution
truncateTruncate probability distribution object
varVariance of probability distribution
gamcdfGamma cumulative distribution function
gampdfGamma probability density function
gaminvGamma inverse cumulative distribution function
gamlikeGamma negative log-likelihood
gamstatGamma mean and variance
gamfitGamma parameter estimates
gamrndGamma random numbers
randgGamma random numbers with unit scale
cdfCumulative distribution function
icdfInverse cumulative distribution function
pdfProbability density function
randomRandom numbers
mleMaximum likelihood estimates
distributionFitterOpen Distribution Fitter app
histfitHistogram with a distribution fit
plotPlot probability distribution object (Since R2022b)
qqplotQuantile-quantile plot
randtoolInteractive random number generation


  • Gamma Distribution

    The gamma distribution models sums of exponentially distributed random variables.