As hobbyists, it can be real hard to mathematically understand engines, because we do not have the training in math and engine theory to really model these things mathematically.

It is still unclear to me what z represents. Air flow (mass air reading)? O2 sensor reading? something else? obviously you are trying to optimize the A/F ratio, but I'm still not clear on how this is part of calculating A/F ratio.

One observation: Above about 7-10% throttle, the "known good" values and the complete curves kind of cluster together. If we are going to do this "empirically" I might be tempted to fit the data above 10% to one equation and the data below 10% to another equation.

Looking at it differently, if I plot z against throttle position, it looks like engine speed may not even be important in determining z -- perhaps fit the entire data set as z=f(TP) and ignore engine speed.