CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2009
    Location
    Boston
    Posts
    364

    c++ statistics code

    I am wondering if there is some repository of c++ code for statistics comparing two columns of numbers? Statistics are so common now that it seems like with the oo concept of reusable code there should be allot of that floating around. Code that would accept two vectors and generate comparisons like pearson's correlation, root mean square error, mean absolute error, median absolute error, etc would be very useful.

    I have looked around some and find some code examples, and other posts basically saying, "Google the algorithm and figure it out yourself." At this point, there should almost be stl classes like the ones for union(), intersection(), accumulate(), and other simpler math functions.

    Is there anything like this out there that someone can point me to?

    LMHmedchem

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: c++ statistics code

    Wikipedia has a list of numerical libraries with a C++ section that you can check out.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #3
    Join Date
    Oct 2008
    Posts
    1,456

    Re: c++ statistics code

    take a look at the boost accumulator library ( and the boost math library for statistics oriented math support ). Moreover, I'm not a fan neither of scripting languages nor of "general purpose" statistics ( because people systematically abuse them ) but statsitics oriented languages like R ( or python ) seems quite popular among scientists, so it may be worth considering to have bindings with your c++ program to them if performance is not a primary requirement.

  4. #4
    Join Date
    May 2009
    Location
    Boston
    Posts
    364

    Re: c++ statistics code

    Thanks for the suggestions. I ended up writing my own code based on available examples. There are a number of available libraries that support these calculations, but the functions weren't very hard to write. I had to make some adjustments because I calculate the statistics on sub-sets of my vectors, so I probably couldn't have used anything canned anyway.

    I will post my code when I get a chance in case anyone else is interested.

    LMHmedchem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured