Comments (6)
As you have pointed out, RSpectra uses a deterministic initial vector, so it does not use the RNG in R. I may add the support for user-supplied initial vector in a future release.
from rspectra.
Oh, of course! I was so distracted by the presence of a RNG that I didn’t think about how you used it.
So we have two reasonable choices:
- make the default vector dependent on R’s seed (which means that determinism after
set.seed(s)
breaks once when that behavior is implemented, and determinism withoutset.seed(s)
is removed) - leave the default vector as that one deterministic one and only add the ability to specify a custom one.
Option 1 is like everyone does it: nondeterminism by default, determinism after set.seed()
. Useful to catch artifacts caused by the deterministic vector happening to have some special properties in some use cases
Option 2 is to make things predictable by default.
I’m a fan of option 1. The last thing you want is paper containing wrong findings because your eigenvectors have artifacts in them. I always develop without set.seed()
and publish my end results with a seed that makes them 100% reproducible.
from rspectra.
I may finally choose option 2, since I believe for most users they don't understand or care about the effect of the initial vector. Strictly speaking, the Lanczos method that RSpectra uses is not a randomized algorithm. Virtually the only thing that is random is the initial vector, and it plays a similar role as the initial value in a Newton iteration. As long as it is not too weird, the final result should only have very tiny dependence on it.
If the default one is really bad, the algorithm is very likely to fail somewhere else so users can catch that. Otherwise users may get confused if they are unaware of the Krylov space algorithm.
For advanced users like you, it is trivial to mimic the behaviour of option 1 by passing an runif(n)
vector to the function. Does it sound good to you? I'll report here after I add the functionality.
from rspectra.
Sounds good, yes! Thank you.
from rspectra.
Added this feature in the new release. You can now use eigs(..., opts = list(initvec = ...))
.
from rspectra.
amazing, thank you very much!
from rspectra.
Related Issues (20)
- Installation error on Ubuntu 18.04 HOT 5
- svds in version 0.13-1 vs 0.12-0 HOT 1
- Ubuntu 16.04 Intallation HOT 1
- Installation error on Ubuntu HOT 3
- Support dsCMatrix/dsRMatrix HOT 9
- Unable to install dev version HOT 5
- how to control the cores used by svds HOT 2
- Unstable selection of eigenvalues and eigenvectors? HOT 5
- Error: TridiagEigen: eigen decomposition failed
- compilation warnings on ubuntu with gcc
- eigenvalues are incorrect with opts = list(center=TRUE scale=TRUE) HOT 4
- Choose the number of components dynamically
- Function interface for svds HOT 4
- eigs and eigs_sym have trouble converging for which = "SA" HOT 5
- generalized eigenvalues HOT 3
- Warm start in svds() HOT 12
- eigs_sym has negative eigenvalue HOT 12
- Installation error Ubuntu 16.04 HOT 2
- Error when installing: "internal compiler error: in predicate_mem_writes" HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rspectra.