sambrilleman / rstanarm

rstanarm R package for Bayesian applied regression modeling
http://mc-stan.org/interfaces/rstanarm.html
GNU General Public License v3.0
0 stars 1 forks source link

Poor n_eff with binomial model for biomarker #63

Open jburos opened 7 years ago

jburos commented 7 years ago

Summary:

Not sure if this is intentional, but I noticed some dummy variables in the mvmer.stan chunk & it appears that the target isn't being incremented for binomial & bernoulli link functions?

Description:

Looking at lines 30-31 of mvmer_lp.stan:

else if (family[m] == 5) {  // binomial
          real dummy;  // irrelevant but useful for testing
          dummy = ll_binom_lp(y_int[I1:I2], trials[idx[m,1]:idx[m,2]], eta_tmp, link[m]);     
        }

Shouldn't this be the following, instead?

     target += ll_binom_lp(y_int[I1:I2], trials[idx[m,1]:idx[m,2]], eta_tmp, link[m]);

Reproducible Steps:

Coming soon

RStanARM Version:

Here still using my fork of rstanarm, as follows:

devtools::install_github('jburos/rstanarm', ref = 'fix-posterior-predict-newdata', args = '--preclean', local = TRUE)

R Version:

> getRversion()
[1] ‘3.3.3’
sambrilleman commented 7 years ago

Have just taken a look at this, and I think the target it incremented within the ll_binom_lp function. See here for binomial and here for bernoulli.

That code is just a very minor adaptation of Ben and Jonah's code, for example this section of the binomial.stan file, and the likelihood functions I haven't changed, they are simply the chunks that Ben and Jonah wrote.

If you also think this looks ok, and I haven't missed something, then do let me know and I will close the issue.

jburos commented 7 years ago

Thanks @sambrilleman - although I'm still seeing really poor performance of the models with a binomial family on the biomarkers. I'm going to rename this issue to reflect my observations & will post a reproducible example.