Calculate variance without calculating the mean Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm 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

When is phishing education going too far?

"Seemed to had" is it correct?

What would be the ideal power source for a cybernetic eye?

Disable hyphenation for an entire paragraph

Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?

Why is "Captain Marvel" translated as male in Portugal?

Antler Helmet: Can it work?

What's the purpose of writing one's academic bio in 3rd person?

Is there a concise way to say "all of the X, one of each"?

Is a manifold-with-boundary with given interior and non-empty boundary essentially unique?

How can I make names more distinctive without making them longer?

Do I really need recursive chmod to restrict access to a folder?

Do you forfeit tax refunds/credits if you aren't required to and don't file by April 15?

Can inflation occur in a positive-sum game currency system such as the Stack Exchange reputation system?

Why constant symbols in a language?

How do I stop a creek from eroding my steep embankment?

Why is "Consequences inflicted." not a sentence?

How does a Death Domain cleric's Touch of Death feature work with Touch-range spells delivered by familiars?

3 doors, three guards, one stone

do i need a schengen visa for a direct flight to amsterdam?

What are the motives behind Cersei's orders given to Bronn?

How widely used is the term Treppenwitz? Is it something that most Germans know?

Were Kohanim forbidden from serving in King David's army?

Is it ethical to give a final exam after the professor has quit before teaching the remaining chapters of the course?



Calculate variance without calculating the mean



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm 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 $mathbbE(X^2)<infty$, the variance is given by $sigma^2 = mathbbE((X-mathbbE(X))^2)$ by definition. The formular simplifies to $sigma^2 =mathbbE(X^2) - mathbbE(X)^2$. I.e., for the variance you need $mathbbE(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 $mathbbE(X^2)<infty$, the variance is given by $sigma^2 = mathbbE((X-mathbbE(X))^2)$ by definition. The formular simplifies to $sigma^2 =mathbbE(X^2) - mathbbE(X)^2$. I.e., for the variance you need $mathbbE(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,85952355




3,85952355










asked Mar 26 at 7:46









WillWill

411




411







  • 3




    $begingroup$
    Given $mathbbE(X^2)<infty$, the variance is given by $sigma^2 = mathbbE((X-mathbbE(X))^2)$ by definition. The formular simplifies to $sigma^2 =mathbbE(X^2) - mathbbE(X)^2$. I.e., for the variance you need $mathbbE(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 $mathbbE(X^2)<infty$, the variance is given by $sigma^2 = mathbbE((X-mathbbE(X))^2)$ by definition. The formular simplifies to $sigma^2 =mathbbE(X^2) - mathbbE(X)^2$. I.e., for the variance you need $mathbbE(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 $mathbbE(X^2)<infty$, the variance is given by $sigma^2 = mathbbE((X-mathbbE(X))^2)$ by definition. The formular simplifies to $sigma^2 =mathbbE(X^2) - mathbbE(X)^2$. I.e., for the variance you need $mathbbE(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 $mathbbE(X^2)<infty$, the variance is given by $sigma^2 = mathbbE((X-mathbbE(X))^2)$ by definition. The formular simplifies to $sigma^2 =mathbbE(X^2) - mathbbE(X)^2$. I.e., for the variance you need $mathbbE(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
$$textMAD(X) = textmedian |X-textmedian(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<1)_text0 is the median=arctan(1)/pi-arctan(-1)/pi=frac12$$






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 $overlinex^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 = frac1n(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=frac1n-1left [ sum_i=1^nx_i^2-frac1nleft ( sum_i=1^nx_i right ) ^2right ] $$





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
    $$textMAD(X) = textmedian |X-textmedian(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<1)_text0 is the median=arctan(1)/pi-arctan(-1)/pi=frac12$$






    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
    $$textMAD(X) = textmedian |X-textmedian(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<1)_text0 is the median=arctan(1)/pi-arctan(-1)/pi=frac12$$






    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
    $$textMAD(X) = textmedian |X-textmedian(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<1)_text0 is the median=arctan(1)/pi-arctan(-1)/pi=frac12$$






    share|cite|improve this answer











    $endgroup$



    The median absolute deviation is defined as
    $$textMAD(X) = textmedian |X-textmedian(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<1)_text0 is the median=arctan(1)/pi-arctan(-1)/pi=frac12$$







    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.5k897368




    59.5k897368







    • 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 $overlinex^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 = frac1n(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=frac1n-1left [ sum_i=1^nx_i^2-frac1nleft ( sum_i=1^nx_i right ) ^2right ] $$





    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 $overlinex^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 = frac1n(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=frac1n-1left [ sum_i=1^nx_i^2-frac1nleft ( sum_i=1^nx_i right ) ^2right ] $$





      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 $overlinex^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 = frac1n(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=frac1n-1left [ sum_i=1^nx_i^2-frac1nleft ( sum_i=1^nx_i right ) ^2right ] $$





        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 $overlinex^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 = frac1n(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=frac1n-1left [ sum_i=1^nx_i^2-frac1nleft ( sum_i=1^nx_i right ) ^2right ] $$






        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,85952355




        3,85952355



























            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

            Lowndes Grove History Architecture References Navigation menu32°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661132°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661178002500"National Register Information System"Historic houses of South Carolina"Lowndes Grove""+32° 48' 6.00", −79° 57' 58.00""Lowndes Grove, Charleston County (260 St. Margaret St., Charleston)""Lowndes Grove"The Charleston ExpositionIt Happened in South Carolina"Lowndes Grove (House), Saint Margaret Street & Sixth Avenue, Charleston, Charleston County, SC(Photographs)"Plantations of the Carolina Low Countrye

            random experiment with two different functions on unit interval Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Random variable and probability space notionsRandom Walk with EdgesFinding functions where the increase over a random interval is Poisson distributedNumber of days until dayCan an observed event in fact be of zero probability?Unit random processmodels of coins and uniform distributionHow to get the number of successes given $n$ trials , probability $P$ and a random variable $X$Absorbing Markov chain in a computer. Is “almost every” turned into always convergence in computer executions?Stopped random walk is not uniformly integrable

            How should I support this large drywall patch? Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How do I cover large gaps in drywall?How do I keep drywall around a patch from crumbling?Can I glue a second layer of drywall?How to patch long strip on drywall?Large drywall patch: how to avoid bulging seams?Drywall Mesh Patch vs. Bulge? To remove or not to remove?How to fix this drywall job?Prep drywall before backsplashWhat's the best way to fix this horrible drywall patch job?Drywall patching using 3M Patch Plus Primer