Quote:
Originally Posted by davidaustin
OK, thanks for helping me to understand this. I apologize for reporting those earlier results, which I have removed from this thread.
Here's what I am doing: N is the number of teams, and M is the number of matches.
--Form the 2MxN matrix A whose entries are zero except where A[2m+c][j] = 1 if team j played on the c (=0 for red and 1 for blue) alliance in match m.
--Form the 2M-dimensional vector S where S[2m+c] is the score of the c alliance in match m.
--We want to solve the overdetermined system Ax = S so we multiply by A^T to get
A^T A x = A^T S
--Write A^T A as L L^T using the Cholesky factorization so that we have
L L^T x = A^T S.
--We solve L y = A^T S and then L^T x = y to find x, which holds the OPRs.
Does this look correct? I'm not seeing the error in my code. Thanks again!
|
What you posted above looks correct, but the devil is in the details.
Post your A matrix and your S vector here and let me crunch the OPR. If I get the same result you did, then the problem lies in your processing of the raw data into A and S. If I get different result, the problem lies in your Cholesky processing.
By the way, if you are using Python, you can get the min L2 norm of residuals (least squares) solution directly from your A and S using np.linalg.lstsq(A,S), without forming and factoring the normal matrix A'A.