A first remark: all those distribution-related functions are present in Matlab's statistical toolbox (see http://www.mathworks.com/access/helpdesk/help/toolbox/stats/index.html), and have their free clones in Octave.
Actually we can directly adapt the following from Octave: PDF, CDF and quantiles for gamma, beta, normal, chi square This covers the 10 files which are copyright Anders Holtsberg
I am ok to do that job; I suggest to name the new files after Matlab's statistical toolbox naming (which is also Octave naming), then to put the new files in a subdirectory called "distributions", and to only add this dir in the path only when the user is using Matlab without the Statistics Toolbox, so that we use native routines when the toolbox is present or when under Octave.
Be careful, from what I understood, Matlab copy protection mechanism looks for some function names from each toolbox and generates error if it believes it recognizes functions f rom a toolbox for which there is no license. I think that we should change the names to something like oct_actual names. Because it destroys the easy recourse to native functions when present in Matlab and Octave, maybe we can identify these names and do the name change only for these sensitive functions.
The two remaining files are random draws for the gamma and the beta (the latter can be easily derived from the former). Octave has a DLL primitive for random draws from the gamma, which is not available in Matlab without the statistical toolbox.
In other words, we must rewrite the current gamm_rnd.m. This file uses an algorithm which I don't know. Another simple solution is to use the gamma quantile function applied on random draws of a uniform in [0,1], but I don't know if this theoretical method is numerically relevant. Any suggestion?
I will look into the generation of random gamma variables.
Best
Michel