There are multiple definitions of the sample variance of weighted data in the literature. Which one does Mathematica use? An equation in terms of the arguments provided to WeightedData[] would be best.

  • 3
    $\begingroup$ You can use symbolic arguments in WeightedData. You can try, for example, FullSimplify@Variance[WeightedData[Array[d, 3], Array[w, 3]]] $\endgroup$ – kglr Feb 5 '20 at 14:17
  • 1
    $\begingroup$ Also note that the documentation of Variance mentions that the estimator for WeightedData is unbiased. That should rule out some of the definitions (like maximum likelihood estimators). $\endgroup$ – Sjoerd Smit Feb 5 '20 at 14:50
  • $\begingroup$ Thanks! There are at least two different unbiased estimators; e.g., see Wikipedia:Weighted arithmetic mean. The FullSimplify trick shows that Mathematica is providing what is called there the "reliability weighted sample variance." $\endgroup$ – David S Feb 6 '20 at 16:27
  • $\begingroup$ I've found the lack of explict mathematical formulae a problem in some other cases in the Mathematica documentation, particularly when there are multiple definitions in use. It would be useful if the "Details" section were always specific enough to enable to formula to be deduced. $\endgroup$ – David S Feb 6 '20 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.