Problem with gamrnd


I installed dynare 4.1.3. and added it to Matlab’s path

I’m trying to use the function gamrnd included in the distribution and have no problem with integral shape parameters:

[code]>> gamrnd([1], [1], ‘Johnk’)

ans =


But if I try to use a floating point parameter, I get this:

[code]>> gamrnd([0.1], [1], ‘Johnk’)
??? Undefined function or variable “Devroye”.

Error in ==> gamrnd at 103
if strcmpi(Devroye.small,‘Weibull’)[/code]

What am I doing wrong?

Thanks in advance

The issue seems to be that the functions is adapted to the use in Dynare. If you call the function with only two inputs (without specifying the algorithm) it always works. But in general, the function seems to have a bug in that when you provide three input arguments and the first argument is not an integer, the structure “Devroye.small” is not set because the function has no case for nargin==3 in the beginning.