So this is really a programming problem, but I thought it best to ask here.
I'm trying to calculate the Standard Deviation for a massive list of numbers (I get a new number every second), but I'd rather not have to keep the list of numbers in memory + go through the entire list each time I acquire a new number.
I've figured out a way to do this for the mean:
newMean = (currentMean + newNumber/currentCount) / (1 + 1/currentCount)
Basically I only need to store two things: the average + the count of numbers. I don't have to worry about keeping the list of numbers, and can work off the new number alone.
Is there something similar I can do with the SD? It doesn't have to be 100% accurate, but could be a rough approximation.