![]() |
Help on OPR and DPR
Hi, I'm working on my teams scouting system right now and was wondering if anyone could explain how to calculate OPR and DPR. I realize these might not be the best methods for this years competition, but I want to make sure I have all the bases covered. Since this is our rookie year, no one really has any idea what we're doing here, which is why I'm asking.
|
Re: Help on OPR and DPR
|
Re: Help on OPR and DPR
BMartin, I read through that paper, and I got as far as 2i+j+k+l+m+n=p+q=B and putting that into a matrix with every team, and then was totally lost on Cholesky Decomposition. Is there anyone who can explain the decomposition algorithms to me? I've looked it up, and it's not really anything I've done before. Btw, if it helps, I'm currently in a pre-calc class, and I understand the material as far in as trig, which is what we've been doing the last month or so. Any kind of true calculus will probably be lost on me right now.
|
Re: Help on OPR and DPR
Quote:
For each team TotalScoreteam = sum over all teams( number of times played with team i * OPR of team i) So if you had team 1, who played 1 time each with teams 2, 3, 5, and 8 and had a sum of all their scores of 100, then you'd arrange it like: 100 = 4*OPR1 + 1*OPR2 + 1*OPR3 + 1*OPR5 + 1*OPR8 Let's say team 2 played twice with team 13 and once with team 21 in addition to their game with team 1. Their total score was 80. So your second equation is: 80 = 1*OPR1 + 4*OPR2 + 2*OPR13 + 1*OPR21 Notice that in both these equations, you have 4*OPRwhateverTeam. This is because a team plays with themselves once for each game they play. Once you've got equations worked out for every single team (if you were doing this by hand, anyway), you'd realize that you have n equations (one for each team) with n unknowns (one OPRi for each team). This means that you can construct a matrix. With my examples above, the first 2 lines of the matrix would look like Code:
[100 | 4 1 1 1 0 0]If you get confused, think back to how you build that first equation, and then think of the meaning of that equation: "a team's total score for the whole regional is the sum of the OPRs of its partners, weighted by how many times they played together". For DPR, which I think might work well this year, it would be "The amount of points scored on a team is the sum of the DPRs of its partners, weighted by how many times they played together". Since a slow or poorly-driven robot will tend to get points scored on it, this should have some meaning this year. Most years DPR doesn't matter because what a robot does typically doesn't massively affect how many points its opponents score. |
Re: Help on OPR and DPR
Thanks for the quick reply. I think I get it, but I'll have to play around with it a little bit. I'm actually hoping I can have a system by Saturday, since we've got a local scrimmage going on and I'd like to train scouts there. Also, I'll see if I can track down that code from last year. That might help even more. Thanks again.
|
Re: Help on OPR and DPR
So will it work if, when I go to solve for [A]{x}={B} I change it to {x}={B}/[A]^-1?
|
Re: Help on OPR and DPR
Perhaps I should ask a different question...
Ok, so if I take, for example, the TBA data from 2008's Suffield Shakedown and create matrix A based on the number of matches each team played on an alliance with each other team and matrix B is the total combined score of each of the alliances team x played on. I then took the inverse of A and found BA^-1. So would this, then, be correct? Code:
Team # OPR |
Re: Help on OPR and DPR
Quote:
Matrix A: you've got this: the (i,j)th element is how many times team i played with team j Vector S: This is a vector where the jth element is a sum all of team j's scores. Vector OPR: This, once solved for, is the OPR for each team. The i'th element is the OPR of team i. So you've just got to solve: A*OPR = S Which would result in: OPR = A-1S So yeah, I think your math is correct so long as by "matrix B" you meant "vector B". |
Re: Help on OPR and DPR
If what you're calling a vector is what I'm considering to be just an nx1 column matrix where each line in this case is just a total score, then yes, I think "Matrix B" is "Vector B," though a confirmation would be appreciated. If that is the case, then I'd just like to say, WHOO!!! Because if I'm understanding you, then the worst part of setting this up should be over!
EDIT: I just looked up vectors, in which case, I've got it figured out. Thanks for checking my work over Bongle, as well as helping me get my terms straight. Now all I have to do is implement a system for it, which aught to be cake after all of this. Thanks again Bongle for helping me get things straight, and Martin for getting me going in the first place. I'll see you guys in Atlanta :P |
Re: Help on OPR and DPR
Quote:
|
Re: Help on OPR and DPR
Quote:
Anyway, I'll try and have a beta version of my system up by the end of the week for people to look at. That way I can maybe get some advice on how to tweak it. |
Re: Help on OPR and DPR
Somewhat resurrecting a dead thread but.... Does the matrix on that sheet even work with Cholesky Decomposition? I entered it into Mathematica and an online calculator and both returned errors (possibly because of those zeroes in there...). If the reason is because of the zeroes, won't that not work because you're not going to be playing with every team and there will be some zeroes in the chart (then again, since I don't exactly understand how the decomposition works, I could easily be very wrong).
Also, for those using inverse matrices, what happens when the matrix does not have an inverse :confused: ? Don't think it'll happen, but, it's a possibility (btw the example on the posted sheet also does not have an inverse). Even better... If we're keeping track of relatively detailed robot performance anyways, does it even matter? |
Re: Help on OPR and DPR
1 Attachment(s)
Quote:
I have been posting 2009 FRC results with OPR and CCWM at the link below. http://www.chiefdelphi.com/media/papers/2174 Starting from week 3, you can use it during each regional and just press one button to get updated OPR and CCWM information for that regional provided you have internet access. The source code to calculate OPR and CCWM is in there also. I don't invert matrix since it is not necessary. I use Cholesky Decomposition which is included with the source code. If you have any questions, please let me know. Ed |
Re: Help on OPR and DPR
Quote:
Because of the way our matrices are assembled, as long as every team has played at least one match, the matrix is invertable. That is because the diagonal terms are the number of matches that team played, which is why OPR can not be calculated until you have some matches done. Otherwise you will have some zeroes at the diagonal terms and it will make your matrix become singular and can not be inverted. Ed |
Re: Help on OPR and DPR
Ed, I don't have access to a computer with Excel at the moment, so I figure I might ask if you're referring to the 2009 or the 2008 Suffield Shakedown. I ran those numbers with the data on TBA for the 2008 Shakedown.
Oh, also, a note on how I'm running my calculations. In Excel, I created the matrix of the matches played with each team, took the inverse of it, and multiplied it by the total score vector as was my understanding and as Excel allowed. I have the file here on my thumb drive, so I've uploaded the spreadsheet here.It should be on a sheet named Match Matrix, I believe, though I don't know if the test matrix is in there. There should be vectors in there as well to enter the scores for OPR, the margins, and it should spit out WM and OPR next to them. I think I just used letters to label them, and can't remember using anything really obscure, so they should be easy to identify. If my test matrix isn't there, there will be an empty matrix for match data, and then it'll spit out its inverse next to it or below it. I've done both, and can't be sure which... If I've done something wrong, it'd most likely be in the math there, I'd think. |
Re: Help on OPR and DPR
Quote:
The data I used was from whatever link to TBA you had in your post so I think it is 2008. I would be glad to take a look at your spreadsheet and see what possibly could be wrong. I can output the matrix and vector from my program and compare to yours. It is getting very late here in Michigan and I need to get up in about 5 hours. I will look at it tomorrow. By the way, I saw that you downloaded my spreadsheet. The program is fixed now so the corrected week two data is available for you to download. Sorry for the inconvenience. Ed Law |
Re: Help on OPR and DPR
Quote:
|
Re: Help on OPR and DPR
1 Attachment(s)
Lol, yeah, I had that same problem. That's why I had to create a matrix from TBA data. Didn't stop me from running his example 8 different ways though.
Also, tracked down my test matrix for the Shakedown. I've attached it below if you'd like to take a look at what actually generated that data. Attachment 7645 |
Re: Help on OPR and DPR
1 Attachment(s)
Quote:
I looked at your spreadsheet Suffield Shakedown Test.xls. I think you assembled your matrix A incorrectly. For example, the diagonal terms represents the number of matches each team played. They should all be 4. Team 126 and Team 181 did not play 9 matches. Also Team 40 never played with Team 173 so that term should be 0 but you have a 2 there. You must have entered the numbers wrong by hand. I am attaching the matrix A and vector B. You can try it out and see if you get the same OPR number. I also looked at your spreadsheet Scout_System_beta_v.5.xls. Even though I am already posting a similar one for everyone to us, I would strongly encourage you to continue to develop yours and customize it for your team. You will learn a lot from doing it. If you need any help or have any questions, just let me know and I will do my best to help. Regards, Ed Law |
Re: Help on OPR and DPR
Thanks Ed. So my question now is, should I have only based this matrix on the qualifying rounds? If so, I think that may have been my mistake....
|
Re: Help on OPR and DPR
Quote:
Ed |
Re: Help on OPR and DPR
Yeah, that's what I was starting to think. Well, this at least explains why my numbers weren't right. Thanks Ed. I'll run it again tomorrow and compare what I get with your data. Right now, though, I should probably go to sleep. Thanks again for your help
|
Re: Help on OPR and DPR
Well, I just tested the numbers again, and they seem to match up with what you have Ed. There is only a very, very slight difference in a number of them, but it is incredibly minuscule (in the ballpark of 10^-14), so it shouldn't affect the numbers in any significant way. I've also figured out how to have excel rank everything, so I'll update the search on my system to include ranks as well as stats, and I'll make a few minor tweaks as well and should have it up here by Sunday.
Did I mention I have nothing better to do right now than to calculate these minuscule differences and make tweaks to the system while I watch recorded tv in the middle of the night? |
Re: Help on OPR and DPR
Ok, so to clarify one thing before I actually finalize this, low DPR is good, right? Since it's how many points a robot can be expected to contribute to the other team, I'm pretty sure that a low positive is good, a negative better, right? This should be the last question I have, since going through it the only other things I'm not entirely sure how to do I can look up on excel tutorials.
|
Re: Help on OPR and DPR
Quote:
And for my question: What is the mathematical formula for CCWM? |
Re: Help on OPR and DPR
The way I've been doing it, which seems to work, isn't incredibly complicated. It's based off the equation [A]^-1[b]=[C]
[A] is the number of matches each team played with each other team. So make each column and row each team number in numerical order. At all of the intersections put the number of matches played by team x with team y. Any spot x,x will be their total number of matches. [b] is the winning margin margin for each team in a collumn. I believe, and someone correct me if I'm wrong, that you take the average winning margin for this. I'm not sure on that off the top of my head though. Take the inverse of matrix [A], multiply it by [b], and you should get a collumn with the CCWM of each team. |
| All times are GMT -5. The time now is 02:45. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi