Boost logo

Boost Users :

Subject: [Boost-users] boost::math::standard_deviation how to use ?
From: leeto (denisigoshev_at_[hidden])
Date: 2012-08-17 16:15:50


How to compute standard_deviation using boost
I want that interface will be like in excel i mean you mark some data and
that all )
How do the same in c++ boost using data from a standard container like
vector for example...
Many thanks in advance

#include <boost/math/distributions.hpp> // For non-member functions of
distributions
#include <vector>
 
#include <numeric>
 
using namespace std;
 
int main ()
{
    
        std::vector<double> v;
        for (unsigned int i = 0; i < 7; i++)
            {
                v.push_back(std::rand()%7);
            }
 
        std::vector<double>::iterator i = v.begin();
    
    
 
            for (i ; i != v.end(); ++i)
                {
                    std::cout << (*i) << ", ";
                }
            
    cout << std::accumulate(v.begin(), v.end(),0) << endl;
 
    //boost::math::normal_distribution
 
 
 
    cout << "\n\n\n" ;
    return 0;

--
View this message in context: http://boost.2283326.n4.nabble.com/boost-math-standard-deviation-how-to-use-tp4634435.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net