Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-19 Thread peter dalgaard
On Jun 19, 2013, at 15:58 , Berend Hasselman wrote: > > On 19-06-2013, at 14:17, peter dalgaard wrote: > >> >> >> >> Thanks. I think I have it nailed down now. The culprit was indeed in our >> reference BLAS (I had only checked the LAPACK code), cmplxblas.f to be >> specific. Revision 530

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-19 Thread Berend Hasselman
On 19-06-2013, at 14:17, peter dalgaard wrote: > > > > Thanks. I think I have it nailed down now. The culprit was indeed in our > reference BLAS (I had only checked the LAPACK code), cmplxblas.f to be > specific. Revision 53001 had a number of IF statements being commented out, > but two o

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-19 Thread Roger Bivand
peter dalgaard gmail.com> writes: > > ... > > There could be compiler issues. It could also be that the internal LAPACK uses a newer version than the > external libs and a bug was introduced in between them. Running: N <- 100 jj <- matrix(0,N,N) A <- exp(-0.1*(row(jj)-col(jj))^2) min(eigen(A

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-19 Thread peter dalgaard
On Jun 19, 2013, at 12:43 , Berend Hasselman wrote: > > On 19-06-2013, at 10:24, peter dalgaard wrote: > >> >> On Jun 18, 2013, at 21:49 , peter dalgaard wrote: >> >>> >>> On Jun 18, 2013, at 21:23 , Berend Hasselman wrote: >>> So it seems that the blocked algorithm is the cause

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-19 Thread Ravi Varadhan
ct.org Subject: Re: [Rd] eigen(symmetric=TRUE) for complex matrices On some further digging, on the Lion machine, the problem seems absent from builds against the veclib framework. I strongly suspect that the issue is the same as PR#14964, which also affects Hermitian matrices of dimension 33x

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-19 Thread Berend Hasselman
On 19-06-2013, at 10:24, peter dalgaard wrote: > > On Jun 18, 2013, at 21:49 , peter dalgaard wrote: > >> >> On Jun 18, 2013, at 21:23 , Berend Hasselman wrote: >> >>> >>> So it seems that the blocked algorithm is the cause of the error and that >>> using the (possibly slow) unblocked algo

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-19 Thread peter dalgaard
On Jun 18, 2013, at 21:49 , peter dalgaard wrote: > > On Jun 18, 2013, at 21:23 , Berend Hasselman wrote: > >> >> So it seems that the blocked algorithm is the cause of the error and that >> using the (possibly slow) unblocked algorithm gives the correct result. > > Thanks Berend, > > The f

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-18 Thread peter dalgaard
On Jun 18, 2013, at 21:23 , Berend Hasselman wrote: > > So it seems that the blocked algorithm is the cause of the error and that > using the (possibly slow) unblocked algorithm gives the correct result. Thanks Berend, The finger seems to be pointing to the internal libRlapack/libRblas. The

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-18 Thread Berend Hasselman
On 18-06-2013, at 13:23, peter dalgaard wrote: > On some further digging, on the Lion machine, the problem seems absent from > builds against the veclib framework. I strongly suspect that the issue is the > same as PR#14964, which also affects Hermitian matrices of dimension 33x33 > and above

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-18 Thread Simone Giannerini
1. OpenSuse 12.1 R compiled against ACML 5.3.1 > sessionInfo() R version 3.0.1 RC (2013-05-08 r62723) Platform: x86_64-unknown-linux-gnu (64-bit) > A <- exp(-0.1*(row(jj)-col(jj))^2) > min(eigen(A,T,T)$values) [1] 2.521151e-10 > min(eigen(A+0i,T,T)$values) [1] 2.

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-18 Thread Berend Hasselman
On 18-06-2013, at 09:57, peter dalgaard wrote: > > On Jun 18, 2013, at 03:30 , robin hankin wrote: > >> R-3.0.1 rev 62743, binary downloaded from CRAN just now; macosx 10.8.3 >> >> Hello, >> >> eigen(symmetric=TRUE) behaves strangely when given complex matrices. >> >> >> The following two

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-18 Thread Davor Cubranic
On 13-06-18 12:57 AM, peter dalgaard wrote: Coercing A to a complex matrix should make no difference, but makes >eigen() return the wrong answer: > >>min(eigen(A+0i,T,T)$values) >[1] -0.359347 >> > >This is very, very wrong. Yep. I see this also on 10.6/7 (Snow Leopard, Lion) and 3.0.x, but

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-18 Thread peter dalgaard
On some further digging, on the Lion machine, the problem seems absent from builds against the veclib framework. I strongly suspect that the issue is the same as PR#14964, which also affects Hermitian matrices of dimension 33x33 and above. At smaller dimensions, a curious effect is visible: >

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-18 Thread peter dalgaard
On Jun 18, 2013, at 03:30 , robin hankin wrote: > R-3.0.1 rev 62743, binary downloaded from CRAN just now; macosx 10.8.3 > > Hello, > > eigen(symmetric=TRUE) behaves strangely when given complex matrices. > > > The following two lines define 'A', a 100x100 (real) symmetric matrix > which theo

[Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-17 Thread robin hankin
R-3.0.1 rev 62743, binary downloaded from CRAN just now; macosx 10.8.3 Hello, eigen(symmetric=TRUE) behaves strangely when given complex matrices. The following two lines define 'A', a 100x100 (real) symmetric matrix which theoretical considerations [Bochner's theorem] show to be positive defin

Re: [Rd] ?eigen documentation suggestion

2007-11-29 Thread Martin Maechler
> "DD" == Dan Davison <[EMAIL PROTECTED]> > on Thu, 29 Nov 2007 11:34:18 + writes: DD> from ?eigen DD> symmetric: if 'TRUE', the matrix is assumed to be symmetric (or DD> Hermitian if complex) and only its lower triangle is used. If DD> 'symmetric' is not specified,

[Rd] ?eigen documentation suggestion

2007-11-29 Thread Dan Davison
from ?eigen symmetric: if 'TRUE', the matrix is assumed to be symmetric (or Hermitian if complex) and only its lower triangle is used. If 'symmetric' is not specified, the matrix is inspected for symmetry. I think that could mislead a naive reader as it suggests tha

Re: [Rd] eigen in beta

2007-04-11 Thread Peter Dalgaard
Paul Gilbert wrote: > Peter Dalgaard wrote: > > >> Well, there's make check-all... >> > Ok, this is what I should be running. It reports > > running tests of LAPACK-based functions > make[3]: Entering directory `/home/mfa/gilp/toolchain/R/src/R-beta/tests' > running code in 'lapa

Re: [Rd] eigen in beta

2007-04-11 Thread Paul Gilbert
Peter Dalgaard wrote: > Well, there's make check-all... Ok, this is what I should be running. It reports running tests of LAPACK-based functions make[3]: Entering directory `/home/mfa/gilp/toolchain/R/src/R-beta/tests' running code in 'lapack.R' ...make[3]: *** [lapack.Rout] Error 1 make

Re: [Rd] eigen in beta

2007-04-11 Thread Peter Dalgaard
Paul Gilbert wrote: > Prof Brian Ripley wrote: > >> On Wed, 11 Apr 2007, Paul Gilbert wrote: >> >>> Hmmm. It is a bit disconcerting that make check passes and I can get >>> a fairly seriously wrong answer. Perhaps this test could be added to >>> make check. >>> >> Well, you have l

Re: [Rd] eigen in beta

2007-04-11 Thread Martin Maechler
> "PaulG" == Paul Gilbert <[EMAIL PROTECTED]> > on Wed, 11 Apr 2007 10:51:22 -0400 writes: PaulG> Hmmm. It is a bit disconcerting that make check passes and I can get a PaulG> fairly seriously wrong answer. Perhaps this test could be added to make PaulG> check. Yes.

Re: [Rd] eigen in beta

2007-04-11 Thread Paul Gilbert
Prof Brian Ripley wrote: > On Wed, 11 Apr 2007, Paul Gilbert wrote: >> Hmmm. It is a bit disconcerting that make check passes and I can get >> a fairly seriously wrong answer. Perhaps this test could be added to >> make check. > Well, you have learnt something new about software engineering! 'm

Re: [Rd] eigen in beta

2007-04-11 Thread Prof Brian Ripley
On Wed, 11 Apr 2007, Paul Gilbert wrote: Hmmm. It is a bit disconcerting that make check passes and I can get a fairly seriously wrong answer. Perhaps this test could be added to make check. Well, you have learnt something new about software engineering! 'make check' is supposed to test th

Re: [Rd] eigen in beta

2007-04-11 Thread Paul Gilbert
Hmmm. It is a bit disconcerting that make check passes and I can get a fairly seriously wrong answer. Perhaps this test could be added to make check. Whether or not the one answer is correct may be questionable, but there is no question that prod(eigen(z, symmetric = FALSE, only.values = TRU

Re: [Rd] eigen in beta

2007-04-11 Thread Martin Maechler
I've also tried on Redhat EL4(x86_64) [but with /usr/local/.. gcc/gfortran 4.1.1] and FC6 (ix86 & x86_64) and Ubuntu dapper (x86_64) and never got the wrong results. > "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> > on Wed, 11 Apr 2007 07:43:38 +0100 (BST) write

Re: [Rd] eigen in beta

2007-04-11 Thread Prof Brian Ripley
All the systems I tried this on give the 'correct' answer, including x86_64 Linux, FC5 (gcc 4.1.1) i686 Linux, FC5 ix86 Windows (both gcc 3.4.5 and gcc pre-4.3.0) Sparc Solaris, with gcc3, gcc4 and SunPro compilers. Mainly with R 2.5.0 beta, some with R-devel (where the code is unchanged). We h

Re: [Rd] eigen in beta

2007-04-10 Thread Paul Gilbert
Peter Dalgaard wrote: > Paul Gilbert wrote: > >> Here is the example. Pehaps others could check on other platforms. It >> is only the first eigenvalue that is different. I am relatively sure >> the old values are correct, since I compare with an alternate >> calculation using the expansion o

Re: [Rd] eigen in beta

2007-04-10 Thread Peter Dalgaard
Paul Gilbert wrote: > Here is the example. Pehaps others could check on other platforms. It is > only the first eigenvalue that is different. I am relatively sure the > old values are correct, since I compare with an alternate calculation > using the expansion of a polynomial determinant. > > >

Re: [Rd] eigen in beta

2007-04-10 Thread Paul Gilbert
Here is another check that R-2.4.1 is right. This should give 1. prod(eigen(z, symmetric = FALSE, only.values = TRUE)$values ) * prod(eigen(solve(z), symmetric = FALSE, only.values = TRUE)$values ) R-2.4.1 gives [1] 1+0i R-2.5.0 gives [1] 1.01677-0i Paul Paul Gilbert wrote: > Here is the exa

Re: [Rd] eigen in beta

2007-04-10 Thread Paul Gilbert
Here is the example. Pehaps others could check on other platforms. It is only the first eigenvalue that is different. I am relatively sure the old values are correct, since I compare with an alternate calculation using the expansion of a polynomial determinant. z <- t(matrix(c( 0, 0, 0, 0, 0

Re: [Rd] eigen in beta

2007-04-10 Thread Prof Brian Ripley
We are only aware of better behaviour from LAPACK 3.1 (which is what I suppose you are talking about, that is R compiled with its internal LAPACK). But in at least one case that means finding a complex set of eigenvalues where previously a real one was found. On Tue, 10 Apr 2007, Paul Gilber

[Rd] eigen in beta

2007-04-10 Thread Paul Gilbert
I am having some trouble with a case where eigen in R-beta gives a different largest value than in previous versions of R. Other values seem to be the same. Before I spend too much time, is anyone aware of a problem (symmetric = FALSE, only.values = TRUE). Paul Gilbert ==

Re: [Rd] eigen returns NAs from a real matrix

2007-03-19 Thread Martin Maechler
> "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> > on Mon, 19 Mar 2007 13:37:15 + (GMT) writes: BDR> On Mon, 19 Mar 2007, Martin Maechler wrote: >>> "Duncan" == Duncan Murdoch <[EMAIL PROTECTED]> >>> on Mon, 19 Mar 2007 09:01:39 -0400 writes: >> Duncan>

Re: [Rd] eigen returns NAs from a real matrix

2007-03-19 Thread Prof Brian Ripley
On Mon, 19 Mar 2007, Martin Maechler wrote: >> "Duncan" == Duncan Murdoch <[EMAIL PROTECTED]> >> on Mon, 19 Mar 2007 09:01:39 -0400 writes: > >Duncan> On 3/19/2007 6:48 AM, Martin Maechler wrote: >>>> "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> >>>> on Sun, 18 Ma

Re: [Rd] eigen returns NAs from a real matrix

2007-03-19 Thread Duncan Murdoch
On 3/19/2007 9:12 AM, Martin Maechler wrote: >> "Duncan" == Duncan Murdoch <[EMAIL PROTECTED]> >> on Mon, 19 Mar 2007 09:01:39 -0400 writes: > > Duncan> On 3/19/2007 6:48 AM, Martin Maechler wrote: > >>> "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> > >>> on Sun, 1

Re: [Rd] eigen returns NAs from a real matrix

2007-03-19 Thread Martin Maechler
> "Duncan" == Duncan Murdoch <[EMAIL PROTECTED]> > on Mon, 19 Mar 2007 09:01:39 -0400 writes: Duncan> On 3/19/2007 6:48 AM, Martin Maechler wrote: >>> "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> >>> on Sun, 18 Mar 2007 06:51:58 + (GMT) writes: >> BDR

Re: [Rd] eigen returns NAs from a real matrix

2007-03-19 Thread Duncan Murdoch
On 3/19/2007 6:48 AM, Martin Maechler wrote: >> "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> >> on Sun, 18 Mar 2007 06:51:58 + (GMT) writes: > > BDR> On Sat, 17 Mar 2007, Spencer Graves wrote: > >> Hi, All: > >> Attached please find a symmetric, indefinite matrix for

Re: [Rd] eigen returns NAs from a real matrix

2007-03-19 Thread Martin Maechler
> "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> > on Sun, 18 Mar 2007 06:51:58 + (GMT) writes: BDR> On Sat, 17 Mar 2007, Spencer Graves wrote: >> Hi, All: >> Attached please find a symmetric, indefinite matrix for which >> 'eigen(...)$vectors' included NAs: >

Re: [Rd] eigen returns NAs from a real matrix

2007-03-17 Thread Prof Brian Ripley
On Sat, 17 Mar 2007, Spencer Graves wrote: > Hi, All: > Attached please find a symmetric, indefinite matrix for which > 'eigen(...)$vectors' included NAs: >> load("eigenBug.Rdata") >> sum(is.na(eigen(eigenBug)$vectors)) > [1] 5670 >> sessioninfo() > Error: could not find function "sessioninf

[Rd] eigen returns NAs from a real matrix

2007-03-17 Thread Spencer Graves
Hi, All: Attached please find a symmetric, indefinite matrix for which 'eigen(...)$vectors' included NAs: > load("eigenBug.Rdata") > sum(is.na(eigen(eigenBug)$vectors)) [1] 5670 > sessioninfo() Error: could not find function "sessioninfo" > sessionInfo() R version 2.4.1 (2006-12-18) i386

Re: [Rd] eigen()

2006-01-10 Thread Martin Maechler
> "BDR" == Prof Brian Ripley <[EMAIL PROTECTED]> > on Tue, 10 Jan 2006 15:01:00 + (GMT) writes: BDR> I haven't seen most of this thread, but this is a classic case of passing BDR> integers instead of doubles. And indeed BDR> else if(is.numeric(x)) { BDR> storage

Re: [Rd] eigen()

2006-01-10 Thread Peter Dalgaard
Prof Brian Ripley <[EMAIL PROTECTED]> writes: > I haven't seen most of this thread, but this is a classic case of > passing integers instead of doubles. And indeed > > else if(is.numeric(x)) { > storage.mode(x) <- "double" > > has been removed from eigen.R in R-devel in r36952. So t

Re: [Rd] eigen()

2006-01-10 Thread Prof Brian Ripley
I haven't seen most of this thread, but this is a classic case of passing integers instead of doubles. And indeed else if(is.numeric(x)) { storage.mode(x) <- "double" has been removed from eigen.R in R-devel in r36952. So that's the culprit. [BTW, x86 is not 64-bit, which is x86

Re: [Rd] eigen()

2006-01-10 Thread Robin Hankin
On 10 Jan 2006, at 14:14, Peter Dalgaard wrote: > >>> Strange and semi-random results on SuSE 9.3 as well: >>> >>> eigen(matrix(1:100,10,10))$values >>> [1] 5.4e-311+ 0.0e+00i -2.5e-311+3.7e-311i -2.5e-311-3.7e-311i >>> [4] 2.5e-312+ 0.0e+00i -2.4e-312+ 0.0e+00i 3.2e-317+ 0.0e+00i >>>

Re: [Rd] eigen()

2006-01-10 Thread Peter Dalgaard
Hin-Tak Leung <[EMAIL PROTECTED]> writes: > Peter Dalgaard wrote: > > Robin Hankin <[EMAIL PROTECTED]> writes: > > > >>Hi > >> > >>I am having difficulty with eigen() on R-devel_2006-01-05.tar.gz > >> > >>Specifically, in R-2.2.0 I get expected behaviour: > >> > >> > >> > eigen(matrix(1:100,10,

Re: [Rd] eigen()

2006-01-10 Thread Hin-Tak Leung
Peter Dalgaard wrote: > Robin Hankin <[EMAIL PROTECTED]> writes: > > >>Hi >> >>I am having difficulty with eigen() on R-devel_2006-01-05.tar.gz >> >>Specifically, in R-2.2.0 I get expected behaviour: >> >> >> > eigen(matrix(1:100,10,10),FALSE,TRUE)$values >>[1] 5.208398e+02+0.00e+00i -1.5

Re: [Rd] eigen()

2006-01-10 Thread Peter Dalgaard
Peter Dalgaard <[EMAIL PROTECTED]> writes: > Robin Hankin <[EMAIL PROTECTED]> writes: > > > Hi > > > > I am having difficulty with eigen() on R-devel_2006-01-05.tar.gz > > > > Specifically, in R-2.2.0 I get expected behaviour: > > > > > > > eigen(matrix(1:100,10,10),FALSE,TRUE)$values > >

Re: [Rd] eigen()

2006-01-10 Thread Peter Dalgaard
Robin Hankin <[EMAIL PROTECTED]> writes: > Hi > > I am having difficulty with eigen() on R-devel_2006-01-05.tar.gz > > Specifically, in R-2.2.0 I get expected behaviour: > > > > eigen(matrix(1:100,10,10),FALSE,TRUE)$values > [1] 5.208398e+02+0.00e+00i -1.583980e+01+0.00e+00i > [3]

[Rd] eigen()

2006-01-10 Thread Robin Hankin
Hi I am having difficulty with eigen() on R-devel_2006-01-05.tar.gz Specifically, in R-2.2.0 I get expected behaviour: > eigen(matrix(1:100,10,10),FALSE,TRUE)$values [1] 5.208398e+02+0.00e+00i -1.583980e+01+0.00e+00i [3] -4.805412e-15+0.00e+00i 1.347691e-15+4.487511e-15i [5]

Re: [Rd] eigen gives NaN in $vectors (PR#8041)

2005-07-30 Thread Dirk Eddelbuettel
On 31 July 2005 at 03:53, [EMAIL PROTECTED] wrote: | Full_Name: P Kapat | Version: 2.1.1 (2005-06-20) | OS: GNU/Linux 2.6.8-2-386, Debian testing | Submission from: (NULL) (65.24.56.41) | | | Relevant Bugs Ids : 7987, 7989 | | H is a 100x100 singular but symmetric matrix (a matrix defining the

[Rd] eigen gives NaN in $vectors (PR#8041)

2005-07-30 Thread pkapat_nospam
Full_Name: P Kapat Version: 2.1.1 (2005-06-20) OS: GNU/Linux 2.6.8-2-386, Debian testing Submission from: (NULL) (65.24.56.41) Relevant Bugs Ids : 7987, 7989 H is a 100x100 singular but symmetric matrix (a matrix defining the neighbourhood structure for a spatial data) available from.. http://ww

Re: [Rd] eigen of a real pd symmetric matrix gives NaNs in $vector (PR#7989)

2005-07-04 Thread pburns
I would presume this is another manifestation of what I reported (reproduced below) on 2003-12-01. [EMAIL PROTECTED] wrote: >Full_Name: cajo ter Braak >Version: 2.1.1 >OS: Windows >Submission from: (NULL) (137.224.10.105) > > ># I would like to attach the matrix C in the Rdata file; it is 50x50 a

Re: [Rd] eigen of a real pd symmetric matrix gives NaNs in $vector (PR#7987)

2005-07-04 Thread Patrick Burns
I would presume this is another manifestation of what I reported (reproduced below) on 2003-12-01. [EMAIL PROTECTED] wrote: >Full_Name: cajo ter Braak >Version: 2.1.1 >OS: Windows >Submission from: (NULL) (137.224.10.105) > > ># I would like to attach the matrix C in the Rdata file; it is 50x50 a

[Rd] eigen of a real pd symmetric matrix gives NaNs in $vector (PR#7987)

2005-07-04 Thread cajo . terbraak
Full_Name: cajo ter Braak Version: 2.1.1 OS: Windows Submission from: (NULL) (137.224.10.105) # I would like to attach the matrix C in the Rdata file; it is 50x50 and comes from a geostatistical problem (spherical covariogram) > rm(list=ls(all=TRUE)) > load(file= "test.eigen.Rdata") > ls() [1] "