bugGNU Octave - Bugs: bug #32502, cov function returns incorrect...

 
 

bug #32502: cov function returns incorrect results for complex matrices

Submitted by:  Ivan <lisp_hacker>
Submitted on:  Wed 16 Feb 2011 09:51:18 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: Wont FixAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.2.4Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Thu 29 Sep 2011 05:14:49 AM UTC, comment #6:

uff... mathematical notation looks ugly =)

I mean:

$$
c = \left (\frac{x^H x}{n-1} \right)^H
$$

Ivan <lisp_hacker>
Thu 29 Sep 2011 05:11:22 AM UTC, comment #5:

Still I'm not sure that Octave do the things right. Once again here is the code (from Octave):

c = conj (x' * x / (n - 1));

Here we see a double complex conjugation. First operator' do conjugation, and after it there is an explicit call to conj. In mathematical notation we do the following:

H H
/ X X \
C = |--------|
\ N-1 /

So I think that the extra call to conj is erroneous, am I right?

Ivan <lisp_hacker>
Fri 18 Feb 2011 11:54:11 AM UTC, comment #4:

I think Octave does the right thing here. See the discussion on Matlab Newsreader http://www.mathworks.com/matlabcentral/newsreader/view_thread/301757#815851 where this issue was discussed. The question is whether we should be compatible with Matlab or not.

Stefan

Anonymous
Wed 16 Feb 2011 07:35:33 PM UTC, comment #3:

Sorry missed some lines in octave code. The correct example would be:

Ivan <lisp_hacker>
Wed 16 Feb 2011 07:19:41 PM UTC, comment #2:

Here goes octave:

Since matlab is prohibited (and actually I don't have access to it right now), a C++ code snippet, doing the same (it uses armadillo library):
As you can see this matrix are complex conjugates of each other. Matlab yield the same result, btw.

(file #22704, file #22705)

Ivan <lisp_hacker>
Wed 16 Feb 2011 06:19:56 PM UTC, comment #1:

Please do not quote code from Matlab here, not matter how small.

Please do give us an example of calling cov that produces an incorrect output, and show the output you are expecting instead.

John W. Eaton <jwe>
Project Administrator
Wed 16 Feb 2011 09:51:18 AM UTC, original submission:

For some reason function cov conjugates it's result:
Here is the code from octave 'm/statistics/base/cov.m':

Matlab (and other toolkits) do not conjugate it's results
(Matlab code):

Ivan <lisp_hacker>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #22704:  real_input.ascii added by lisp_hacker (2KiB - application/octet-stream)
file #22705:  imag_input.ascii added by lisp_hacker (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by lisp_hacker (Submitted the item)
  • -unavailable- added by lisp_hacker
  •  

    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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 28 Sep 2011 08:19:54 PM UTCrik5StatusNeed Info=>Wont Fix
      Open/ClosedOpen=>Closed
    Wed 16 Feb 2011 07:19:41 PM UTClisp_hackerAttached File-=>Added real_input.ascii, #22704
      Attached File-=>Added imag_input.ascii, #22705
    Wed 16 Feb 2011 06:28:51 PM UTCjweStatusNone=>Need Info
    Wed 16 Feb 2011 09:51:18 AM UTClisp_hackerCarbon-Copy-=>Added lisp_hacker

    Back to the top


    Powered by Savane 3.1-cleanup1