This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RawData['Type'] = 0 | |
for i in range(len(RawData['χ2'])): | |
if RawData['χ2'][i] > x2q: RawData['Type'][i] = 'Noise' | |
else: RawData['Type'][i] = 'Data' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
σ = 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
μ = RawData['Customers'].median() | |
n = len(RawData['Customers']) | |
MeasurementAccuracy = [] | |
for i in range(n): | |
MAtemp = (RawData['Customers'][i] / μ) | |
MeasurementAccuracy.append(MAtemp) | |
RawData['MeasurementAccuracy'] = MeasurementAccuracy |