Least Squares Solution of Linear Algerbraic Equation Ax = By in Eigen C++
问题 I have a set of linear algebraic equations in matrices form, Ax=By . Where A is matrix of 36x20 and x is a vector of size 20 , B is 36x13 and y is 13x1 . Rank(A)=20 . Because system is overdetermined (there are more number of equations than the variables), so least squares solution is possible, i,e; x = (A^TA)^-1A^TBy . I want the solution so that the residual error e = Ax-By should be minimized. Using Eigen/Dense library of C++ i have formulated all the matrices etc. I tried the method