Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flickering when selecting parameters on page "ESTIMATE" #195

Open
fweber144 opened this issue Mar 29, 2022 · 0 comments
Open

Flickering when selecting parameters on page "ESTIMATE" #195

fweber144 opened this issue Mar 29, 2022 · 0 comments

Comments

@fweber144
Copy link

With shinystan v2.6.0, I get a strange bug when selecting parameters on page "ESTIMATE". The input field "Select or enter parameter names" as well as the plot start flickering heavily, making further use of that input field impossible (and the plot almost impossible to read).

Reproducible steps:

  1. Create file schools.stan with content (modified from https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started):
    // saved as schools.stan
    data {
      int<lower=0> J;         // number of schools 
      real y[J];              // estimated treatment effects
      real<lower=0> sigma[J]; // standard error of effect estimates 
    }
    parameters {
      real mu;                // population treatment effect
      real<lower=0> tau;      // standard deviation in treatment effects
      vector[J] eta;          // unscaled deviation from mu by school
    }
    transformed parameters {
      vector[J] theta = mu + tau * eta;        // school treatment effects
    }
    model {
      target += student_t_lpdf(mu | 7, 0, 5);  // prior for mu
      target += student_t_lpdf(tau | 7, 0, 1);  // prior for tau
      target += normal_lpdf(eta | 0, 1);       // prior log-density
      target += normal_lpdf(y | theta, sigma); // log-likelihood
    }
    
  2. Run
    library(rstan)
    options(mc.cores = parallel::detectCores())
    rstan_options(auto_write = TRUE)
    
    schools_dat <- list(J = 8, 
                        y = c(28,  8, -3,  7, -1,  1, 18, 12),
                        sigma = c(15, 10, 16, 11,  9, 11, 10, 18))
    
    fit <- stan(file = "schools.stan", data = schools_dat, seed = 2098606L)
    
    library(shinystan)
    launch_shinystan(fit)
  3. In the shinystan app, switch to page "ESTIMATE".
  4. Select parameter mu.
  5. Now, I already get a mild version of the flickering described above.
  6. Enter theta in the "Add parameters by regex search" input field and click on "Search".
  7. Now, I get the heavy flickering described above. Interestingly, after switching the browser tab and switching back to shinystan, the flickering stops, but the "Select or enter parameter names" input field is still unusable. Only the regex input field works, but when using it, the flickering starts again.

Session info:

I observed this with two different browsers on Ubuntu 20.04.3 LTS: Firefox and Chromium. I also observed this on Windows 10, but there I only tested Firefox. For the R packages (reduced to the content I deemed more or less relevant; tell me if you need more):

> sessioninfo::session_info()
- Session info --------------------------------------------------------------------------------------------------------
 setting  value
 version  R version 4.1.3 (2022-03-10)
 [...]
 ui       RStudio
 [...]
 rstudio  1.4.1717 Juliet Rose (desktop)
 [...]

- Packages ------------------------------------------------------------------------------------------------------------
 ! package       * version    date (UTC) lib source
   [...]
   bayesplot       1.9.0      2022-03-10 [1] CRAN (R 4.1.3)
   [...]
   bslib           0.3.1      2021-10-06 [1] CRAN (R 4.1.1)
   [...]
   callr           3.7.0      2021-04-20 [1] CRAN (R 4.0.5)
   [...]
   fontawesome     0.2.2      2021-07-02 [1] CRAN (R 4.1.1)
   [...]
   ggplot2         3.3.5      2021-06-25 [1] CRAN (R 4.1.0)
   ggridges        0.5.3      2021-01-08 [1] CRAN (R 4.0.3)
   [...]
   htmltools       0.5.2      2021-08-25 [1] CRAN (R 4.1.1)
   htmlwidgets     1.5.4      2021-09-08 [1] CRAN (R 4.1.1)
   [...]
   jquerylib       0.1.4      2021-04-26 [1] CRAN (R 4.0.5)
   jsonlite        1.8.0      2022-02-22 [1] CRAN (R 4.1.2)
   [...]
   knitr           1.38       2022-03-25 [1] CRAN (R 4.1.3)
   [...]
   loo             2.5.1      2022-03-24 [1] CRAN (R 4.1.2)
   [...]
   markdown        1.1        2019-08-07 [1] CRAN (R 4.0.0)
   [...]
   rlang           1.0.2      2022-03-04 [1] CRAN (R 4.1.2)
   rmarkdown       2.13       2022-03-10 [1] CRAN (R 4.1.3)
   [...]
   rstan         * 2.26.6     2021-12-15 [1] local
   rstudioapi      0.13       2020-11-12 [1] CRAN (R 4.0.3)
   sass            0.4.1      2022-03-23 [1] CRAN (R 4.1.2)
   scales          1.1.1      2020-05-11 [1] CRAN (R 4.0.0)
   sessioninfo     1.2.2      2021-12-06 [1] CRAN (R 4.1.2)
   [...]
   shiny         * 1.7.1      2021-10-02 [1] CRAN (R 4.1.1)
   shinyjs         2.1.0      2021-12-23 [1] CRAN (R 4.1.2)
   shinystan     * 2.6.0      2022-03-03 [1] CRAN (R 4.1.2)
   shinythemes     1.2.0      2021-01-25 [1] CRAN (R 4.0.3)
   [...]
   StanHeaders   * 2.26.6     2021-12-15 [1] local
   [...]
   V8              4.1.0      2022-02-06 [1] CRAN (R 4.1.2)
   [...]
   withr           2.5.0      2022-03-03 [1] CRAN (R 4.1.2)
   [...]
   xtable          1.8-4      2019-04-21 [1] CRAN (R 4.0.0)
   [...]

 [...]
-----------------------------------------------------------------------------------------------------------------------

Packages rstan and StanHeaders are from https://mc-stan.org/r-packages/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant