Coder Social home page Coder Social logo

Comments (11)

rubenarslan avatar rubenarslan commented on May 23, 2024

I have the problem with fits from brms launched through brms::launch_shiny, but not with rstanarm fits launched via rstanarm::launch_shinystan, so if you can't reproduce it, maybe it's on @paul-buerkner's side and Gene Quinn did not mention this.

from shinystan.

jgabry avatar jgabry commented on May 23, 2024

Thanks for reporting. I still haven't been able to reliably reproduce this
problem so it's been difficult to debug. Haven't forgotten about it though.
When used with rstanarm models, shinystan lets rstanarm generate the plots
for the graphical posterior predictive checks (i.e., rstanarm creates the
ggplot objects and then shinystan just displays them), so that might be why
there's no issue when using rstanarm models.

On Fri, Jan 22, 2016 at 3:26 AM, Ruben C. Arslan [email protected]
wrote:

I have the problem with fits from brms launched through
brms::launch_shiny, but not with rstanarm fits launched via
rstanarm::launch_shinystan, so if you can't reproduce it, maybe it's on
@paul-buerkner https://github.com/paul-buerkner's side and Gene Quinn
did not mention this.


Reply to this email directly or view it on GitHub
#107 (comment).

from shinystan.

rubenarslan avatar rubenarslan commented on May 23, 2024

That would explain it at least. @paul-buerkner told me hadn't implemented it yet, but since the interface looks the same otherwise, it's easy to get mixed up. But you should probably ask Gene Quinn whether that was the case for him too.

from shinystan.

jgabry avatar jgabry commented on May 23, 2024

Gene's example wasn't brms related (just regular rstan with a .stan file)
but it's possible (likely even) that it turns out to be the same problem
under the hood.

On Friday, January 22, 2016, Ruben C. Arslan [email protected]
wrote:

That would explain it at least. @paul-buerkner
https://github.com/paul-buerkner told me hadn't implemented it yet, but
since the interface looks the same otherwise, it's easy to get mixed up.
But you should probably ask Gene Quinn whether that was the case for him
too.


Reply to this email directly or view it on GitHub
#107 (comment).

from shinystan.

jgabry avatar jgabry commented on May 23, 2024

Does this happen with every brms model you try or just with certain ones?

On Friday, January 22, 2016, Jonah Sol Gabry [email protected] wrote:

Gene's example wasn't brms related (just regular rstan with a .stan file)
but it's possible (likely even) that it turns out to be the same problem
under the hood.

On Friday, January 22, 2016, Ruben C. Arslan <[email protected]
javascript:_e(%7B%7D,'cvml','[email protected]');> wrote:

That would explain it at least. @paul-buerkner
https://github.com/paul-buerkner told me hadn't implemented it yet,
but since the interface looks the same otherwise, it's easy to get mixed
up. But you should probably ask Gene Quinn whether that was the case for
him too.


Reply to this email directly or view it on GitHub
#107 (comment)
.

from shinystan.

rubenarslan avatar rubenarslan commented on May 23, 2024

All so far, including gaussian and forked families. Tried maybe 5.

from shinystan.

jgabry avatar jgabry commented on May 23, 2024

Ok thanks. I try a few from brms and maybe that will help diagnose this. So
far I had just been testing with regular rstan models.

On Friday, January 22, 2016, Ruben C. Arslan [email protected]
wrote:

All so far, including gaussian and forked families. Tried maybe 5.


Reply to this email directly or view it on GitHub
#107 (comment).

from shinystan.

paul-buerkner avatar paul-buerkner commented on May 23, 2024

I am more than happy to help if needed. However, I currently don't see how brmsfit objects could be used with PPcheck of shinystan. The reason is that they do not contain a parameter with the y_rep values, because this would lead to models of multiple GBs for larger models. Instead, we have the predict method that generates those values within R, but those values cannot be included inside PPcheck of shinystan since they are not part of the model itself.

from shinystan.

jgabry avatar jgabry commented on May 23, 2024

Ok that makes sense. So this brms issue is separate from the original
issue.

I think I've finally solved the original issue, so I'm going to close this
after I test it, but if you want can you open a new issue for allowing the
PPcheck page to accept yrep from the user in the same way it does for y? I'm
definitely open to adding that functionality, which would allow it to work
with your package and be useful in general.

On Friday, January 22, 2016, Paul-Christian Bürkner <
[email protected]> wrote:

I am more than happy to help if needed. However, I currently don't see how
brmsfit objects could be used with PPcheck of shinystan. The reason is that
they do not contain a parameter with the y_rep values, because this would
lead to models of multiple GBs for larger models. Instead, we have the
predict method that generates those values within R, but those values
cannot be included inside PPcheck of shinystan as y_rep, since they are not
part of the model itself.


Reply to this email directly or view it on GitHub
#107 (comment).

from shinystan.

paul-buerkner avatar paul-buerkner commented on May 23, 2024

That would certainly be great! I will open another issue for this. :-)

from shinystan.

jgabry avatar jgabry commented on May 23, 2024

I just posted a reply to the original post on stan-users, which I'll copy here:

Hi Gene,

Sorry for the delay, but I've finally got this sorted out. The problem is that your y_rep doesn't have the right dimensions but ShinyStan was just waiting for an object with the correct dimensions instead of issuing a warning. I'm going to fix that so the warning appears. You can get the PPcheck page to work for your model if you make a slight tweak to your Stan code. The problem is that you have y declared as a real array with Nobs elements but y_rep is only declared as a scalar real. y_rep should have the same dimensions as y, so you can just change your generated quantities block to

generated quantities{
  real y_rep[Nobs];
  for (n in 1:Nobs)
    y_rep[n] <- gamma_rng(alpha,beta);
}

and then you'll be getting the right posterior predictive distribution and ShinyStan's PPcheck should work for you.

Jonah

I'm going to close this and open a new issue for adding the appropriate warning about dimensions.

from shinystan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.