[Math] Finding a surface fitting equation for this set of data

statisticssurfaces

I have a question regarding surface fitting (3D curve fitting), and since I am not from a maths/stats background I was wondering if someone can help me or point me to the right resources?

I had collected some data that has two variables, $f(x,y)$. Initially I wanted to fit a polynomial equation since some of my friends says that is the easiest to compute. But the expanded equation scares me. Especially to the polynomial order of 5.
$$ f(x,y) = \sum_{m=k=0}^5p_{mk}x^my^k $$

From looking at my 3D plots, it has a sort of feel to this equation
$f(x,y) = e^{-x} + e^{-y}$ but I am not sure how to fit my graph into that equation.

Here is a 'sample' of my data, and I do apologise if it looks messy. Hopefully you can copy and paste these…

$z(x,y)=$
\begin{array}{cccccccccc}
0.00516 & 0.00414 & 0.00371 & 0.00325 & 0.00305 & 0.00284 & 0.00275 & 0.00265 & 0.00261 & 0.00256\\
0.00280 & 0.00173 & 0.00132 & 0.00084 & 0.00066 & 0.00043 & 0.00035 & 0.00024 & 0.00020 & 0.00015\\
0.00274 & 0.00167 & 0.00126 & 0.00077 & 0.00059 & 0.00028 & 0.00028 & 0.00018 & 0.00014 & 0.00009\\
0.00274 & 0.00167 & 0.00126 & 0.00077 & 0.00059 & 0.00028 & 0.00028 & 0.00017 & 0.00013 & 0.00008\\
0.00274 & 0.00167 & 0.00126 & 0.00077 & 0.00059 & 0.00028 & 0.00028 & 0.00017 & 0.00013 & 0.00008\\
0.00274 & 0.00167 & 0.00126 & 0.00077 & 0.00059 & 0.00028 & 0.00028 & 0.00017 & 0.00013 & 0.00008
\end{array}

The row $y\in[3,8]$ (top to bottom) and the column $x\in[11,20]$ (left to right)

I had truncated the real numbers to 5 decimals, however my actual result are up to 12 decimals. My question really is what is the best fitting for the above data. Or rather what can I do to fit the above surface?

If it helps, I am using MATLAB to compute my data.

Thanks for reading!

Best Answer

If the model is indeed $f(x, y) = c_1 e^{-x} + c_2 e^{-y}$, you can use a linear regression on $e^{-x}$ and $e^{-y}$. In MATLAB, you can use $\text{regress}(z, e^{-x}, e^{-y})$. You can then compute an $R^2$ value through corrcoef, using the actual and the predicted values as your two data sets, in order to determine the strength of the relationship.

Related Question