tag:blogger.com,1999:blog-3240271627873788873.post7000242433024742601..comments2024-03-26T06:46:11.752-04:00Comments on Doing Bayesian Data Analysis: Shrinkage in multi-level hierarchical modelsJohn K. Kruschkehttp://www.blogger.com/profile/17323153789716653784noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-3240271627873788873.post-90801204386060931232018-04-18T17:35:55.890-04:002018-04-18T17:35:55.890-04:00In principle JAGS/Stan allows you to specify nearl...In principle JAGS/Stan allows you to specify nearly any model you want. Start by thinking carefully about how you would model a single-player's data. Then think about how you'd put a higher-level distribution on the parameters of the single-player model, to describe what's typical across players.John K. Kruschkehttps://www.blogger.com/profile/17323153789716653784noreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-72111137172677349262018-04-17T15:25:59.817-04:002018-04-17T15:25:59.817-04:00Dr. Kruschke,
This example is great, and I love y...Dr. Kruschke,<br /><br />This example is great, and I love your book! I was wondering if it is doable to do a multi-level regression application similar to this? Sticking with the baseball theme, I am interested in using a regression that predicts batting average from position as well as from opposing ERA, which is itself predicted by opposing pitcher. <br /><br />My model relates to predicting success and failure of college students, but I think this example is parallel in its nested structure. I would also like to use this as a predictive model, but I have already visited another of your blog posts about this and think I have a good understanding of how to do that. I just have never built a nested structure regression before, and didn't know if it was possible in a bayesian and JAGS framework.Anonymoushttps://www.blogger.com/profile/06489538544741861214noreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-69501817999751920982017-11-19T21:30:51.037-05:002017-11-19T21:30:51.037-05:00This model is fully implemented and described in C...This model is fully implemented and described in Chapter 9 of DBDA2E.John K. Kruschkehttps://www.blogger.com/profile/17323153789716653784noreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-61932886450548050662017-11-19T21:07:31.686-05:002017-11-19T21:07:31.686-05:00Thank you for wonderful work Dr.Kruschke.
I have a...Thank you for wonderful work Dr.Kruschke.<br />I have a question for this.<br />How can I make a R code for multi-level hierarchical models?<br />I revised your "Jags-Ybinom-XnomSsubjCcat-MbinomBetaOmegaKappa.R" like this:<br /><br /> model {<br /> for ( sIdx in 1:Nsubj ) {<br /> z[sIdx] ~ dbin( theta[sIdx] , N[sIdx] )<br /> theta[sIdx] ~ dbeta( omega[c[sIdx]]*(kappa[c[sIdx]]-2)+1 , <br /> (1-omega[c[sIdx]])*(kappa[c[sIdx]]-2)+1 ) <br /> }<br /> for ( cIdx in 1:Ncat ) {<br /> omega[cIdx] ~ dbeta( omegaO*(kappaO-2)+1 , <br /> (1-omegaO)*(kappaO-2)+1 )<br /> kappa[cIdx] <- kappaMinusTwo[cIdx] + 2<br /> kappaMinusTwo[cIdx] ~ dgamma( SO , RO ) # mean=1 , sd=10 (generic vague)<br /> }<br /> omegaO ~ dbeta( 1.0 , 1.0 ) <br /> kappaO <- kappaMinusTwoO + 2<br /> kappaMinusTwoO ~ dgamma( 0.01 , 0.01 ) # mean=1 , sd=10 (generic vague)<br /> SO ~ dgamma( 0.01 , 0.01 ) # mean=1 , sd=10 (generic vague)<br /> RO ~ dgamma( 0.01 , 0.01 ) # mean=1 , sd=10 (generic vague)<br /> }<br /><br />and I wonder it is right or not.Anonymoushttps://www.blogger.com/profile/00831584126111984706noreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-32338132188535573452017-10-30T23:31:50.326-04:002017-10-30T23:31:50.326-04:00Great, thank you for the pointer! I'll check i...Great, thank you for the pointer! I'll check it out.Ben Smithhttps://www.blogger.com/profile/13434056673824054456noreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-15723050869876062992017-10-30T21:36:03.733-04:002017-10-30T21:36:03.733-04:00Sounds like what you have in mind is crossed nomin...Sounds like what you have in mind is crossed nominal factors for prediction. You might consider an "ANOVA"-like design; see Ch 20.John K. Kruschkehttps://www.blogger.com/profile/17323153789716653784noreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-21910780632190009172017-10-30T21:31:03.433-04:002017-10-30T21:31:03.433-04:00I'm really enjoying your book, Dr. Kruschke.
...I'm really enjoying your book, Dr. Kruschke.<br /><br />Do you have any information on parameter estimation for a non-nested hierarchical model? <br /><br />Continuing with the baseball theme, let's say that in addition to categorizing players by Primary Position, I also categorize them by whether they came through to the Major League from the Minor Leagues or from College Baseball. To keep it simple we could imagine this is just a dichotomous variable, Minor Leagues or College, and avoid estimating separate values for each league/college.<br /><br />Would I need to set either Minor League or College Baseball as my baseline and just estimate a difference score, perhaps added to the omega and kappa parameters at some level? Or is there some way to estimate each of the two groups from a distribution as you've done above with Primary Position?Ben Smithhttps://www.blogger.com/profile/13434056673824054456noreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-5236991750442896512017-10-30T21:28:35.166-04:002017-10-30T21:28:35.166-04:00This comment has been removed by the author.Ben Smithhttps://www.blogger.com/profile/13434056673824054456noreply@blogger.comtag:blogger.com,1999:blog-3240271627873788873.post-52392624699298778712012-12-02T20:36:09.857-05:002012-12-02T20:36:09.857-05:00Dear John:
This is fantastic! Thank you for conti...Dear John:<br /><br />This is fantastic! Thank you for continuing with the baseball example.<br /><br />MattMattchewhttps://www.blogger.com/profile/00614937870548634642noreply@blogger.com