Open utterances-bot opened 1 year ago
this is great. Thanks for this. Such a simple demonstration. I am learning about shrinkage and Bayesian estimators and have tried to do the same thing with fewer parameters using brms
. However I can't get it to work. I'm guessing it is because I'm including random effects and I am probably not treating them correctly. Can you think of a simple demo with a random intercept?
also I learnt the same distinction between two kinds of statistics as "inferential" and "descriptive" in my psychology degree many years ago. Today I've seen people promote the benefit of shrinkage using another distinction between "causal" and "predictive" models (e.g., McElreath, Statistical Rethinking, 2019). But I'm wondering whether it would be possible/better to distinguish between models with latent variables vs concrete/realised variables. Shrinkage is relevant if you think your model variables are latent, where latent implies the model is estimating a hypothetical population parameter or providing a prediction about some future state. I think this crosses both distinctions mentioned above, but I could just be showing my psychology background...
Thanks for the nice words!
Simplest way to get going with a random intercept model is to use lme4. The model syntax is then fit <- lmer( outcome ~ fixed_variates + (1 | group_factor), data)
. the coefs of group_factor
will be your random intercepts. I think brms uses the same Wilkinson-style notation. You can play with the built-in sleepstudy data in the lme4 package. You'll see some shrinkage compared to the LSE.
Estimating three or more things | Random effect
https://randomeffect.net/post/2020/04/12/estimating-three-or-more-things/