MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: LS fit to a plane

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16838] Re: [mg16828] LS fit to a plane
  • From: Maarten.vanderBurgt at icos.be
  • Date: Thu, 1 Apr 1999 21:35:17 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Virgil,



Have a look at the following:



In[1]:= z[x_,y_]:= 3x+5y-9;


In[2]:= xyzdata =
Flatten[Table[{u,v,z[u,v]+Random[]},{u,-1,+1},{v,-1,1}],1]


Out[2]=
{{-1,-1,-16.9183},{-1,0,-11.6465},{-1,1,-6.13617},{0,-1,-13.8047},{0,

0,-8.3627},{0,1,-3.00167},{1,-1,-10.0657},{1,0,-5.43228},{1,1,-0.174832}}


In[3]:= Fit[xyzdata,{1,x,y},{x,y}]


Out[3]= -8.39366+3.17135 x+5.24602 y



The equation of the plane is z = 3 x + 5 y - 9.

In xyzdata I add some random noise to nine points in this plane.

Then I fit the leas mean square plane using the Fit[] command.

If you want more regression data have look in the package
Statistics`LinearRegression`.



regards

Maarten



___________________________________________________________________________
____

Maarten van der Burgt

R&D Department



ICOS Vision Systems
Esperantolaan 9
B-3001 Leuven
Belgium
tel.    + 32 16 398220       direct  + 32 16 398316     fax.    + 32 16
400067
e-mail: maarten.vanderburgt at icos.be

___________________________________________________________________________
____








Virgil Stokes <virgil.stokes at neuro.ki.se> on 30-03-99 08:35:25 AM


Subject: [mg16838]  [mg16828] LS fit to a plane




I would like to fit a set of 3D coordinates (each with measurement error)
to a plane; i.e.

find the parameters A,B,C,D in

   Ax + By + Cz + D = 0

for a set of (x,y,z) measurements.

-- V. Stokes









  • Next by Date: Re: LS fit to a plane
  • Next by thread: Re: LS fit to a plane