Re: [Boost-users] boost::math::standard_deviation how to use ?
My 2-cent
One can easily compute the standard deviation of data contained in a std::vector as shown here:
http://stackoverflow.com/questions/7616511/calculate-mean-and-standard-devia...
Another option is resorting on boost, and any boost container as here:
http://www.boost.org/doc/libs/1_41_0/libs/math/doc/sf_and_dist/html/math_too...
I mean I am not sure ** in this case *** trying to mix standard vector and boost is the best solution.
Best
Edouard
https://quantcorner.wordpress.com/
=========
Message: 4
Date: Fri, 17 Aug 2012 13:15:50 -0700 (PDT)
From: leeto
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Edouard Tallent Sent: Saturday, August 18, 2012 6:53 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] boost::math::standard_deviation how to use ?
My 2-cent One can easily compute the standard deviation of data contained in a std::vector as shown here: http://stackoverflow.com/questions/7616511/calculate-mean-and-standard-devia... samples-in-c-using-boost
These are textbook algorithms, but assume that there are no outliers (and a normal distribution). Including outliers (usually very small or very big values) will produce highly misleading standard deviation (and any other statistical inferences that you make). Garbage in - garbage out ;-) So unless you absolutely certain that there are no 'dud' items, you should always detect and remove outliers before finally calculating a standard deviation. Michael Frigge, David C. Hoaglin and Boris Iglewicz The American Statistician, Vol. 43, No. 1 (Feb., 1989), pp. 50-54 Tukey, J. W. Exploratory Data Analysis, Addison Wesley (1977, p 33) "Some Implementations of the Boxplot" include several versions of outlier marking for boxplots. https://svn.boost.org/svn/boost/sandbox/SOC/2007/visualization/boost/svg_plo... from Jake Voytko's Googe summer of Code project still in the Boost Sandbox will give you some ideas on how you can code simple outlier removal. Finally, bear in mind the very large uncertainty of standard deviations computed from a few values. http://www.boost.org/doc/libs/1_50_0/libs/math/doc/sf_and_dist/html/math_too... s_eg/chi_sq_intervals.html see the table Confidence intervals as a function of the number of observations should make you sceptical of blind calculations. HTH Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com
participants (2)
-
Edouard Tallent
-
Paul A. Bristow