bugGNU Octave - Bugs: bug #41305, eigs: error -14 in dneupd when...

 
 

bug #41305: eigs: error -14 in dneupd when requesting fewer eigenvalues

Submitted by:  None
Submitted on:  Wed 22 Jan 2014 02:16:49 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: ConfirmedAssigned to: None
Originator Name: MaxOriginator Email: -unavailable-
Open/Closed: OpenRelease: dev
Operating System: Any

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)

Sat 02 Dec 2017 11:35:42 AM UTC, comment #21:

-14 in XYeupd is "did not find any eigenvalues to sufficient accuracy". It is just non-convergence with the given parameters. The error message comes from eigs-base.cc, so it can be modified. I do not think (anymore) it is a bug in arpack, but rather a possible defect in the "implicitely restarted Arnoldi method". We could change the error message to something like: "It was not possibile to find any eigenvalues to sufficient accuracy. Try to increase the tolerance, the maximum number of iterations, or the number of requested eigenvalues".

Marco Caliari <caliari>
Project Member
Tue 11 Apr 2017 02:40:09 PM UTC, comment #20:

I checked with 4.2.0 the sweepseed test in comment #17 and I confirm the results (about 2% failures with both Octave and Matlab). I also think this is an issue in Arpack:

If possible, it is best to avoid setting nev (k in Octave) in a way that will split clusters of eigenvalues. [ARPACK Users' Guide, p.16]

A workaround could be to set k at least to 6 (which is the default value) and to return the desired number of eigenvalues. I worked on something similar in #45153, it should be not that difficult to implement.

Marco Caliari <caliari>
Project Member
Tue 28 Jan 2014 12:32:42 PM UTC, comment #19:

Sorry I have to moderate one of my comments :

Arpack routines return the number of converged eigen values and a warning is emited by octave if it is not equal to the actual number of requested ones. So it seems the convergence criterion is applied on a per value basis (so I was completely wrong, I should learn to avoid guesses).

In this example:

>There are cases, where eigs(M,1,'LM')  fails, but eigs(M,6,'LM')  successfully returns.


we see no warning when requesting 6 values instead of one , so it looks like Arpack satisfactorily converged for all individual values and it should be able to return one value.

Finally the above mentioned behavior, plus the fact that matlab has the same issue, make me think that there is indeed a bug in Arpack, not in octave.

There is an obvious workaround for octave users: ask for more values than needed when the error appears.

Pantxo Diribarne <pantxo>
Project Member
Mon 27 Jan 2014 10:42:17 PM UTC, comment #18:

Sorry Max, I totally missed the important part of your comment #13, and indeed that I was able to confirm earlier now that I review the whole history here.

I honestly don't know enough about what's going on under the hood here, but going back to my comment #1, I show that eigs can fail to return 1 or 2 eigenvalues with a given matrix, but successfully returns 3. This does seem like a bug to me.

I'll open a separate report for better error reporting.

Mike Miller <mtmiller>
Project Administrator
Mon 27 Jan 2014 10:41:34 PM UTC, comment #17:

Sorry, I may have been a bit to fast here, you are right. However, here are the reasons that make me think octave does the right thing:

1 - I you care enough to see if it's a bug from octave, you may want to check _eigs_.cc and eig-base.cc. The number k of requested eigen values is directly (this should be double checked) passed to xnaupd arpack functions. From this quick browse, I'd say if there is a bug it is in arpack.

2 - I tested the attached modified sweepseed.m in matlab and octave 3.8 using

And for this particular set of seeds I see about 1-2% failures in both matlab and octave (and with the same error).

>There are cases, where eigs(M,1,'LM')  fails, but eigs(M,6,'LM')  successfully returns.


3 - Wild guess: the convergence criterion (based on opt.tol) may well not be satisfied for one large eigen value, and satisfied for 6 smaller in average values (e.g. if the criterion is a simple algebraic mean error). Anyway matlab behaves the same: for a failing seed if I increase nval, the error disappears.

>Also, failure seem to be version dependent, as comment 2 states.


If you add comment 1 you'll see that the error is not simply octave version dependent, it may be machine/architecture dependent also.

(file #30393)

Pantxo Diribarne <pantxo>
Project Member
Mon 27 Jan 2014 07:01:17 PM UTC, comment #16:

I'm very sorry, but I totally disagree with all renaming, assigning as feature request and the pursued solution.

Max Görner <maxg>
Mon 27 Jan 2014 02:35:04 PM UTC, comment #15:

Retitled and assigned as a feature request.

Mike Miller <mtmiller>
Project Administrator
Mon 27 Jan 2014 12:49:07 PM UTC, comment #14:

This report could now be retitled, e.g. 'turn arpack error codes into strings' as Mike suggested.

Pantxo Diribarne <pantxo>
Project Member
Mon 27 Jan 2014 12:36:31 PM UTC, comment #13:

I reinstalled Octave. Now the very odd behaviour is gone. I'm very sorry.

All what remains is that there are calls to eigs which fail if one requests to few eigenvalues, as reported by me and in comment 1.

Max Görner <maxg>
Thu 23 Jan 2014 01:43:39 PM UTC, comment #12:

I could check that, for me, the failure is deterministic: by varying the opt.tol parameter I could define the threshold tolerance t_tol for a particular seed (137 on octave 3.6.4).

The probability of failure (computed over 100 trials) is either 0 with "opt.tol = t_tol + eps/2" or 1 with "opt.tol = t_tol - eps/2".

Pantxo Diribarne <pantxo>
Project Member
Thu 23 Jan 2014 10:52:19 AM UTC, comment #11:

I did so. The Matrices are identical. But it's getting even more weird.

Error occurs 1 time:

Error occurs 2 times:

Please note that both versions differ just in the amount of newlines.

Since some can't reproduce my results:
I use vanilla XUbuntu 13.10 as 32bit version. I installed Octave, octave-signal and octave-statistics from the standard repositories.

Max Görner <maxg>
Thu 23 Jan 2014 10:15:10 AM UTC, comment #10:

I forgot to say the last reported issue may not be related to the OP's issue but rather to the random number generation inaccuracy.

Max, can you check that the random sparse matrix is the consistent e.g. using the following ?

Pantxo Diribarne <pantxo>
Project Member
Thu 23 Jan 2014 09:51:50 AM UTC, comment #9:

I can't reproduce this behavior neither on 3.6.4 (from fink) nor on 3.8.0 : a particular seed fails reliably but failing seeds may not be the same in 3.6.4 and 3.8.0.

I used the attached testeig.m for the test and I also tried manually at the prompt.

(file #30352)

Pantxo Diribarne <pantxo>
Project Member
Thu 23 Jan 2014 08:16:03 AM UTC, comment #8:

I'm amazed about the reception this bug has found here.

Unfortunately, I don't see this beeing resolved by a mere errno2string-function.

The behaviour of eigs is quite weird, as I try to demonstrate in the command line excerpt:

I use a for loop to find seeds that trigger the error. If the for loop starts at it=115 or at it=136, the error occurs at seed 137. If the for loop starts at it=137, the error occurs at seed 182. If I try to trigger the error by hand, knowing the seed, the error does not occur at all.

The errno2string function would be helpful, I'm glad to know a workaround, but I think there is a real error hidden somewhere.Octave, errors coming from Arpack dneupd look like:
"error: eigs: error -14 in dneupd" see e.g. [1]

This is not helpful and it would be good to have a convenient way to
print error messages from Arpack itself?

Maybe a convenience function like "errno2string" or

Max Görner <maxg>
Wed 22 Jan 2014 09:34:35 PM UTC, comment #7:

Done at [1].

Actually, some error number signification are not consistent across all functions (see e.g. INFO = -12 in [2] and [3]) but it shouldn't be hard to handle either in octave or in arpack.

[1] http://forge.scilab.org/index.php/p/arpack-ng/issues/1390/
[2] http://www.mathkeisan.com/UsersGuide/man/dneupd.html
[3] http://www.mathkeisan.com/UsersGuide/man/dnaupd.html

Pantxo Diribarne <pantxo>
Project Member
Wed 22 Jan 2014 05:34:52 PM UTC, comment #6:

This seems like a reasonable feature request for Arpack.

Jordi Gutiérrez Hermoso <jordigh>
Project Administrator
Wed 22 Jan 2014 05:21:47 PM UTC, comment #5:

@Mike: Sure this would be very helpful considering that eigs interface lets the user properly solve the reported issue with tolerance.

@Jordi: After a quick browse in Arpack documentation, I can't find a function that handles something like "errno2string". It seems to be left to the user so that this is not a bug in Arpack but a feature request as here in Octave. Am I wrong?

Pantxo Diribarne <pantxo>
Project Member
Wed 22 Jan 2014 04:57:50 PM UTC, comment #4:

Feel free to bounce this bug off to arpack-ng:

http://forge.scilab.org/index.php/p/arpack-ng/issues/

Jordi Gutiérrez Hermoso <jordigh>
Project Administrator
Wed 22 Jan 2014 04:53:27 PM UTC, comment #3:

Thanks for finding that discussion of the equivalent problem in Matlab.

So maybe turn this into a feature request to turn arpack error codes into strings that might make more sense to the user, as Matlab apparently does as shown in the referenced question?

Mike Miller <mtmiller>
Project Administrator
Wed 22 Jan 2014 04:42:14 PM UTC, comment #2:

Just a comment : looks like the "error -14 in dneupd" (actually , "DNAUPD did not find any eigenvalues to sufficient accuracy", see [1]) is also encountered in matlab (see e.g. [2]). Decreasing tolerance I obtain in 3.6.4:

Interestingly I don't have to decrease tolerance using the octave 3.8 (mac dmg from octave-forge): I obtain the same complex value as in 3.6.4 with decreased tolerance.

Having the original error message instead of the error number would help here.

[1] http://www.mathkeisan.com/UsersGuide/man/dneupd.html
[2] http://www.mathworks.com/matlabcentral/answers/100649

Pantxo Diribarne <pantxo>
Project Member
Wed 22 Jan 2014 03:35:35 PM UTC, comment #1:

Thanks for your bug report. I don't have Octave 3.4.2 to test with at the moment. However, with 3.6.4 I actually get the reverse behavior, are you sure you didn't swap those two rand initializers?

Someone with more insight into the eigs algorithm than me will have to comment on this, but here's what I see with Octave 3.8.0 (same as with 3.6.4). Asking for more eigenvalues works, but limiting it to 1 or 2 makes arpack fail to return any in this case.

Mike Miller <mtmiller>
Project Administrator
Wed 22 Jan 2014 02:16:49 PM UTC, original submission:

I'm using GNU Octave for research and need to randomly initialise matrices and then calculate their eigenvalues. Sometimes I get the following error

In Version 3.4.2 and 3.6.4 the following line triggers the error:

The following line triggers the error only in version 3.4.2:

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #30393:  sweepseed.m added by pantxo (390B - text/x-objcsrc)
file #30352:  testeig.m added by pantxo (516B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by caliari (Posted a comment)
  • -unavailable- added by maxg (Posted a comment)
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by None (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 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 27 Jan 2014 10:42:17 PM UTCmtmillerSeverity1 - Wish=>3 - Normal
      Item GroupFeature Request=>Incorrect Result
      Summarygenerate human-readable error strings from arpack error codes=>eigs: error -14 in dneupd when requesting fewer eigenvalues
    Mon 27 Jan 2014 10:41:34 PM UTCpantxoAttached File-=>Added sweepseed.m, #30393
    Mon 27 Jan 2014 02:35:04 PM UTCmtmillerSeverity3 - Normal=>1 - Wish
      Item GroupOther=>Feature Request
      Release3.6.4=>dev
      Operating SystemGNU/Linux=>Any
      Summaryerror: eigs: error -14 in dneupd=>generate human-readable error strings from arpack error codes
    Thu 23 Jan 2014 09:51:50 AM UTCpantxoAttached File-=>Added testeig.m, #30352
    Wed 22 Jan 2014 03:35:35 PM UTCmtmillerStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1