3 ms·
NR performed poorly, in my experience. Many years ago, I tried using NR for optimization problems. The functions were dog slow, because they tended to set asid
by bluenose69 10y ago
NR performed poorly, in my experience.
Many years ago, I tried using NR for optimization problems. The functions were dog slow, because they tended to set aside space at the start and free it up at the end, and that burns up a lot of time for functions that are called frequently.
The alternative, used in the much-faster NAG and IMSL systems, was for the user to set aside memory before calling any functions, and to hand functions "working memory". This scheme demanded more of the user (yielding bad problems when you gave insufficient memory!) but it delivered much better performance.
For my particular problem, a particular NAG routine (name now forgotten) was almost magical in finding solutions in a relatively small number of iterations. As I recall, the NAG code was closed, so I never knew how the authors got such good results. I imagine the secret was in the realm of clever numerical analysis, as opposed to clever coding.
Relative to other systems, NR had the advantage that you could see the code. Quite often, the code provided examples of how not to do things. But at least you could see the code.
As for matters of licensing, I think they are covered very well in other comments in this thread.
- ThenAsNow 10y agoIn my experience, there is immense value in NR as a set of curated numerical algorithms. What other criticisms dismiss as "chattiness" is oftentimes an altogether more useful explanation as to the background and rationale for the algorithm's inclusion than your local numerics professor is likely provide. The best way to use NR, IME, is as a reference that guides you through the huge body of literature to arrive at some specific method recommendations, like a more helpful combination of Wikipedia + Stack Overflow. Use those references to help you understand the algorithm in original form, and where the NR authors have made changes to the algorithm or parameters, it's good to understand why. I wholeheartedly agree with the parent's description of their code as "how not to do things". This I think is less true from a strictly numerics perspective than it is true of the general structure of their code, naming, interfaces, etc. I would throw much of those aspects out if implementing their methods. I had a numerics professor on my grad committee ask for NR to be removed as a reference in a journal paper we were preparing, on the basis that it is "not taken seriously" among the numerics community. He wanted the source references cited, i.e., the original books and papers in which the method I was using were detailed. However, NR tied all those pieces together in a very coherent and approachable way, and gave helpful recommendations on implementation details. People steeped in the field don't appreciate the encyclopedic nature of NR, which is not to be lightly dismissed for engineers and practitioners. I have not seen a numerics prof-blessed text in the vein of NR that gets the right level of depth for practitioners and presents enough opinion/judgment on state-of-the-art methods to actually be of value. If such a thing exists, please enlighten us! In terms of code implementations, I also wholeheartedly agree that if you can find a high-quality vetted library in your language of choice whose license terms agree with your code/intent, use them! That said, there are definitely areas where NR presents better methods than what is in some of these libraries (ODE solvers are one such area I'm familiar with). Lastly, note that NR has evolved a fair bit over the years. Don't base too much of your opinion on prior versions.