Multidimensional Linear Fit

37 Views Asked by At

As shown in the attached picture, I have different measurement points which belong to certain linear functions with different slopes $m$ and different $y$-intercepts $n$. For every curve I have a fixed $m$ and $n$. Via MatLab, I want to find $m(x,y)$ and $n(x,y)$, what means finding the slopes $m$ and $y$-intercepts $n$ for the curves lying in between. What is the best way to find $m(x,y)$ and $n(x,y)$? I just found a multivariate normal regression (enter link description here), which is not suitable for the problem.

1

There are 1 best solutions below

0
On

What it seems to me is that you have a set of $n$ data points $(x_i,y_i,z_i)$ such that for a given $x$, $z$ is linear with respect to $y$ and that for a given $y$, $z$ is linear with respect to $x$.

Then, a multilinear model such that $$z=a+ b\, x+c\, y+d\, x\,y$$ could fit the requirement.

Defining $t_i=x_i\,y_i$ leads to $$z=a+b\,x+c\,y+d\,t$$ quite simple to fit.

Consider that $x$ is fixed at a value $x_*$; then $$z=a+ b\, x_*+c\, y+d\, x_*\,y=(a+ b\, x_*)+(c+d\,x_*)\,y$$ and if $y$ is fixed at a value $y_*$ then $$z=a+ b\, x+c\, y_*+d\, x\,y_*=(a+c\,y_*)+(b+d\,y_*)x$$