Calculate variance without calculating the mean Announcing the arrival of Valued Associate...

The Nth Gryphon Number

Is the Mordenkainen's Sword spell underpowered?

How to make an animal which can only breed for a certain number of generations?

.bashrc alias for a command with fixed second parameter

Is it OK to use the testing sample to compare algorithms?

Diophantine equation 3^a+1=3^b+5^c

How does the body cool itself in a stillsuit?

Vertical ranges of Column Plots in 12

How could a hydrazine and N2O4 cloud (or it's reactants) show up in weather radar?

Found this skink in my tomato plant bucket. Is he trapped? Or could he leave if he wanted?

Why is there so little support for joining EFTA in the British parliament?

Why do C and C++ allow the expression (int) + 4*5;

As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?

Why did Bronn offer to be Tyrion Lannister's champion in trial by combat?

Problem with display of presentation

How does TikZ render an arc?

Marquee sign letters

Adapting the Chinese Remainder Theorem (CRT) for integers to polynomials

What are some likely causes to domain member PC losing contact to domain controller?

Was the pager message from Nick Fury to Captain Marvel unnecessary?

Getting representations of the Lie group out of representations of its Lie algebra

What did Turing mean when saying that "machines cannot give rise to surprises" is due to a fallacy?

Besides transaction validation, are there any other uses of the Script language in Bitcoin

What was the last profitable war?



Calculate variance without calculating the mean



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How would you explain covariance to someone who understands only the mean?When does a distribution not have a mean or a variance?How to calculate the variance for mean of means?Using the median for calculating VarianceHigher variance in sample mean or sample median?Calculate variance from mean and variance of binsHow do you use the CLT without knowing variance?Calculate the variance from variancesHow to calculate the variance for the mean of means of binomial only i.d. variables?Calculating new Mean and Variance after observation removalcalculating mean and variance of non-stationary time dependent samplesCalculating the variance of sample, knowing the mean of population





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







7












$begingroup$


Can we calculate the variance without using the mean as the 'base' point?










share|cite|improve this question











$endgroup$








  • 3




    $begingroup$
    Given $mathbb{E}(X^2)<infty$, the variance is given by $sigma^2 = mathbb{E}((X-mathbb{E}(X))^2)$ by definition. The formular simplifies to $sigma^2 =mathbb{E}(X^2) - mathbb{E}(X)^2$. I.e., for the variance you need $mathbb{E}(X)$. Of course you could define your own dispersion measure using some other statistic...or use one from the answers.
    $endgroup$
    – BloXX
    Mar 26 at 7:56








  • 5




    $begingroup$
    Short answer: Lots of other ways to summarize variability (dispersion, spread, scale) but none of the others would be the variance. (In fact, the variance can be defined without reference to the mean.)
    $endgroup$
    – Nick Cox
    Mar 26 at 8:28






  • 3




    $begingroup$
    Yes: given data $X,$ compute the covariance of $(X,X)$ as described at stats.stackexchange.com/a/18200/919. This method never computes the mean.
    $endgroup$
    – whuber
    Mar 26 at 13:15


















7












$begingroup$


Can we calculate the variance without using the mean as the 'base' point?










share|cite|improve this question











$endgroup$








  • 3




    $begingroup$
    Given $mathbb{E}(X^2)<infty$, the variance is given by $sigma^2 = mathbb{E}((X-mathbb{E}(X))^2)$ by definition. The formular simplifies to $sigma^2 =mathbb{E}(X^2) - mathbb{E}(X)^2$. I.e., for the variance you need $mathbb{E}(X)$. Of course you could define your own dispersion measure using some other statistic...or use one from the answers.
    $endgroup$
    – BloXX
    Mar 26 at 7:56








  • 5




    $begingroup$
    Short answer: Lots of other ways to summarize variability (dispersion, spread, scale) but none of the others would be the variance. (In fact, the variance can be defined without reference to the mean.)
    $endgroup$
    – Nick Cox
    Mar 26 at 8:28






  • 3




    $begingroup$
    Yes: given data $X,$ compute the covariance of $(X,X)$ as described at stats.stackexchange.com/a/18200/919. This method never computes the mean.
    $endgroup$
    – whuber
    Mar 26 at 13:15














7












7








7


1



$begingroup$


Can we calculate the variance without using the mean as the 'base' point?










share|cite|improve this question











$endgroup$




Can we calculate the variance without using the mean as the 'base' point?







mathematical-statistics variance mean median scale-estimator






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Apr 4 at 7:02









Ferdi

3,88452355




3,88452355










asked Mar 26 at 7:46









WillWill

411




411








  • 3




    $begingroup$
    Given $mathbb{E}(X^2)<infty$, the variance is given by $sigma^2 = mathbb{E}((X-mathbb{E}(X))^2)$ by definition. The formular simplifies to $sigma^2 =mathbb{E}(X^2) - mathbb{E}(X)^2$. I.e., for the variance you need $mathbb{E}(X)$. Of course you could define your own dispersion measure using some other statistic...or use one from the answers.
    $endgroup$
    – BloXX
    Mar 26 at 7:56








  • 5




    $begingroup$
    Short answer: Lots of other ways to summarize variability (dispersion, spread, scale) but none of the others would be the variance. (In fact, the variance can be defined without reference to the mean.)
    $endgroup$
    – Nick Cox
    Mar 26 at 8:28






  • 3




    $begingroup$
    Yes: given data $X,$ compute the covariance of $(X,X)$ as described at stats.stackexchange.com/a/18200/919. This method never computes the mean.
    $endgroup$
    – whuber
    Mar 26 at 13:15














  • 3




    $begingroup$
    Given $mathbb{E}(X^2)<infty$, the variance is given by $sigma^2 = mathbb{E}((X-mathbb{E}(X))^2)$ by definition. The formular simplifies to $sigma^2 =mathbb{E}(X^2) - mathbb{E}(X)^2$. I.e., for the variance you need $mathbb{E}(X)$. Of course you could define your own dispersion measure using some other statistic...or use one from the answers.
    $endgroup$
    – BloXX
    Mar 26 at 7:56








  • 5




    $begingroup$
    Short answer: Lots of other ways to summarize variability (dispersion, spread, scale) but none of the others would be the variance. (In fact, the variance can be defined without reference to the mean.)
    $endgroup$
    – Nick Cox
    Mar 26 at 8:28






  • 3




    $begingroup$
    Yes: given data $X,$ compute the covariance of $(X,X)$ as described at stats.stackexchange.com/a/18200/919. This method never computes the mean.
    $endgroup$
    – whuber
    Mar 26 at 13:15








3




3




$begingroup$
Given $mathbb{E}(X^2)<infty$, the variance is given by $sigma^2 = mathbb{E}((X-mathbb{E}(X))^2)$ by definition. The formular simplifies to $sigma^2 =mathbb{E}(X^2) - mathbb{E}(X)^2$. I.e., for the variance you need $mathbb{E}(X)$. Of course you could define your own dispersion measure using some other statistic...or use one from the answers.
$endgroup$
– BloXX
Mar 26 at 7:56






$begingroup$
Given $mathbb{E}(X^2)<infty$, the variance is given by $sigma^2 = mathbb{E}((X-mathbb{E}(X))^2)$ by definition. The formular simplifies to $sigma^2 =mathbb{E}(X^2) - mathbb{E}(X)^2$. I.e., for the variance you need $mathbb{E}(X)$. Of course you could define your own dispersion measure using some other statistic...or use one from the answers.
$endgroup$
– BloXX
Mar 26 at 7:56






5




5




$begingroup$
Short answer: Lots of other ways to summarize variability (dispersion, spread, scale) but none of the others would be the variance. (In fact, the variance can be defined without reference to the mean.)
$endgroup$
– Nick Cox
Mar 26 at 8:28




$begingroup$
Short answer: Lots of other ways to summarize variability (dispersion, spread, scale) but none of the others would be the variance. (In fact, the variance can be defined without reference to the mean.)
$endgroup$
– Nick Cox
Mar 26 at 8:28




3




3




$begingroup$
Yes: given data $X,$ compute the covariance of $(X,X)$ as described at stats.stackexchange.com/a/18200/919. This method never computes the mean.
$endgroup$
– whuber
Mar 26 at 13:15




$begingroup$
Yes: given data $X,$ compute the covariance of $(X,X)$ as described at stats.stackexchange.com/a/18200/919. This method never computes the mean.
$endgroup$
– whuber
Mar 26 at 13:15










2 Answers
2






active

oldest

votes


















12












$begingroup$

The median absolute deviation is defined as
$$text{MAD}(X) = text{median} |X-text{median}(X)|$$
and is considered an alternative to the standard deviation. But this is not the variance. In particular, it always exists, whether or not $X$ allows for moments. For instance, the MAD of a standard Cauchy is equal to one since
$$underbrace{Bbb P(|X-0|<1)}_text{0 is the median}=arctan(1)/pi-arctan(-1)/pi=frac{1}{2}$$






share|cite|improve this answer











$endgroup$









  • 7




    $begingroup$
    Newcomers to this idea should watch out also for mean absolute deviation from the mean (mean deviation, often) and median absolute deviation from the mean. I don't recall mean absolute deviation from the median, but am open to examples. The abbreviation MAD, unfortunately, has been applied variously, so trust people's code first, then their algebraic or verbal definition, but use of an abbreviation MAD only not at all. In symmetric distributions, and some others, MAD as defined here is half the interquartile range. (Punning on MAD I resist as a little too obvious.)
    $endgroup$
    – Nick Cox
    Mar 26 at 8:23








  • 3




    $begingroup$
    Also, note that software implementations of the median absolute deviation function can scale the MAD value by a constant factor from the form presented in this answer, so that its value coincides with the standard deviation for a normal distribution.
    $endgroup$
    – EdM
    Mar 26 at 8:30










  • $begingroup$
    @EdM Excellent point. Personally I dislike that practice unless people use some different term. It's no longer the MAD!
    $endgroup$
    – Nick Cox
    Mar 26 at 8:35






  • 1




    $begingroup$
    @NickCox: the appeal of centring on the median is that the quantity always exists, whether or not the distribution enjoys a mean. This is the definition found in Wikipedia.
    $endgroup$
    – Xi'an
    Mar 26 at 9:20










  • $begingroup$
    MAD is Mutually Assured Destruction
    $endgroup$
    – kjetil b halvorsen
    Mar 26 at 10:05



















3












$begingroup$

There is already a solution for this question on Math.stackexchange:



I summarize the answers:




  1. You can use that the variance is $overline{x^2} - overline {x}^2$, which takes only one pass (computing the mean and the mean of the squares simultaneously), but can be more prone to roundoff error if the variance is small compared with the mean.





  1. How about sum of squared pairwise differences ? Indeed, you can check by direct computation that


$$
2v_X = frac{1}{n(n-1)}sum_{1 le i < j le n}(x_i - x_j)^2.
$$






  1. The sample variance without mean is calculated as:
    $$ v_{X}=frac{1}{n-1}left [ sum_{i=1}^{n}x_{i}^{2}-frac{1}{n}left ( sum_{i=1}^{n}x_{i} right ) ^{2}right ] $$






share|cite|improve this answer











$endgroup$














    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "65"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f399445%2fcalculate-variance-without-calculating-the-mean%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    12












    $begingroup$

    The median absolute deviation is defined as
    $$text{MAD}(X) = text{median} |X-text{median}(X)|$$
    and is considered an alternative to the standard deviation. But this is not the variance. In particular, it always exists, whether or not $X$ allows for moments. For instance, the MAD of a standard Cauchy is equal to one since
    $$underbrace{Bbb P(|X-0|<1)}_text{0 is the median}=arctan(1)/pi-arctan(-1)/pi=frac{1}{2}$$






    share|cite|improve this answer











    $endgroup$









    • 7




      $begingroup$
      Newcomers to this idea should watch out also for mean absolute deviation from the mean (mean deviation, often) and median absolute deviation from the mean. I don't recall mean absolute deviation from the median, but am open to examples. The abbreviation MAD, unfortunately, has been applied variously, so trust people's code first, then their algebraic or verbal definition, but use of an abbreviation MAD only not at all. In symmetric distributions, and some others, MAD as defined here is half the interquartile range. (Punning on MAD I resist as a little too obvious.)
      $endgroup$
      – Nick Cox
      Mar 26 at 8:23








    • 3




      $begingroup$
      Also, note that software implementations of the median absolute deviation function can scale the MAD value by a constant factor from the form presented in this answer, so that its value coincides with the standard deviation for a normal distribution.
      $endgroup$
      – EdM
      Mar 26 at 8:30










    • $begingroup$
      @EdM Excellent point. Personally I dislike that practice unless people use some different term. It's no longer the MAD!
      $endgroup$
      – Nick Cox
      Mar 26 at 8:35






    • 1




      $begingroup$
      @NickCox: the appeal of centring on the median is that the quantity always exists, whether or not the distribution enjoys a mean. This is the definition found in Wikipedia.
      $endgroup$
      – Xi'an
      Mar 26 at 9:20










    • $begingroup$
      MAD is Mutually Assured Destruction
      $endgroup$
      – kjetil b halvorsen
      Mar 26 at 10:05
















    12












    $begingroup$

    The median absolute deviation is defined as
    $$text{MAD}(X) = text{median} |X-text{median}(X)|$$
    and is considered an alternative to the standard deviation. But this is not the variance. In particular, it always exists, whether or not $X$ allows for moments. For instance, the MAD of a standard Cauchy is equal to one since
    $$underbrace{Bbb P(|X-0|<1)}_text{0 is the median}=arctan(1)/pi-arctan(-1)/pi=frac{1}{2}$$






    share|cite|improve this answer











    $endgroup$









    • 7




      $begingroup$
      Newcomers to this idea should watch out also for mean absolute deviation from the mean (mean deviation, often) and median absolute deviation from the mean. I don't recall mean absolute deviation from the median, but am open to examples. The abbreviation MAD, unfortunately, has been applied variously, so trust people's code first, then their algebraic or verbal definition, but use of an abbreviation MAD only not at all. In symmetric distributions, and some others, MAD as defined here is half the interquartile range. (Punning on MAD I resist as a little too obvious.)
      $endgroup$
      – Nick Cox
      Mar 26 at 8:23








    • 3




      $begingroup$
      Also, note that software implementations of the median absolute deviation function can scale the MAD value by a constant factor from the form presented in this answer, so that its value coincides with the standard deviation for a normal distribution.
      $endgroup$
      – EdM
      Mar 26 at 8:30










    • $begingroup$
      @EdM Excellent point. Personally I dislike that practice unless people use some different term. It's no longer the MAD!
      $endgroup$
      – Nick Cox
      Mar 26 at 8:35






    • 1




      $begingroup$
      @NickCox: the appeal of centring on the median is that the quantity always exists, whether or not the distribution enjoys a mean. This is the definition found in Wikipedia.
      $endgroup$
      – Xi'an
      Mar 26 at 9:20










    • $begingroup$
      MAD is Mutually Assured Destruction
      $endgroup$
      – kjetil b halvorsen
      Mar 26 at 10:05














    12












    12








    12





    $begingroup$

    The median absolute deviation is defined as
    $$text{MAD}(X) = text{median} |X-text{median}(X)|$$
    and is considered an alternative to the standard deviation. But this is not the variance. In particular, it always exists, whether or not $X$ allows for moments. For instance, the MAD of a standard Cauchy is equal to one since
    $$underbrace{Bbb P(|X-0|<1)}_text{0 is the median}=arctan(1)/pi-arctan(-1)/pi=frac{1}{2}$$






    share|cite|improve this answer











    $endgroup$



    The median absolute deviation is defined as
    $$text{MAD}(X) = text{median} |X-text{median}(X)|$$
    and is considered an alternative to the standard deviation. But this is not the variance. In particular, it always exists, whether or not $X$ allows for moments. For instance, the MAD of a standard Cauchy is equal to one since
    $$underbrace{Bbb P(|X-0|<1)}_text{0 is the median}=arctan(1)/pi-arctan(-1)/pi=frac{1}{2}$$







    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited Mar 26 at 12:13









    ukemi

    1053




    1053










    answered Mar 26 at 7:59









    Xi'anXi'an

    59.7k897368




    59.7k897368








    • 7




      $begingroup$
      Newcomers to this idea should watch out also for mean absolute deviation from the mean (mean deviation, often) and median absolute deviation from the mean. I don't recall mean absolute deviation from the median, but am open to examples. The abbreviation MAD, unfortunately, has been applied variously, so trust people's code first, then their algebraic or verbal definition, but use of an abbreviation MAD only not at all. In symmetric distributions, and some others, MAD as defined here is half the interquartile range. (Punning on MAD I resist as a little too obvious.)
      $endgroup$
      – Nick Cox
      Mar 26 at 8:23








    • 3




      $begingroup$
      Also, note that software implementations of the median absolute deviation function can scale the MAD value by a constant factor from the form presented in this answer, so that its value coincides with the standard deviation for a normal distribution.
      $endgroup$
      – EdM
      Mar 26 at 8:30










    • $begingroup$
      @EdM Excellent point. Personally I dislike that practice unless people use some different term. It's no longer the MAD!
      $endgroup$
      – Nick Cox
      Mar 26 at 8:35






    • 1




      $begingroup$
      @NickCox: the appeal of centring on the median is that the quantity always exists, whether or not the distribution enjoys a mean. This is the definition found in Wikipedia.
      $endgroup$
      – Xi'an
      Mar 26 at 9:20










    • $begingroup$
      MAD is Mutually Assured Destruction
      $endgroup$
      – kjetil b halvorsen
      Mar 26 at 10:05














    • 7




      $begingroup$
      Newcomers to this idea should watch out also for mean absolute deviation from the mean (mean deviation, often) and median absolute deviation from the mean. I don't recall mean absolute deviation from the median, but am open to examples. The abbreviation MAD, unfortunately, has been applied variously, so trust people's code first, then their algebraic or verbal definition, but use of an abbreviation MAD only not at all. In symmetric distributions, and some others, MAD as defined here is half the interquartile range. (Punning on MAD I resist as a little too obvious.)
      $endgroup$
      – Nick Cox
      Mar 26 at 8:23








    • 3




      $begingroup$
      Also, note that software implementations of the median absolute deviation function can scale the MAD value by a constant factor from the form presented in this answer, so that its value coincides with the standard deviation for a normal distribution.
      $endgroup$
      – EdM
      Mar 26 at 8:30










    • $begingroup$
      @EdM Excellent point. Personally I dislike that practice unless people use some different term. It's no longer the MAD!
      $endgroup$
      – Nick Cox
      Mar 26 at 8:35






    • 1




      $begingroup$
      @NickCox: the appeal of centring on the median is that the quantity always exists, whether or not the distribution enjoys a mean. This is the definition found in Wikipedia.
      $endgroup$
      – Xi'an
      Mar 26 at 9:20










    • $begingroup$
      MAD is Mutually Assured Destruction
      $endgroup$
      – kjetil b halvorsen
      Mar 26 at 10:05








    7




    7




    $begingroup$
    Newcomers to this idea should watch out also for mean absolute deviation from the mean (mean deviation, often) and median absolute deviation from the mean. I don't recall mean absolute deviation from the median, but am open to examples. The abbreviation MAD, unfortunately, has been applied variously, so trust people's code first, then their algebraic or verbal definition, but use of an abbreviation MAD only not at all. In symmetric distributions, and some others, MAD as defined here is half the interquartile range. (Punning on MAD I resist as a little too obvious.)
    $endgroup$
    – Nick Cox
    Mar 26 at 8:23






    $begingroup$
    Newcomers to this idea should watch out also for mean absolute deviation from the mean (mean deviation, often) and median absolute deviation from the mean. I don't recall mean absolute deviation from the median, but am open to examples. The abbreviation MAD, unfortunately, has been applied variously, so trust people's code first, then their algebraic or verbal definition, but use of an abbreviation MAD only not at all. In symmetric distributions, and some others, MAD as defined here is half the interquartile range. (Punning on MAD I resist as a little too obvious.)
    $endgroup$
    – Nick Cox
    Mar 26 at 8:23






    3




    3




    $begingroup$
    Also, note that software implementations of the median absolute deviation function can scale the MAD value by a constant factor from the form presented in this answer, so that its value coincides with the standard deviation for a normal distribution.
    $endgroup$
    – EdM
    Mar 26 at 8:30




    $begingroup$
    Also, note that software implementations of the median absolute deviation function can scale the MAD value by a constant factor from the form presented in this answer, so that its value coincides with the standard deviation for a normal distribution.
    $endgroup$
    – EdM
    Mar 26 at 8:30












    $begingroup$
    @EdM Excellent point. Personally I dislike that practice unless people use some different term. It's no longer the MAD!
    $endgroup$
    – Nick Cox
    Mar 26 at 8:35




    $begingroup$
    @EdM Excellent point. Personally I dislike that practice unless people use some different term. It's no longer the MAD!
    $endgroup$
    – Nick Cox
    Mar 26 at 8:35




    1




    1




    $begingroup$
    @NickCox: the appeal of centring on the median is that the quantity always exists, whether or not the distribution enjoys a mean. This is the definition found in Wikipedia.
    $endgroup$
    – Xi'an
    Mar 26 at 9:20




    $begingroup$
    @NickCox: the appeal of centring on the median is that the quantity always exists, whether or not the distribution enjoys a mean. This is the definition found in Wikipedia.
    $endgroup$
    – Xi'an
    Mar 26 at 9:20












    $begingroup$
    MAD is Mutually Assured Destruction
    $endgroup$
    – kjetil b halvorsen
    Mar 26 at 10:05




    $begingroup$
    MAD is Mutually Assured Destruction
    $endgroup$
    – kjetil b halvorsen
    Mar 26 at 10:05













    3












    $begingroup$

    There is already a solution for this question on Math.stackexchange:



    I summarize the answers:




    1. You can use that the variance is $overline{x^2} - overline {x}^2$, which takes only one pass (computing the mean and the mean of the squares simultaneously), but can be more prone to roundoff error if the variance is small compared with the mean.





    1. How about sum of squared pairwise differences ? Indeed, you can check by direct computation that


    $$
    2v_X = frac{1}{n(n-1)}sum_{1 le i < j le n}(x_i - x_j)^2.
    $$






    1. The sample variance without mean is calculated as:
      $$ v_{X}=frac{1}{n-1}left [ sum_{i=1}^{n}x_{i}^{2}-frac{1}{n}left ( sum_{i=1}^{n}x_{i} right ) ^{2}right ] $$






    share|cite|improve this answer











    $endgroup$


















      3












      $begingroup$

      There is already a solution for this question on Math.stackexchange:



      I summarize the answers:




      1. You can use that the variance is $overline{x^2} - overline {x}^2$, which takes only one pass (computing the mean and the mean of the squares simultaneously), but can be more prone to roundoff error if the variance is small compared with the mean.





      1. How about sum of squared pairwise differences ? Indeed, you can check by direct computation that


      $$
      2v_X = frac{1}{n(n-1)}sum_{1 le i < j le n}(x_i - x_j)^2.
      $$






      1. The sample variance without mean is calculated as:
        $$ v_{X}=frac{1}{n-1}left [ sum_{i=1}^{n}x_{i}^{2}-frac{1}{n}left ( sum_{i=1}^{n}x_{i} right ) ^{2}right ] $$






      share|cite|improve this answer











      $endgroup$
















        3












        3








        3





        $begingroup$

        There is already a solution for this question on Math.stackexchange:



        I summarize the answers:




        1. You can use that the variance is $overline{x^2} - overline {x}^2$, which takes only one pass (computing the mean and the mean of the squares simultaneously), but can be more prone to roundoff error if the variance is small compared with the mean.





        1. How about sum of squared pairwise differences ? Indeed, you can check by direct computation that


        $$
        2v_X = frac{1}{n(n-1)}sum_{1 le i < j le n}(x_i - x_j)^2.
        $$






        1. The sample variance without mean is calculated as:
          $$ v_{X}=frac{1}{n-1}left [ sum_{i=1}^{n}x_{i}^{2}-frac{1}{n}left ( sum_{i=1}^{n}x_{i} right ) ^{2}right ] $$






        share|cite|improve this answer











        $endgroup$



        There is already a solution for this question on Math.stackexchange:



        I summarize the answers:




        1. You can use that the variance is $overline{x^2} - overline {x}^2$, which takes only one pass (computing the mean and the mean of the squares simultaneously), but can be more prone to roundoff error if the variance is small compared with the mean.





        1. How about sum of squared pairwise differences ? Indeed, you can check by direct computation that


        $$
        2v_X = frac{1}{n(n-1)}sum_{1 le i < j le n}(x_i - x_j)^2.
        $$






        1. The sample variance without mean is calculated as:
          $$ v_{X}=frac{1}{n-1}left [ sum_{i=1}^{n}x_{i}^{2}-frac{1}{n}left ( sum_{i=1}^{n}x_{i} right ) ^{2}right ] $$







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Mar 26 at 17:08

























        answered Mar 26 at 16:48









        FerdiFerdi

        3,88452355




        3,88452355






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Cross Validated!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f399445%2fcalculate-variance-without-calculating-the-mean%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            六本木駅

            Integral that is continuous and looks like it converges to a geometric seriesTesting if a geometric series converges by taking limit to infinitySummation of arithmetic-geometric series of higher orderGeometric series with polynomial exponentHow to Recognize a Geometric SeriesShowing an integral equality with series over the integersDiscontinuity of a series of continuous functionsReasons why a Series ConvergesSum of infinite geometric series with two terms in summationUsing geometric series for computing IntegralsLimit of geometric series sum when $r = 1$

            Joseph Lister