bugGNU Octave - Bugs: bug #40934, statistics package: cdf function...

 
 

bug #40934: statistics package: cdf function is not implemented

Submitter:  Alex Feng <looopass>
Submitted:  Tue 17 Dec 2013 04:14:35 AM UTC
   
 
Category:  Octave Package Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * other Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 14 Feb 2014 02:25:27 AM UTC, comment #14: 

So this is now fixed in svn, closing bug report. The next statistics package release will have the cdf function.

Mike Miller <mtmiller>
Group Member
Tue 28 Jan 2014 10:16:36 PM UTC, comment #13: 

Thank you all for the great job you do in octave.

Pantxo

Pantxo Diribarne <pantxo>
Group Member
Tue 28 Jan 2014 10:12:45 PM UTC, comment #12: 

Sorry, I overlooked this bug. I now added cdf.m to the svn repository.

Thanks,
Arno

Arno Onken <asnelt>
Tue 28 Jan 2014 09:51:27 PM UTC, comment #11: 

No. This is the right place. Maybe this just shouldn't had been marked as fixed.

I'm adding the maintainer of the statistics package.

Carnë Draug <carandraug>
Group Member
Tue 28 Jan 2014 08:08:14 PM UTC, comment #10: 

I see that a new version of statistics package is out.
Should I post the patch elsewhere in order to have it reviewed (and not lost in a bug marked fixed) for a future version?

Pantxo Diribarne <pantxo>
Group Member
Thu 02 Jan 2014 03:25:51 AM UTC, comment #9: 

Hi Pantxo. Thanks a lot! It works.
Alex

Alex Feng <looopass>
Thu 26 Dec 2013 09:10:38 AM UTC, comment #8: 

Hi Alex,

If you have installed octave-forge packages along with octave, you can add the attached (last version of) cdf.m to the directory containing the statistics package scripts. This directory may be found using:


pkg load statistics
which gevcdf


If octave is unable to load the package, the last version won't work as it relies on two scripts that belong to this package. You can then use the first version I posted (put it in a directory that belongs to your octave path), which only relies on octave core functions.

In any case, testing is very welcome. Thanks

(file #30094)

Pantxo Diribarne <pantxo>
Group Member
Thu 26 Dec 2013 02:20:53 AM UTC, comment #7: 

Hi Pantxo. How do I correctly apply the patch to my installation? I am using windows 7 with the octave 3.6.4 downloaded as binary (Visual studio compiled).
Thanks.
Haolin

Alex Feng <looopass>
Thu 19 Dec 2013 08:03:09 PM UTC, comment #6: 

I applied all your suggestions. See attached patch.

(file #30046)

Pantxo Diribarne <pantxo>
Group Member
Thu 19 Dec 2013 02:15:46 AM UTC, comment #5: 

This looks like a good start to me. I'd say it should go in the statistics package and handle the distributions that are in that package.

For style, why not just make all the string names lowercase to be consistent with Octave style. For example figure properties and the like are lowercase in Octave. And since you do strcmpi it will be compatible with existing Matlab code.

The allcdf array could be made persistent so it doesn't have to be initialized each time.

Mike Miller <mtmiller>
Group Member
Wed 18 Dec 2013 09:52:07 PM UTC, comment #4: 

Attached is a potential cdf.m. It' a wrapper around core octave cdf functions.
Missing are :
'birnbaumsaunders', 'burr', 'ev', 'gev', 'gp', 'inversegaussian', 'loglogistic', 'nakagami', 'nbin', 'ncf', 'nct', 'ncx2', 'rayl', 'rician', 'tlocationscale', 'unid'

Those with a "*" are present in octave-forge. If cdf.m belongs to statistics package I can add those two and prepare a patch against svn repo.



(file #30040)

Pantxo Diribarne <pantxo>
Group Member
Tue 17 Dec 2013 05:35:20 PM UTC, comment #3: 

Sorry, I typed "cdf" and return in the prompt (recent dev) and obtained


warning: the 'cdf' function belongs to the statistics package from Octave Forge
which seems to not be installed in your system.


I did not read the end of the warning which said:


Please read `http://www.octave.org/missing.html' to learn how you can
contribute missing functionality.


warning: called from
    __unimplemented__ at line 506 column 5
error: 'cdf' undefined near line 1 column 1


So you are right, cdf is not implemented yet from what I can see in the current inst directory of statistics package.

Pantxo Diribarne <pantxo>
Group Member
Tue 17 Dec 2013 02:01:07 PM UTC, comment #2: 

Pantxo, are you sure? I don't see the cdf function anywhere in the current statistics package. I agree that's where it probably should be implemented, though.

Mike Miller <mtmiller>
Group Member
Tue 17 Dec 2013 08:13:49 AM UTC, comment #1: 

The cdf function is already implemented in the statistics package from octave-forge. I am pretty sure it was implemented, as every function in Octave, by clean reverse engineering : read matlab documentation and mimic the original behavior but never read the matlab source

Pantxo Diribarne <pantxo>
Group Member
Tue 17 Dec 2013 04:14:35 AM UTC, original submission:  

The cdf function is missing in Octave 3.6.4. What cdf does in matlab is actually to call the right cdf specified by the distribution name (the first input argument to cdf is a string indicating the name of the distribution). One could manually add this function to the folder 'C:\Octave\Octave-3.6.4\share\octave\3.6.4\m\statistics\distributions', and then it behaves the same as it does under Matlab. I consider it a buy since Octave should behave the same as Matlab.

PS. The function code can be obtained in Matlab by using the following command:
type cdf

Alex Feng <looopass>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #30094:  cdf.m added by pantxo (4KiB - text/x-objcsrc)
file #30046:  statistics_add_cdf.diff added by pantxo (4KiB - text/x-patch)
file #30040:  cdf.m added by pantxo (4KiB - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by asnelt (Posted a comment)
  • -email is unavailable- added by carandraug (Arno Onken - maintainer of the statistics package)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by looopass (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 18 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-14 mtmiller StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2014-01-28 carandraug StatusFixed Patch Submitted
        Open/ClosedClosed Open
        Carbon-Copy- Added -email is unavailable-
    2014-01-02 carandraug StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2013-12-26 pantxo Attached File- Added cdf.m, #30094
    2013-12-19 pantxo Attached File- Added statistics_add_cdf.diff, #30046
    2013-12-19 mtmiller StatusConfirmed In Progress
    2013-12-18 pantxo Attached File- Added cdf.m, #30040
    2013-12-17 mtmiller CategoryOctave Function Octave Package
        Severity3 - Normal 1 - Wish
        Item GroupMatlab Compatibility Feature Request
        StatusNone Confirmed
        Release3.6.4 other
        Operating SystemMicrosoft Windows Any
        Summarythe matlab \'cdf\' function is missing in Octave 3.6.4 statistics package: cdf function is not implemented

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code