2
$\begingroup$

I'm new to doing Bayesian analysis and I wanted to learn by using baseball data. I took a group of players and found their hits and at bats for various years and I want to be able to get estimates for their true batting average (theta) every year up to the current year. I was able to run an MCMC model using rjags for the first year using a binomial likelihood and beta(1,1) prior for theta (batting average). I got values for alpha, beta, and thetas for each player. How do I go about incorporating that into next years analysis? When I plug in the estimates for alpha and beta as that I got from the first analysis as the new prior the trace plot becomes a flat line for alpha and beta (the thetas do change).

I know I could probably incorporate all the data into a single model file, but I want to do a separate file for each year of estimates.

This is my model

model{ 
for (i in 1:P){ 
#likelihood
hits[i] ~ dbin(theta[i], atbats[i]) 
#prior 
theta[i] ~ dbeta(alpha1, beta1)}
alpha1 ~ dbeta(1,1)
beta1 ~ dbeta(1,1)} 

The estimates after running are a = 0.7, b = 0.9

On the next years set of data, what do I do with the information obtained for these estimates? and why?

$\endgroup$
1
  • 2
    $\begingroup$ The posterior for one year is the prior for the following year. Since the model is not conjugate, the posterior cannot be expressed in closed form and a sample must be used instead, Using plug-in estimates is incorrect from a Bayesian perspective since this does not incorporate the uncertainty about these estimates. $\endgroup$
    – Xi'an
    Commented May 2, 2022 at 10:44

1 Answer 1

2
$\begingroup$

As pointed out by @Xi'an in his comment, you want to use the full posterior distribution as the prior for your next analysis.

Option 1 involves somehow finding a way of summarizing the posterior you got in the first analysis so that it can be used in the second analysis. Especially for 1 or 2 parameters, an approximation with a mixture distribution with a few mixture components works pretty well. See e.g. the vignettes for the RBesT R package and the referenced papers.

Option 2 involves refitting the model with the old data + the new data. In complicated cases, this may be easier to do in practice.

These two options are completely equivalent (but in your case with several parameters and hyper-parameters, it may be pretty difficult to find a way to implement option 1 "correctly".

$\endgroup$
1
  • $\begingroup$ I ended up going with option 2, now I am adding new hits and at bats data every year on top of the old data. $\endgroup$
    – thatoneguy
    Commented May 2, 2022 at 22:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.