0
$\begingroup$

I know things about linear/quadratic fittings etc. I'm just wondering, if i know a set of data for value e.g. z=[-2.563 -0.1932 -0.1502 -0.1102 -0.836 -0.5234] and l=[1 2 3 4 5 6] m=[6 5 4 3 2 1] I want to write out a function of z in terms of l and m. How would i be able to start this? Many thanks in advance!

  • 0
    PooyaM made it; see above.2012-09-12

1 Answers 1

0

The values of $(l,m)$ all lie on one line, so this isn't actually a two-dimensional problem; you can just do a one-dimensional fit with respect to either $l$ or $m$. Then if you want to evaluate the function at an arbitrary point $(l,m)$, just project it onto the line $l+m=7$ and evaluate the fitted function there.

[Edit in response to comment:]

You only have function values on a single line. The best you can do if you want to approximate a function value off the line is to take the function value at the closest point on the line, which is the orthogonal projection of the point onto the line. The orthogonal projection of the point $(l,m)$ onto the line $l+m=7$ is $((7+l-m)/2,(7+m-l)/2)$, so you get the approximation by evaluating a function fitted with respect to $l$ at $(7+l-m)/2$ or evaluating a function fitted with respect to $m$ at $(7+m-l)/2$.

  • 0
    @chenwan: It's not clear to me what you mean when you say on the one hand that "these two $z$ are totally different" and on the other hand that you "need to combine those to find a suitable function for $z$ in terms of $x,y$". Are you saying that you want a single function $z(x,y)$ that interpolates *all* these function values, both the ones for $x=[1 2 3]$, $y=[3 2 1]$ and the ones for $x=[1 2 3 4]$, $y=[4 3 2 1]$? If so, why didn't you say that in the original question? In that case, you should fix the question to reflect what you actually intended to ask about.2012-09-12