bugGNU Octave - Bugs: bug #59924, [octave forge] (statistics)...

 
 

bug #59924: [octave forge] (statistics) mhsample implementation

Submitter:  None
Submitted:  Fri 22 Jan 2021 05:42:20 AM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Duplicate Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * other
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 24 Jan 2021 11:29:45 AM UTC, comment #2: 

Closing in favor for patch #10016.

Kai Torben Ohlhus <siko1056>
Group Member
Fri 22 Jan 2021 05:02:25 PM UTC, comment #1: 

Thanks very much for this contribution.

This bug tracker is rather meant for bugs relating to existing functions and operation of Octave and packages.
It's preferrable to upload patches for new functions to the patch tracker:
https://savannah.gnu.org/patch/?group=octave
(I know currently there's another function being processed here (bug #59850) but IMO we should more clearly separate existing and new functions).

Currently I'm reviewing other patches for the statistics package there. Could you please upload your functions in a new report there? Then I'll also look into this one.

While at it, I perused the .m and .cc files. I see no comments at all, neither a license nor texinfo headers. Here are some guideline for perfecting coding style:
https://wiki.octave.org/Octave_style_guide

Thanks!

Philip Nienhuis <philipnienhuis>
Group Member
Fri 22 Jan 2021 05:42:20 AM UTC, original submission:  

I have implemented Metropolis-Hastings sampling for the statistics package. I followed the description given on the Matlab help page and implemented all functionality as described excluding 'nchain' as I did not find the description clear about how the results are output. I don't have Matlab to see the output. I issue a warning stating it is not implemented.

I have included two demos that I used in addition to the Matlab examples to test it is behaving as expected. I put significant effort into trying to make it as fast as possible, however, it is not as fast as I would like it, but I cannot see anywhere I can make further improvements. To try to improve the speed further I implemented it in c++. I achieved a noticeable speed increase but not as much as I hoped. The main slow point appears to be evaluating user-supplied functions which I can't see how to vectorize because each point depends on the previous point.

The timing between the Octave and the c++ Octave API implementation can be uncommented to compare run times.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #50763:  mhsample.m added by None (4KiB - text/plain)
file #50764:  mhsample_ccc.cc added by None (2KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Updated 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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-01-24 siko1056 StatusPatch Submitted Duplicate
        Open/ClosedOpen Closed
    2021-01-24 siko1056 StatusNone Patch Submitted
    2021-01-22 mmuetzel Carbon-CopyRemoved 102357 -
    2021-01-22 mmuetzel Releasedev other
        Summarymhsample implementation [octave forge] (statistics) mhsample implementation
    2021-01-22 None Attached File- Added mhsample.m, #50763
        Attached File- Added mhsample_ccc.cc, #50764

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code