I am trying to find an equation $f(x,y) \rightarrow z$ that can be used to return the values in this table, where we'll say the horizontal heading is the $x$ values and the vertical $y$.
My thinking was to try polynomial fitting, for which I used the 'Solver' add-in in Excel. I started with $f(x, y) = ax^2 + by^2 + cxy + dx + ey + f$, and the solver tried to optimise the coefficients to make the values as close to the table as possible.
However, it wasn't close enough so I kept increasing the order of the equation, eventually trying $f(x, y) = ax^6 + ... + n$. But I'm still not happy with the accuracy of the equation, given how long it has become.
Are there any better solutions to perform this sort of task? I am not a proficient coder/computational mathematician but from reading up on this it seems using an optimisation programme is the only solution.
This is the results of my attempt:
UPDATE:
I have added more terms to the polynomial now, and am getting good results. However, the equation is a bit longer than I would hope (see the comment below).
My new question is therefore, what is the best way to find a reasonable solution with as few terms as possible, without trial and error?


