I want to do some simple statistics in C++. I'm starting out super-simple - average, standard deviation, kurtosis, moments, quantiles. Later on I might want to go in a bit deeper.

So, I'm looking for a statistics-oriented (or statistics-only) library.

Required features:

  • Written in C++ (or at least - C++ headers + compiled library, in which case I suppose it doesn't terribly matter if it's another language)
  • C++11-aware design (of the API at least)
  • Well-templated, so it doesn't force a lot of its own choices on me
  • Specifically, must supports standard library containers and iterators as input (which obviously requires templating)
  • Simple functionality must not require more than a few lines of code to put to use
  • No weird stuff like starting auxiliary processes, parallelizing without letting me control it, bringing up interpretation engines for other languages etc.
  • Libre license (incl. source of course)
  • Gratis
  • Works in GNU/Linux on x86_64 machines

Desired features:

  • Fast to compile against
  • Header-oriented
  • Good performance
  • Has a known "position" in the performance space vis-a-vis well-known statistics/algebra/math libraries (could even be because it uses them under the hood)
  • Well-documented
  • Under active development

Note: Slightly related to this question.

  • 1
    Any time I see "Open Source" and "Statistics" and "Programming" my mind starts screaming about R and what it offers. Quick google for "r c++" may do it, or "cran R c++" – ivanivan Jan 3 '17 at 4:39
  • @ivanivan: Oh, no, I don't want that kind of a behemoth. Let me tweak the requirements a bit. – einpoklum Jan 3 '17 at 8:25

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.