Fri 03 Jan 2014 08:37:56 PM UTC, comment #7:
I added a note documenting the intentional Matlab incompatability to cov.m in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/48dafd739840). Closing report.
|
Mon 02 Dec 2013 01:46:08 PM UTC, comment #6:
PMFJI
cov's doc string (help cov) doesn't explicitly mention the Matlab incompatibility.
From my own experience, supported by the discussion in the mentioned thread, I think Octave's behavior is the preferred choice. I never used ML's cov, otherwise I would surely have hit this limitation.
Could this be fixed with a 4th input argument for cov turning ML compatible behavior on/off? (+ similar 3rd arg in corrcoef as well?), default value TBA?
|
Sun 01 Dec 2013 06:40:52 PM UTC, comment #5:
Yes, I think it should be documented. I thought the doc string for cov already mentioned this incompatibility.
It's also fine with me if we revisit whether we should remove this incompatibility. But whatever we do, we should NOT should make any change to cov on the stable branch for the 3.8 release.
|
Sun 01 Dec 2013 05:45:56 PM UTC, comment #4:
Ok, sorry about that, I hadn't found these threads.
Would it be acceptable to document this intentional incompatibility somewhere, e.g., in the help text of the function or at least as a comment in the code ?
|
Sun 01 Dec 2013 04:52:35 PM UTC, comment #3:
This has come up a number of times in the past and we have always decided to keep Octave's definition of cov.
Please take a look at:
http://octave.1599824.n4.nabble.com/Re-cov-m-patch-td4466691.html
and the thread that it references:
http://octave.1599824.n4.nabble.com/covariance-matrix-td1607376.html#a1607378
|
Sun 01 Dec 2013 08:12:36 AM UTC, comment #2:
As far as I can tell, Matlab's cov() has always behaved like this.
corr(), on the other hand, has a different behaviour. Perhaps because it is a function from the statistics toolbox, not a base Matlab function.
By the way, corrcoef() suffers from exactly the same problem. (Why is there currently a warning indicating that corrcoef will be removed in a future version of Octave ?)
So, it seems that both cov() and corrcoef() have to be fixed. In fact, corrcoef() should be fixed automatically once cov() is fixed, since it is based on it.
I will do this when I have time, if nobody does it before ;-)
|
Sun 01 Dec 2013 06:51:27 AM UTC, comment #1:
According to Matlab's documentation, cov (x,y) is equivalent to
and in Octave doing
I don't know if this is a recent change in Matlab's behavior or not, but the fix looks simple. The m-file can just be changed to use the new definition.
|
Fri 29 Nov 2013 04:56:22 PM UTC, original submission:
In Octave 3.7.7+ I get:
In Matlab R2012a:
|