Products & Services Solutions Academia Support User Community Company

Learn more about Statistics Toolbox   

gampdf - Gamma probability density function

Syntax

Y = gampdf(X,A,B)

Description

Y = gampdf(X,A,B) computes the gamma pdf at each of the values in X using the corresponding shape parameters in A and scale parameters in B. X, A, and B can be vectors, matrices, or multidimensional arrays that all have the same size. A scalar input is expanded to a constant array with the same dimensions as the other inputs. The parameters in A and B must all be positive, and the values in X must lie on the interval [0 ∞).

The gamma pdf is

The gamma probability density function is useful in reliability models of lifetimes. The gamma distribution is more flexible than the exponential distribution in that the probability of a product surviving an additional period may depend on its current age. The exponential and χ2 functions are special cases of the gamma function.

Examples

The exponential distribution is a special case of the gamma distribution.

mu = 1:5;

y = gampdf(1,1,mu)
y =
  0.3679  0.3033  0.2388  0.1947  0.1637

y1 = exppdf(1,mu)
y1 =
  0.3679  0.3033  0.2388  0.1947  0.1637

See Also

pdf, gamcdf, gaminv, gamstat, gamfit, gamlike, gamrnd

Gamma Distribution

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS