0
我想计算运行时进入系统的每个值的标准偏差。计算在线标准偏差
我不知道如何实现它。
我实现了网上平均
def online_avg(last_avg, last_N, new_val):
return ((last_avg*last_N)+new_val)/(last_N+1)
我想网上的标准偏差的原型是因为:
def online_std(last_avg, last_N, last_std, new_val):
pass
http://stackoverflow.com/questions/1174984/how-to-efficiently-calculate-a-running-standard-deviation (已经解决,不同的方式),http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Online_algorithm(所有关于方差,包括这样的算法) – user2246674
谢谢@unutbu - 答案中引用的文章很好解释。 – Bush