Improve documentation of different weighted mean standard errors

This commit is contained in:
Vinzent Steinberg 2017-05-19 16:38:40 +02:00
parent d25f267529
commit ed4c11e31d
2 changed files with 8 additions and 0 deletions

View File

@ -77,6 +77,11 @@ impl WeightedAverage {
///
/// Note that this will return 0 if the sum of the weights is 0.
/// For this estimator the sum of weights should be larger than 1.
///
/// This biased estimator uses the weighted variance and the sum of weights.
/// It considers the weights as (noninteger) counts of how often the sample
/// has been observed, applying the standard formulas to calculate mean,
/// variance and sample size across all "repeats".
pub fn error(&self) -> f64 {
// This uses the same estimate as SPSS.
//

View File

@ -112,6 +112,9 @@ impl WeightedAverage {
/// Estimate the standard error of the weighted mean of the sequence.
///
/// Returns 0 if the sum of weights is 0.
///
/// This unbiased estimator assumes that the samples were independently
/// drawn from the same population with constant variance.
pub fn error(&self) -> f64 {
// This uses the same estimate as WinCross.
//