![]() |
OPR
Does anyone have a an excel document or something where I can plug in match scores and figure out OPR or how I could put an OPR calculator in an Android App
|
Re: OPR
I will be posting a spreadsheet after Week 1 regarding advanced stats including OPR and a few other metrics.
I have done these spreadsheets the last few years and they can be found here: http://www.chiefdelphi.com/media/papers/3003 http://www.chiefdelphi.com/media/papers/2967 In addition, I have an app on the google play store called OPRFIRST2014 that was developed to focus specifically on OPR calculations for android. I released the entire source code for it because TheBlueAlliance began to include OPR calculations in their app and it was too hard to gain users with everyone using thebluealliance.com. So feel free to look through here and use the code to calculate OPR. (Although I may warn you, the code may be a little hard to read because I was just beginning android development and this was the first app I created). https://github.com/mray19027/OPRFIRST2014 The EXACT location of where my OPR calculations take place is here: https://github.com/mray19027/OPRFIRS...Info.java#L305 |
Re: OPR
Ed Law and his team has put together awesome resources for calculating OPR that can be found here.
Calculating OPR isn't actually that hard, although it requires some knowledge about basic linear algebra. Essentially, you are trying to solve a linear system of equations for a certain constant that is what you expect a team to contribute to an alliance each match (OPR). If you have teams a, b, and c playing together in one match, and they score a x amount of points, you are solving a(OPR) + b(OPR) + c(OPR) = x As more matches occur, the matrix equations become more complex. In the form of Ax = b, A is the matrix whose values correspond to the amount of matches teams played with each other, x is the OPR vector, and b is the vector of the total score each team made in all the matches they played. If you don't want to do the hard math/plug in your own match scores, you can use The Blue Alliance's API to get OPRs off their site. |
Re: OPR
Quote:
Each element of |b| corresponds to a team, and the value of that element is the sum of the alliance scores for all alliances that team played with. |
Re: OPR
Quote:
|
Re: OPR
Quote:
And if you just want to view the data, it is displayed in the TBA Android app, as well (looks like this, but more material. Sorry, old screenshot) |
Re: OPR
Quote:
Hit Code:
/api/v2/event/<event-key>/statsSpoiler for Lots of data:
|
Re: OPR
Quote:
To solve [M][x]=[s], that code uses numpy.linalg.solve which uses LAPACK routine gesv which does LU decomposition. Since [M] is symmetric positive definite, Cholesky decomposition can be used instead to take advantage of that particular matrix structure. For OPR computation for single events the difference will likely be negligible, but when computing combined OPR for all events for an entire season Cholesky will be noticeably faster than LU. |
Re: OPR
Quote:
|
Re: OPR
Quote:
|
Re: OPR
Quote:
|
Re: OPR
Quote:
Code:
x = np.linalg.cho_solve(np.linalg.cho_factor(M) , s) |
Re: OPR
1 Attachment(s)
Quote:
Attached is a sparse-format "M" matrix generated from this data containing 2,696 teams and 8,921 matches. Can someone with a Python installation please factor that matrix with LU1 and Cholesky2 and report the times? 1scipy.linalg.lu(M) 2scipy.linalg.cho_factor(M) |
Re: OPR
Quote:
Code:
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32 |
Re: OPR
Quote:
I think it's useful to understand how OPR works too, because often OPR alone often poorly models the game, or the game includes nonlinear (bins this year) or irrelevant (foul points last year) elements which get lumped into naive OPR equations anyways. You should understand what you're looking at before you take a list of teams ranked by OPR at face value. |
| All times are GMT -5. The time now is 11:10. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi