Data Science and Computing with Python for Pilots and Flight Test Engineers
Circular Error Probable (CEP) and Circular Error Average (CEA)
Theory
In this lesson we compute the circular error probable (CEP) about mean impact point (MIP) and also the CEP about target (with the target assumed to be at the origin of the coordinate system). Finally, we also compute the circular error average (CEA), which is generally considered to be a statistically inferior quantity.
Circular Error Probable (CEP)
CEP about MIP
First compute the two coordinates of the MIP as the mean of the two coordinates of the data (each coordinate individually). Then compute the standard deviations \(s_x\) and \(s_y\) of the data around this MIP (again each coordinate separately).
Finally make the following approximation to compute the CEP (this is what NTPS uses):
If (\(s_x<s_y\)) and (\(s_x/s_y<0.5\)):
$$ CEP = 0.617 s_x + 0.562 s_y $$
Else if (\(s_x>s_y\)) and (\(s_y/s_x<0.5\)):
$$ CEP = 0.562 s_x + 0.617 s_y $$
Else:
$$ CEP = 0.5887 (s_x+s_y) $$
CEP about Target
For the CEP about the target (assumed to lie at \(x=y=0\)) instead of the CEP about the MIP, compute the sample standard deviations \(s_x\) and \(s_y\) with mean = 0 instead of the actual mean of the data.
Circular Error Average (CEA)
For the CEA, compute the distance of every data point from the target (assumed to be at \(x=y=0\)) and then average over the distances.
Code
The class CEP below implements all of the above in Python.
class CEP:
def get_CEP_from_stddevs(self, sx, sy):
""" These approximations are used at NTPS (see Statistics, Part 7 (CEP), Side 6).
sx and sy are the sample standard deviations (with n-1 in denominator) of the
data in x-direction (x coordinate) and y-direction (y coordinate). """
if ((sx<sy) & (sx/sy<0.5)):
cep = 0.617*sx + 0.562*sy
elif ((sx>sy) & (sy/sx<0.5)):
cep = 0.617*sy + 0.562*sx
print("Doing this.")
else:
cep = 0.5887*(sx+sy)
return cep
# Computing CEP about MIP:
def get_MIP(self, xdata, ydata):
""" Computes MIP. """
ds = DataStatistics()
xbar = ds.mean(xdata)
ybar = ds.mean(ydata)
return xbar, ybar
def get_standard_deviations(self, xdata, ydata):
ds = DataStatistics()
sx = ds.standard_deviation(xdata)
sy = ds.standard_deviation(ydata)
return sx, sy
def compute_CEP_and_MIP(self, xdata, ydata):
mip = self.get_MIP(xdata, ydata)
sx, sy = self.get_standard_deviations(xdata, ydata)
cep = self.get_CEP_from_stddevs(sx, sy)
return cep, mip, sx, sy
# Computing CEP about Target (omitting MIP in computation of standard deviations):
def get_standard_deviations_around_target(self, xdata, ydata):
""" Target is assumed to be at coordinates (0,0),
i.e. the xdata and ydata must be provided in a coordintate system
that has the target as the origin. """
ds = DataStatistics()
sx = ds.standard_deviation(xdata, mean=0.0)
sy = ds.standard_deviation(ydata, mean=0.0)
return sx, sy
def compute_CEP_about_target(self, xdata, ydata):
sx, sy = self.get_standard_deviations_around_target(xdata, ydata)
cep = self.get_CEP_from_stddevs(sx, sy)
return cep, sx, sy
# Circular Error Average (CEA) about the target:
def compute_CEA(self, xdata, ydata):
cea = 0
for i in range(0, len(xdata)):
distance_error = np.sqrt(xdata[i]**2+ydata[i]**2)
cea = cea + distance_error
cea = cea / len(xdata)
return cea