Re: [R] non-reproducible eigen() output with MKL

2025-05-06 Thread smallepsilon via R-help
un...@r-project.org On Behalf Of Martin Maechler > > Sent: Monday, May 5, 2025 10:50 > > To: smallepsilon smallepsi...@proton.me > > Cc: r-help@r-project.org; peter dalgaard pda...@gmail.com > > Subject: Re: [R] non-reproducible eigen() output with MKL > > > > &

Re: [R] non-reproducible eigen() output with MKL

2025-05-05 Thread Viechtbauer, Wolfgang (NP)
ject.org; peter dalgaard > Subject: Re: [R] non-reproducible eigen() output with MKL > > >>>>> smallepsilon via R-help > >>>>> on Sun, 04 May 2025 18:11:57 + writes: > > > Peter, The eigenvalues are not identical(), but are > >

Re: [R] non-reproducible eigen() output with MKL

2025-05-05 Thread Martin Maechler
> smallepsilon via R-help > on Sun, 04 May 2025 18:11:57 + writes: > Peter, The eigenvalues are not identical(), but are > all.equal(). When n is 20, the crossproduct is > (numerically) a diagonal matrix with +-1 on the > diagonal. When n is 50, this is not the c

Re: [R] non-reproducible eigen() output with MKL

2025-05-04 Thread Eric Berger
Just an FYI that on my system identical(e1,e2) returns TRUE. Here is the output of sessionInfo() on my system: > sessionInfo() R version 4.4.2 (2024-10-31) Platform: x86_64-pc-linux-gnu Running under: Ubuntu 22.04.5 LTS Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/l

Re: [R] non-reproducible eigen() output with MKL

2025-05-04 Thread smallepsilon via R-help
Peter, The eigenvalues are not identical(), but are all.equal(). When n is 20, the crossproduct is (numerically) a diagonal matrix with +-1 on the diagonal. When n is 50, this is not the case, but that could be an issue of nearly identical eigenvalues. Is there no way within R to require that

Re: [R] non-reproducible eigen() output with MKL

2025-05-04 Thread peter dalgaard
Have you looked more closely at the differences? Eigenvectors are only determined up to a sign change, so different platforms often give results that differ by sign. If you use a multitasking numerical library, the same can happen within platform because the exact sequence of computations differ

[R] non-reproducible eigen() output with MKL

2025-05-04 Thread smallepsilon via R-help
I am using MKL with R 4.5.0 on Linux, and eigen() is producing different results with identical calls. Specifically, when I run the code below, I get "FALSE" from identical(). Just in case it had something to do with a random number generator, I put identical set.seed() calls immediately before