he assumption is that the [Tex]z-[/Tex]component of the data is functionally dependent on the [Tex]x-[/Tex] and [Tex]y-[/Tex]components.
Given a set of samples [Tex]{(x_{i}, y_{i}, z_{i})}_{i=1}^{m} [/Tex], determine A, B, and C so that the plane [Tex] z= Ax+By+C [/Tex] best fits
the samples in the sense that the sum of the squared errors between the zi and the plane values [Tex] Ax+By+C [/Tex] is minimized.
Note that the error is measured only in the z-direction.
Define [Tex]E(A,B,C) = \sum_{i=1}^{m}[(Ax_{i} + By_{i} + C) − z_{i}]^{2}[/Tex]. This function is nonnegative and its graph is a hyper-paraboloid whose vertex occurs when the gradient satistfies ∇E = (0, 0, 0). This leads to a system of three linear equations in A, B, and C which can be easily solved. Precisely,
[TEX](0,0,0)=\nabla E=2\sum_{i=1}^{m}[(Ax_{i}+By_{i}+C_{i})-z_{i}](x_{i},y_{i},1)[/TEX]
The solution provides the least squares solution [Tex] Z=Ax+By+C [/Tex]
Posted by chungki