View Single Post
  #1   Spotlight this post!  
Unread 16-05-2014, 13:19
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,124
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: [FTC]: Championship OPR?

Quote:
Originally Posted by davidaustin View Post
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.


Reply With Quote