Definition of Gamma distribution

Hi all,

I’m using a Gamma distribution as pdf for one of my random variables.
The definition for the Gamma distribution is often based on either Gamma(shape,scale) (the Matlab definition used in gampdf()) or Gamma(shape,rate). If I understand the UQLab manual well, UQLab is using Gamma(rate,shape) as definition. It took me quite some time before realizing this. I guess it would be good to make this more explicit in the user manual.

Here’s a MWE to highlight the confusion:

InputOpts.Marginals(1).Name = ‘test’;
InputOpts.Marginals(1).Type = ‘Gamma’;
InputOpts.Marginals(1).Parameters = [1/0.4 2];

myInput = uq_createInput(InputOpts);

% compare with Matlab Gamma function
x = linspace(0,10,100);

So in summary, the message is that in UQLab one needs to reverse the arguments in the Gamma function (and use 1/0.4 instead of 0.4 because the rate is used instead of the scale). This seems a bit odd to me, but maybe there is a good reason for this?



Dear @bsanderse,

Thanks for the post. You are right, UQLab uses a different parameterization from the one in Matlab. I think both are reasonable because they correspond to the two ways of defining a Gamma distribution.

I hope it helps.

Dear Xujia,

Thanks for the quick reply.
My point is not so much about the scale vs. rate parameter (I understand that this is a matter of choice/preference), but that the order of the arguments is reversed in UQLab - this is not only inconsistent with Matlab but also inconsistent with the Wikipedia page you are pointing to.