S M Niaz Arifin | 20 Aug 09:13
Picon
Favicon

Re gression with Intersection Constraint


Hi,
Previously I posted a thread asking help on how to best-fit (in the least
squares sense) a straight line through a set of data points. Thanks a lot to
all replying to it. I managed it in Matlab using a function 'fit_3D_data'
(link: 
http://webscripts.softpedia.com/script/Scientific-Engineering-Ruby/Statistics-and-Probability/Orthogonal-Linear-Regression-in-3D-space-35532.html).

But to add a 'simple' constraint to the problem, I am stuck. Here it is:

I have two sets of data points, representing two separate straight lines
(call A and R) that intersect at a point. I need to find the least-square
fit to these lines, subject to their intersection constraint. So, the
important part is that the two best-fit lines must intersect at the 'best'
intersection point as determined by the data points.
Is there any way to do this in R (I am also trying in Matlab, but yet to get
any solution)?

Here is what it looks like in Matlab:

load pointsA.txt
xdataA = pointsA(:,1);
ydataA = pointsA(:,2);
zdataA = pointsA(:,3);

load pointsR.txt
xdataR = pointsR(:,1);
ydataR = pointsR(:,2);
zdataR = pointsR(:,3);

(Continue reading)


Gmane