At Tue, 20 Nov 2007 12:53:31 +1100,
John Pye wrote:
> I have a question about the use of the gsl_multifit_linear routine that
> perhaps is a question more about geometry/algebra than coding, but I'm
> not sure.
> 
> I want to construct a routine that fits a plane (in three dimensions)
> through a set of data points (x,y,z). I have set up gsl_multifit_linear
> to fit the plane equation a*x + b*y + c*z = 1to my data, and for most
> cases that seems to work OK. However there are a few degenerate cases
> that don't work, and I'm trying to work out what I should do. Is there a
> better equation that describes a plane?

Hello,

In the general case of this problem you need orthogonal regression
(which is not something GSL has at the moment) -- i.e. minimisation of
the orthogonal distance to the plane.  It's more complicated than
linear regression.

Linear regression only works if the model is written with a dependent
variable, i.e. z = a*x + b*y + c, or similar.  This minimises the
residual in the chosen direction -- if that's acceptable then you can
use linear regression.

-- 
Brian Gough

Network Theory Ltd,
Publishing Free Software Manuals --- http://www.network-theory.co.uk/


_______________________________________________
Help-gsl mailing list
Help-gsl@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gsl

Reply via email to