c++ - What is the purpose of boost accumulator error_of<mean>? -


the documentation of error_of< mean > feature boost accumulators states calculates error of mean value formula:

sqrt(variance / (count - 1)),

where variance calculated by:

variance = 1/count sum[ (x_i - x_m)^2 ] sum goes on values x_i i=1..count of sample , x_m mean value. gives used formula (for error value):

sqrt(1/ (count(count - 1)) sum[ (x_i - x_m)^2 ] ),

wikipedia states standard deviation, 1 use either uncorrected or corrected sample standard deviation. latter calculated by:

sqrt(1/(count-1) * sum[ (x_i - x_m)^2] )

this 1 use calculate errors of mean values. purpose of error_of< mean >? , error calculated there?

the overall formula of boost.accumulators indeed correct, computed in non-standard fashion.

first, sample variance average of squared deviations

v_sample = sum[ (x_i - x_m)^2] / count s_sample = sqrt[ v_sample ]  

but s_sample biased estimater of population standard deviation sigma. unbiased estimator of population standard deviation is

s_pop = s_sample * sqrt[ count / count - 1 ] 

second, standard error on mean error have measured mean. can use standard error on mean construct confidence intervals around sample arithmetic mean estimator of population mean mu.

the standard error on mean given ratio of unbiased estimator of population standard deviation divided square root of number of observations

s_mean = s_pop / sqrt[ count ] 

boost.accumulator computes s_mean as

s_mean = s_sample / sqrt[count - 1] 

but 2 expression equivalent, can readily seen direct substition of relation between s_pop , s_sample.

note: think useful boost.accumulators define these 2 versions of standard deviation.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -