bugGNU Octave - Bugs: bug #47824, No Matlab-compatible corrcoef


bug #47824: No Matlab-compatible corrcoef

Submitter:  Nir Krakauer <nir_krakauer>
Submitted:  Mon 02 May 2016 12:46:13 PM UTC
Category:  Octave Function Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Nir Krakauer Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Tue 14 Mar 2017 08:09:55 PM UTC, comment #15: 

Thank you, Rik, for the clarification.
Pushed the change here: https://hg.savannah.gnu.org/hgweb/octave/rev/d00280b0d6bd

Re-closing report.

Markus Mützel <mmuetzel>
Group administrator
Tue 14 Mar 2017 03:15:57 PM UTC, comment #14: 

@Markus: Generally for something this small you wouldn't bother to re-open the report.  Just post the patch and the comment and the original subscribers will all get the e-mail.

Your change looks fine.  Go ahead and push it and close the report when you are ready.

Rik <rik5>
Group administrator
Tue 14 Mar 2017 12:20:05 PM UTC, comment #13: 

Yet another step towards supporting Matlab's core functions. Great work.

The attached patch removes "corrcoef" from the list of unimplemented functions.
Is it OK that I re-opened this report?

(file #40002)

Markus Mützel <mmuetzel>
Group administrator
Mon 13 Mar 2017 06:40:27 PM UTC, comment #12: 

I made some more changes.  jwe dislikes CamelCase variables and prefers lower case where possible.  I also declared flags, such as piecewise, before the start of the nested loops since the calculation needs to be done only once.  I pushed it here (http://hg.savannah.gnu.org/hgweb/octave/rev/87b6f3606fd4).  Finally, we can say this is fixed and close the report.

Rik <rik5>
Group administrator
Sun 12 Mar 2017 09:52:51 PM UTC, comment #11: 

I have taken Guillaume's code and cleaned it up to follow Octave coding conventions as well as adding more BIST tests.  This is ready to go aside from the question of the name on the copyright at the top of the file.

(file #39985)

Rik <rik5>
Group administrator
Wed 25 Jan 2017 07:22:23 PM UTC, comment #10: 

What's the status of this patch?

Avinoam Kalma <avinoam>
Group Member
Thu 30 Jun 2016 05:43:44 PM UTC, comment #9: 

Guillaume, since you write this corrcoef.m file, you should be listed as the author and copyright holder of the file. We do not do copyright assignment in Octave, each contributor is the owner of their individual contributions.

If there is a reason that you do not want to hold the copyright on this file in the Octave repository, please contact either jwe or myself privately (jwe or mtmiller at octave.org) to discuss.

Mike Miller <mtmiller>
Group Member
Thu 30 Jun 2016 12:53:39 PM UTC, comment #8: 

Guillaume, I agree with Mike that you should be listed as the copyright holder.

The patch you submitted for bug #37330 had no name for the copyright, so Rik probably just put JWE's in by default when he committed it.

If Mike has reviewed this patch, let's try to get it into 4.2.0.

Lachlan Andrew <lachlan>
Tue 07 Jun 2016 11:27:29 AM UTC, comment #7: 

This was my understanding from an conversation with @rik5 but maybe I got it wrong.

Guillaume <gyom>
Mon 06 Jun 2016 03:55:45 PM UTC, comment #6: 

You'll have to ask jwe about that. Most contributions to Octave have the copyright held by the original author and contributors of substantial changes to individual files, we do not do copyright assignment in general.

Mike Miller <mtmiller>
Group Member
Mon 06 Jun 2016 03:39:56 PM UTC, comment #5: 

I indeed wrote this function but I understand that it is possible to copyright the file with jwe's name to satisfy the requirements of the GPL (as before for desktop() in bug #37330). As for the "Author: jwe" line, you're right, it should be removed.

Would that be ok?

Guillaume <gyom>
Mon 16 May 2016 07:15:32 PM UTC, comment #4: 

Function looks well-written to me and passes all tests.

If you wrote it, why does it say "Copyright (C) 2016 John W. Eaton" and "Author: jwe" ?

Mike Miller <mtmiller>
Group Member
Wed 04 May 2016 03:31:41 PM UTC, comment #3: 

Attached is new, hopefully complete, implementation of corrcoef.

(file #37066)

Guillaume <gyom>
Tue 03 May 2016 05:12:35 PM UTC, comment #2: 

I have attached an attempt of implementation of corrcoef. it is essentially a wrapper around corr and cor_test. It does not handle the options regarding confidence intervals and NaN but this could be easily added, see


(file #37058)

Guillaume <gyom>
Mon 02 May 2016 12:59:31 PM UTC, comment #1: 


Supports different name/value parameters and output arguments than corr.

Mike Miller <mtmiller>
Group Member
Mon 02 May 2016 12:46:13 PM UTC, original submission:  

We replaced corrcoef with corr because our behavior was different from Matlab's  [1]. However, corrcoef is in core Matlab, whereas Matlab has corr only in the Statistics toolbox. We should have a Matlab-compatible corrcoef, as suggested elsewhere [2].

[1] https://savannah.gnu.org/bugs/?33541
[2] https://savannah.gnu.org/bugs/?44997

Nir Krakauer <nir_krakauer>


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

Attach Files:

Attached Files
file #40002:  bug47824_corrcoef_unimplemented.patch added by mmuetzel (667B - application/octet-stream)
file #39985:  corrcoef.m added by rik5 (7KiB - d2l/unknowntype)
file #37066:  corrcoef.m added by gyom (5KiB - text/x-objective-c)
file #37058:  corrcoef.m added by gyom (3KiB - text/x-objective-c)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Updated the item)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by gyom (Updated the item)
  • -email is unavailable- added by nir_krakauer (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 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-03 mtmiller Carbon-CopyRemoved 80942 -
    2017-03-14 mmuetzel Open/ClosedOpen Closed
    2017-03-14 mmuetzel Attached File- Added bug47824_corrcoef_unimplemented.patch, #40002
        Open/ClosedClosed Open
    2017-03-13 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2017-03-12 rik5 Attached File- Added corrcoef.m, #39985
    2016-05-16 mtmiller StatusConfirmed Patch Submitted
    2016-05-04 gyom Attached File- Added corrcoef.m, #37066
    2016-05-03 gyom Attached File- Added corrcoef.m, #37058
    2016-05-02 mtmiller Severity3 - Normal 1 - Wish
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code