Assistance with Bayesian Random Effects and Mixed Effects Models

286 Views Asked by At

I am looking to build either a random effects or mixed effects model for a project I am working on, but have had trouble finding good sources and understanding the general structure of the model. Could someone either explain or direct me to a detailed example where this type of model is implemented? I am also looking for an explanation of all of its components, how/why the specific model was chosen, and the general process one should follow to build one of these models. I have learned about some relevant concepts, such as priors, different types of probability distributions, etc. but am not sure how to actually build one of these models.

Here is a link to a short paper on the type of model I am working on and would like to understand: http://www.blakemcshane.com/Papers/jqas_pitching.pdf

I would also like to understand more about the underlying math in these models. I know my question is very general, but any help would be much appreciated. Thank you.

1

There are 1 best solutions below

0
On BEST ANSWER

ok here is an attempt

What you are looking for in general are Bayesian hierarchical models. A good reference for all things Bayesian is Gelmans Bayesian Data Analysis.

For your example this is a hierarchical model, which follows this logic

1) Define your likelihood

$y_{ij}|\alpha_i,sigma^2,\mu ~ N(\mu + \alpha_i,\sigma^2_{ij})$

In this model you are saying that your DATA is normally distributed with mean $\mu + \alpha_i$ and variance $\sigma^2_{ij}$. It is important to note that you have $i$ and $j$ indices to allow for random effects. In your paper $i$ is the pitcher and $j$ is the season. So you have in the likelihood a league mean $\mu$ but also a random effect $\alpha_i$ for each pitcher (pitcher specific differences)

2) Now that you have defined the likelihood you need to define probability distributions for all the terms in the likelihood (priors). That is distributions for $\mu,\alpha,\sigma$

3) lets start with the $\alpha$ term (defined for the $i$s). Alpha further described by two additional parameters $\tau$ and $\gamma$. The alphas can take two split values, they can be zero if $\gamma_i$ is zero and $N(0,\tau^2)$ if not, where $\tau$ is given (i think). So now we need to define the $\gamma$s. This is simply a Bernoulli distribution, that returns 1 and 0 given a probability $p_1$. Finally we define $p_1$ as a $beta(1,1)$ or unit uniform distribution.

It is important that you can see the logic of the hierarchy here, step by step defining each term.

4) In a similar fashion lets now define $\mu$, which is simply a normal with mean 0 and large standard deviation. This prior reflects a lack of knowledge as it is diffuse.

5) Finally $\sigma^2$, which is the variance of the normal likelihood is given a diffuse (non informative) inverse gamma prior.

6) When you combine all the priors and the likelihood, and divide them by the marginal likelihood you get the posterior distribution. Which is the probability of the parameters given the data. You can get this posterior using MCMC.


So thats a brief and i hope slightly helpful explanation of the model in that paper. To help you further understand this, i would suggest reading up on Hierarchical models in Bayesian data analysis.

Also if you can use WIN BUGS or JAGS or STAN in R to code up the model and view the outputs

examples of win bugs type coding are plentiful online