Bayesian RAPM

Home for all your discussion of basketball statistical analysis.
xkonk
Posts: 286
Joined: Fri Apr 15, 2011 12:37 am

Re: Bayesian RAPM

Post by xkonk » Fri Oct 12, 2018 12:32 am

My main ones have to do with how the prior is implemented. You said that it varies across seasons, like for Kobe. When you use MPG and team strength, is that from the prior season or the current season? E.g., for a stint from game 50 in 2016, is the MPG/team strength from 2015? From 2016 but only games 1-49? Some other time frame?

Also, are the priors weighted in any way? I imagine it must be because you said it has the least influence on high-minute players, but I'm curious how if it's a single number addition/subtraction.

DSMok1
Posts: 848
Joined: Thu Apr 14, 2011 11:18 pm
Location: Maine
Contact:

Re: Bayesian RAPM

Post by DSMok1 » Fri Oct 12, 2018 12:39 pm

xkonk wrote:
Fri Oct 12, 2018 12:32 am
My main ones have to do with how the prior is implemented. You said that it varies across seasons, like for Kobe. When you use MPG and team strength, is that from the prior season or the current season? E.g., for a stint from game 50 in 2016, is the MPG/team strength from 2015? From 2016 but only games 1-49? Some other time frame?

Also, are the priors weighted in any way? I imagine it must be because you said it has the least influence on high-minute players, but I'm curious how if it's a single number addition/subtraction.
I used the information from the full current season for the prior for each stint. This is all run as one huge regression.

I did not weight the priors--they were strictly subtracted out in the pre-processing. The greatest impact is obviously on lower minutes players, who in vanilla RAPM get pulled toward 0, but now are getting pulled toward their prior. Since very high minutes players are able to overcome the pull from the regression in vanilla RAPM, they similarly are not as affected by the prior.

Here are a couple of graphs showing the impact of the prior: https://public.tableau.com/views/Bayesi ... yesianRAPM
Developer of Box Plus/Minus
APBRmetrics Forum Administrator
GodismyJudgeOK.com/DStats/
Twitter.com/DSMok1

Crow
Posts: 5390
Joined: Thu Apr 14, 2011 11:10 pm

Re: Bayesian RAPM

Post by Crow » Fri Oct 12, 2018 9:18 pm

What end products are you focused on? A new BPM with an interactive variable? A new linear BPM? Based on the Bayesian RAPM I assume? Will the full & final Bayesian RAPM be shared? Would BRef post it and keep it up to date? Will you compare / correlate the end product with old BPM, vanilla RAPM, RPM, PIPM, etc.?

xkonk
Posts: 286
Joined: Fri Apr 15, 2011 12:37 am

Re: Bayesian RAPM

Post by xkonk » Fri Oct 12, 2018 10:59 pm

DSMok1 wrote:
Fri Oct 12, 2018 12:39 pm
I used the information from the full current season for the prior for each stint. This is all run as one huge regression.

I did not weight the priors--they were strictly subtracted out in the pre-processing. The greatest impact is obviously on lower minutes players, who in vanilla RAPM get pulled toward 0, but now are getting pulled toward their prior. Since very high minutes players are able to overcome the pull from the regression in vanilla RAPM, they similarly are not as affected by the prior.

Here are a couple of graphs showing the impact of the prior: https://public.tableau.com/views/Bayesi ... yesianRAPM
The idea strikes me as Bayesian at a conceptual level, and I trust it gives you better results than not doing it, but this isn't really a prior. Like the name says, your prior is supposed to be your incoming information before you collect/add data. Priors generally also have a range of possibilities, and then the data combines with the range to provide your final conclusion. Players that have been in the league a long time, or if you were using 50 games of data in a season as a prior for the next 20 games, would have relatively tight priors because you have a good sense of their quality. Low minute players, especially rookies, would have wider priors even if you thought they might be of the same general quality.

Like a rookie might have an expected value of 0 but could fall anywhere from -3 to 3 whereas a veteran bench player could also have an expected value of 0 but only range from -1 to 1. If both those guys then played the same stints at, say, 0.5, for some smallish period of time, you would be more likely to say the veteran is better because that play is pretty consistent with what we expected whereas the rookie could be good but could also still be bad.

So I'm kind of just fussing about the name, but you could have an actual Bayesian RAPM. All the choices you put into the prior alone could be a heck of a project and pretty interesting. I also would guess (as I kind of hinted with my example) that if you used an actual prior that age would become important again. I'm guessing it isn't a factor in your process because if you know how many minutes a guy is going to play, which you do because you use current season numbers, you already have a good sense of if he is suffering or benefiting from any age-related issues.

DSMok1
Posts: 848
Joined: Thu Apr 14, 2011 11:18 pm
Location: Maine
Contact:

Re: Bayesian RAPM

Post by DSMok1 » Sat Oct 13, 2018 11:19 am

xkonk wrote:
Fri Oct 12, 2018 10:59 pm
The idea strikes me as Bayesian at a conceptual level, and I trust it gives you better results than not doing it, but this isn't really a prior. Like the name says, your prior is supposed to be your incoming information before you collect/add data. Priors generally also have a range of possibilities, and then the data combines with the range to provide your final conclusion. Players that have been in the league a long time, or if you were using 50 games of data in a season as a prior for the next 20 games, would have relatively tight priors because you have a good sense of their quality. Low minute players, especially rookies, would have wider priors even if you thought they might be of the same general quality.

Like a rookie might have an expected value of 0 but could fall anywhere from -3 to 3 whereas a veteran bench player could also have an expected value of 0 but only range from -1 to 1. If both those guys then played the same stints at, say, 0.5, for some smallish period of time, you would be more likely to say the veteran is better because that play is pretty consistent with what we expected whereas the rookie could be good but could also still be bad.

So I'm kind of just fussing about the name, but you could have an actual Bayesian RAPM. All the choices you put into the prior alone could be a heck of a project and pretty interesting. I also would guess (as I kind of hinted with my example) that if you used an actual prior that age would become important again. I'm guessing it isn't a factor in your process because if you know how many minutes a guy is going to play, which you do because you use current season numbers, you already have a good sense of if he is suffering or benefiting from any age-related issues.
Interesting points.

Bayesian inference, as I understand it in its most general sense, requires that the prior describe our understanding of a value or distribution without some additional information, and then the additional information is taken into account to produce the posterior value or distribution. The prior does not need to be prior in a time sense.

In this case, vanilla RAPM (which could also be considered as a Bayesian inference) develops a very weakly informative prior through its lambda value and cross validation, which essentially is creating a prior based on a normal distribution of all NBA players.

The addition of a pseudo independent estimate of the player's value provides additional information to incorporate into the framework. What I have then, is a less weakly informative prior. Now, ideally I would provide with that point estimate an estimate of the error associated with the prior point estimate, but in this case I am allowing the Ridge Regression routine develop an estimate of the error through cross validation--it is developing a consistent variance that it is using for all players (the lambda value). It's a little bit crude to do it this way, I know.

Any form of additional information added to the estimate of the player's value can be treated and thought of through the Bayesian framework. If I am looking for an estimate of the player's production in a given year, I can add additional pieces of data--more of the box score, for instance, or information from the prior year. That can again be thought of as updates to the distribution in a Bayesian sense. Real Plus/Minus, using more pieces of information to refine the player value estimate, would be further along this Bayesian path.
Developer of Box Plus/Minus
APBRmetrics Forum Administrator
GodismyJudgeOK.com/DStats/
Twitter.com/DSMok1

xkonk
Posts: 286
Joined: Fri Apr 15, 2011 12:37 am

Re: Bayesian RAPM

Post by xkonk » Mon Oct 15, 2018 5:24 pm

DSMok1 wrote:
Sat Oct 13, 2018 11:19 am
Bayesian inference, as I understand it in its most general sense, requires that the prior describe our understanding of a value or distribution without some additional information, and then the additional information is taken into account to produce the posterior value or distribution. The prior does not need to be prior in a time sense.
Yeah, there isn't a single Bayes procedure or concept obviously. What you have set up would fit with what people call empirical Bayes (baseball example, Wikipedia article). Like you said, regularized regression itself is Bayesian in a sense because you have a 'prior' that most results should be close to 0. Your process alters it a bit so that the prior is centered at different places for different players.

I guess for me, I like the prior to be actually (temporally) prior to the data and to have a distribution because it allows for so much more investigation of the data. Like, did your data actually move you off your prior very much? You can only tell if they're based on independent data, which the box score and pbp sort of are, but not really. And when you have distributions you can do much more with comparing various estimates to each other, particularly if you fit your model with an MCMC procedure. You get better (I would argue) error estimates for the various parameters and you can also look at their covariances. Tim Duncan is a tinch better than Ginobili in your spreadsheet for example, but I bet they're highly correlated and so Tim is actually clearly better. Draymond Green and Rasheed Wallace are separated by a similar few tenths of a point but I would guess have very little correlation and so you would be hard-pressed to say if they're actually notably different. Not that people necessarily care about comparing players like this, but that is something that becomes pretty tempting once you have an all-in-one number sorted by value.

xkonk
Posts: 286
Joined: Fri Apr 15, 2011 12:37 am

Re: Bayesian RAPM

Post by xkonk » Tue Oct 16, 2018 12:12 am

Of course, we should all probably apply the XKCD correction https://xkcd.com/2059/

Post Reply