bugGNU Octave - Bugs: bug #29545, empiricalcdf eats up too much...

 
 

bug #29545: empiricalcdf eats up too much memory + alternative solution

Submitted by:  Guido Walter Pettinari <coccoinomane>
Submitted on:  Tue 13 Apr 2010 03:29:07 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.2.3Operating System: Mac OS

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 14 Apr 2010 12:26:17 AM UTC, comment #1:

This is probably not the way to handle this. Its probably better to use the lookup function, with indexing cumsum(p), directly in the discrete_cdf function and accelerate both discrete_cdf and empirical_cdf. This will also treat correctly the NaN values in the return vector.

Proposed patch attached that I pushed to savannah

D.

(file #20217)

David Bateman <dbateman>
Project Member
Tue 13 Apr 2010 03:29:07 PM UTC, original submission:

If I issue these commands:

N = 10000;
g = normrnd(0, 1, N, 1);
emp = empirical_cdf(g, g);

all my system's memory (4GB) is taken by Octave and everything in slowed down.

This happens in general every time N is bigger than several thousands.

I wrote an alternative 'empirical_cdf' m-file which works fine and is ultra-fast compared to Octave's. I attached it to this bug report.

Cheers,

Guido

Guido Walter Pettinari <coccoinomane>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #20217:  patch.discrete_cdf added by dbateman (1KiB - application/octet-stream)
file #20212:  empirical_cdf2.m added by coccoinomane (555B - application/x-download - Alternative, faster and memory efficient empirical_cdf function)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by dbateman (Updated the item)
  • -unavailable- added by coccoinomane (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 15 Apr 2010 10:35:51 PM UTCdbatemanOpen/ClosedOpen=>Closed
    Wed 14 Apr 2010 12:26:17 AM UTCdbatemanAttached File-=>Added patch.discrete_cdf, #20217
      StatusNone=>Fixed
    Tue 13 Apr 2010 03:29:07 PM UTCcoccoinomaneAttached File-=>Added empirical_cdf2.m, #20212

    Back to the top


    Powered by Savane 3.1-cleanup1