Least squares regression to solve a rectangular system?

Does ROOT facilitate least-squares regression computations? That is, I have a rectangular matrix of 3 equations in 2 unknowns:

Sqrt[(x-x1)^2 + (y-y1)^2] + s(t2-t1) = Sqrt[(x-x2)^2 + (y-y2)^2]
Sqrt[(x-x2)^2 + (y-y2)^2] + s(t3-t2) = Sqrt[(x-x3)^2 + (y-y3)^2]
Sqrt[(x-x3)^2 + (y-y3)^2] + s(t3-t1) = Sqrt[(x-x1)^2 + (y-y1)^2]

I want to solve for ‘x’ and ‘y’. Unfortunately, I’m not too familiar with least-squares theory, however I recall reading once that ROOT has the capacity to do some things with least-squares (I can’t seem to find anything on this, however). Is there something in ROOT which I can use to solve this?


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


You can check this tutorial https://root.cern.ch/doc/master/fitLinearRobust_8C.html
Otherwise, maybe @couet can comment more? Thanks!

Yes this example should help. @moneta may also have some ideas.

Hi,
I guess you want to find the roots (solve for x and y) given a set of equations.
This is a multi-roots solving problem, you would need to use the ROOT::Math::GSLMultiRootFinder class,

and this is an example using it

Note that this class is part of libMathMore and you need to build ROOT with GSL support.
You can check for this by doing from the command line
root-config --has-mathmore

Lorenzo

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.