Problem with gamrnd

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Problem with gamrnd

Postby dynarist » Wed Jan 12, 2011 10:34 pm

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
dynarist
 
Posts: 1
Joined: Wed Jan 12, 2011 10:28 pm

Re: Problem with gamrnd

Postby jpfeifer » Thu Jan 13, 2011 8:42 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests