I want to calculate the Standard Deviation for every value which comes to the system in run time.
I'm not sure how to implement it.
I implemented the online average
def online_avg(last_avg, last_N, new_val):
return ((last_avg*last_N)+new_val)/(last_N+1)
I want the prototype of the online standard deviation to be as:
def online_std(last_avg, last_N, last_std, new_val):
pass