help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: statistics distributions function names


From: Ben Barrowes
Subject: Re: statistics distributions function names
Date: Fri, 24 Jun 2005 09:26:12 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050414

Looking at most of the functions, it looks like the functionality is meant to be compatible. One very simple solution would be to create a set of wrappers to the octave functions but with the matlab names. For example weibull_rnd.m in octave and weibrnd.m in ML:

...
function rnd = weibull_rnd (shape, scale, r, c)
 if (nargin > 1)
   if (!isscalar(shape) || !isscalar(scale))
     [retval, shape, scale] = common_size (shape, scale);

function r = weibrnd(a,b,varargin)
%WEIBRND Random arrays from the Weibull distribution.
%   R = WEIBRND(A,B) returns an array of random numbers chosen from the


A simple octave wrapper named weibrnd.m could be:

function rnd = weibrnd (varargin)
rnd = weibull_rnd (varargin{:});

Should the help be duplicated? Or just a little note that says something like "for help see weibull_rnd"?


Another solution is simply to copy weibull_rnd.m wholesale into a file weibrnd.m. That would allow users to call either weibull_rnd or weibrnd. One problem is that now two files with the same content need to be maintained.




Mike Miller wrote:

On Fri, 24 Jun 2005, John W. Eaton wrote:

On 23-Jun-2005, Ben Barrowes wrote:

| Why are the names for the distribution functions in
| /usr/local/share/octave/2.9.3/m/statistics/distributions/
| different from their ML counterparts?

I'm not certain, but it might be that some of the Octave functions were written before the functions in Matlab. Or, it might be that they were written at a time when there was not so much empasis on compatibility with Matlab.

If you owuld like for this to improve, then please submit patches to provide a compatibile interface. It would be best to keep the current interface at least for a while, perhaps also having the incompatible functions emit warnings.



I actually was an unpaid consultant working with the Mathworks on the development of their stat toolbox. That's where many of these functions are found. When I started using Octave a little later, I noticed some of the names were different. I liked the Octave names better than the MATLAB names. It looks like the problem is that the MATLAB names were developed for MS Windows back when Windows 3.1 and DOS were still in use and every filename had to be in 8.3 format. Octave was built for UNIX so it doesn't have that limitation. Example: MATLAB uses the name poissinv.m and Octave uses poisson_inv.m.

Someone suggested the use of aliases. How are aliases used in Octave? We could use symbolic links.

Mike




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]