Page 1 of 1

Problem with gamrnd

PostPosted: Wed Jan 12, 2011 10:34 pm
by dynarist
Hi,

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: Select all
>> gamrnd([1], [1], 'Johnk')

ans =

        0.0226461410565992


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

Code: Select all
>> gamrnd([0.1], [1], 'Johnk')
??? Undefined function or variable "Devroye".

Error in ==> gamrnd at 103
            if strcmpi(Devroye.small,'Weibull')


What am I doing wrong?

Thanks in advance

Re: Problem with gamrnd

PostPosted: Thu Jan 13, 2011 8:42 am
by jpfeifer
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.