
/cdn.vox-cdn.com/uploads/chorus_image/image/48637245/RBI_Baseball_16___3.0.0.png)

The output from the app tells me that these beliefs are consistent with a beta curve with shape parameters 5.20 and 66.97.

After some thought, I believe Judge’s true 2022 home run probability (based on his performance before the 2022 season) is 50% likely to be in the interval (0.05, 0.09) - I enter these values using the slider in the Shiny app.Below is a snapshot of using this function. I initially wrote a R function predict_hr() to implement this prediction exercise and then a Shiny app to run this function. One probability of interest is the probability that Judge will hit at least 62 home runs and eclipse Maris’ Yankee record. Or we can compute predictive probabilities of interest. For example, we can compute the mean of this distribution - this will be a prediction of the number of home runs that Judge will hit in the remainder of the season. Given this sample, we compute any predictive summary of interest. īy repeating these two steps many times, we obtain a large number of simulated draws from the predictive distribution. Then we simulate from a binomial distribution with sample size and probability of success.We simulate values of the hitting probability and the future number of PA from our priors - is simulated from a beta( ) curve and is simulated form a normal(.We simulate from the predictive distribution of the future number of home runs. This means that we’re 68% confident that the number of future PA is between and. We assume is normal with mean and standard deviation. We can make an intelligent guess at - call this guess and the standard deviation for this guess is. We also need a prior for the number of plate appearances in the remainder of the season. Assuming that the home run occurrences follow a binomial model, our updated or new beliefs about Judge’s home run probability follow a beta curve with shape parameters and. At this time (through July 31), he has hit 42 home runs in 441 plate appearances. Next we look at Judge’s home run performance for the 2022 season. (These two numbers are the quartiles of the prior.) This information can be matched with a beta curve with shape parameters and. Suppose we can construct an interval such that we believe that is equally likely to be inside or outside of the interval. We’ve watched Aaron Judge over the season 2015 through 2021 and have some belief for the location of Judge’s 2022 home run probability on a single PA. Our first task to assign reasonable prior distributions to and, and then we can simulate the predictive distribution for. The problem in using this distribution is that we have two unknowns - we don’t know Judge’s home run probability and we don’t know the exact number of plate appearances in the remainder of the season. If denotes the number of remaining plate appearances, then a common model says that the number of future home runs has a binomial distribution with sample size and probability of success. Suppose we let denote Judge’s probability of a home run in a single plate appearance in the 2022 season. We are interested in learning about, the number of home runs that Judge will hit in the remainder of the season. Using a R function and associated Shiny app, I obtain a point prediction for the number of 2022 home runs and compute the probability Judge hits at least 62 home runs this season. Using this prior and a binomial sampling model, I simulate home run results for the remainder of the season. Also I construct a prior for the number of plate appearances in the remainder of the season.
#R baseball update
I construct a prior for Judge’s 2022 home run probability using his performance during earlier seasons and update this information with the current 2022 data. To address this question, I illustrate Bayesian prediction of Judge’s home run hitting for the remainder of this season. That raises the obvious question: how many home runs will Judge hit in 2022 and will he beat Roger Maris’ 61 home runs hit during the 1961 season? Fans are following the hitting of Aaron Judge who is currently on a record-setting pace with his 42nd home run on July 30. This has been an exciting season for the New York Yankees who are having one of their best seasons.
