mirror of
https://github.com/TREX-CoE/qmc-lttc.git
synced 2024-10-04 07:16:18 +02:00
8 lines
207 B
Python
8 lines
207 B
Python
from math import sqrt
|
|
def ave_error(arr):
|
|
M = len(arr)
|
|
assert (M>1)
|
|
average = sum(arr)/M
|
|
variance = 1./(M-1) * sum( [ (x - average)**2 for x in arr ] )
|
|
return (average, sqrt(variance/M))
|