1
$\begingroup$

I have standard deviation for each 15 min of that hour so can i calculate the standard deviation of that hour using this 4 standard deviation values ?

Reason

Standard deviation of each 15 min is calculated by storing the per second reading coming from sensors and after the completion of the 15 min i calculate the SD of that 15 min slot and to calculate the whole hour SD i can not hold that per second reading that's why i need a way to calculate the SD using the each 15 min SD and same to calculate the SD of Day using the each hour SD

Edit last hour each 15 min SD

  1. 0.873
  2. 0.864
  3. 0.864
  4. 0.863
$\endgroup$
4
  • $\begingroup$ if those are different, then yes. Can you explain the reason for doing this? $\endgroup$
    – Angel
    Commented Nov 21, 2018 at 6:37
  • $\begingroup$ i have edited the question please check. $\endgroup$ Commented Nov 21, 2018 at 6:44
  • $\begingroup$ if you are interested in per hour dispersion then using each and every reading(per second) is a better idea. $\endgroup$
    – Angel
    Commented Nov 21, 2018 at 6:47
  • $\begingroup$ yes but i can not do that due to memory constraints $\endgroup$ Commented Nov 21, 2018 at 6:49

1 Answer 1

1
$\begingroup$

This data is not enough to compute the standard deviation of the hour. Consider two examples:

First example: your sensor shows constant zero. The standard deviation of each 15 minutes is zero, and the standard deviation of the hour is also zero.

Second example:

from 00:00 to 00:15 your sensor shows 0, from 00:15 to 00:30 it shows 1, from 00:30 to 00:45 it shows 2, and from 00:45 to 01:00 it shows 3. The standard deviation of each 15 minute interval is still zero, but the standard deviation of the hour is not.

Here is how you can compute the standard deviation of a sample using only a few memory slots.

The formula for sample standard deviation s for a sample of size n is: $$ s = \sqrt{\frac{n}{n-1}Var(X)} = \sqrt{\frac{n}{n-1}(\mathbb E(X^2) - (\mathbb EX)^2)} $$

So, all you need to store to compute the standard deviation of a sample is the sum of readings and their sum of squares. (The sample size for a per second reading is known in advance).

$\endgroup$
5
  • $\begingroup$ but the thing is i can not know the n value in advance thats why i am calculating running Standard deviation using this link [dev.to/nestedsoftware/… $\endgroup$ Commented Nov 21, 2018 at 9:09
  • $\begingroup$ okay i got it so you are saying that i should hold the sum of reading ,sum of reading squares and count of that hour reading and put those in this formula and it will give me the SD of that hour am i right $\endgroup$ Commented Nov 21, 2018 at 9:17
  • $\begingroup$ If the readings happen once per second, then during an hour there will be 60 * 60 = 360 readings. Or you can count them just to be sure, yes. $\endgroup$
    – seed
    Commented Nov 24, 2018 at 16:17
  • $\begingroup$ Thanks and yes i have already maintain the count of readings, I will accept your answer once i verify the output $\endgroup$ Commented Nov 27, 2018 at 3:54
  • $\begingroup$ If you in addition knows the means for the same time periods you know the sd, see stats.stackexchange.com/questions/332951/… or stats.stackexchange.com/questions/340576/… or stats.stackexchange.com/questions/326464/… $\endgroup$ Commented Mar 17, 2020 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.