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:

uqlab;

InputOpts.Marginals(1).Name = ‘test’;

InputOpts.Marginals(1).Type = ‘Gamma’;

InputOpts.Marginals(1).Parameters = [1/0.4 2];myInput = uq_createInput(InputOpts);

uq_display(myInput);% compare with Matlab Gamma function

figure

x = linspace(0,10,100);

plot(x,gampdf(x,2,0.4))

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?

Best,

Benjamin