Skip to content

Instantly share code, notes, and snippets.

@devicemxl
Created October 15, 2022 03:08
Show Gist options
  • Save devicemxl/04b5658416bb642487ed9522c11eeb9c to your computer and use it in GitHub Desktop.
Save devicemxl/04b5658416bb642487ed9522c11eeb9c to your computer and use it in GitHub Desktop.
σ = variance(RawData['MeasurementAccuracy'])# the population variance σ²
x2 = []
for i in range(n):
if i>0:
σS = variance([RawData['MeasurementAccuracy'][i],RawData['MeasurementAccuracy'][i-1]])# Because the sample is this and the past data
x2t = ( (n-1) * σS ) / σ
x2.append(x2t)
else: x2.append(0)
RawData['x2'] = x2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment