Skip to content

Commit

Permalink
reactive functions for warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jgabry committed Feb 25, 2015
1 parent 64e751e commit 3ad70fa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
18 changes: 8 additions & 10 deletions inst/shinyStan/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -157,26 +157,24 @@ shinyServer(function(input, output, session) {
output$n_eff_warnings_title <- renderText({
paste0("The following parameters have an effective sample size less than ", input$n_eff_threshold,"% of the total number of samples: ")
})
output$n_eff_warnings <- renderText({
n_eff_warnings()
})
#### TEXT: rhat warnings ####
output$rhat_warnings_title <- renderText({
paste0("The following parameters have an Rhat value above ", input$rhat_threshold,": ")
})
output$rhat_warnings <- renderText({
rhat_warnings()
})
#### TEXT: mcmc se to posterior sd warnings ####
output$mcse_over_sd_warnings_title <- renderText({
paste0("The following parameters have a Monte Carlo standard error greater than ", input$mcse_threshold ,"% of the posterior standard deviation:")
})
#### TEXT: n_eff warnings ####
output$n_eff_warnings <- renderText({
paste(.n_eff_warnings(fit_summary, threshold = input$n_eff_threshold), collapse = "\n")
})
#### TEXT: rhat warnings ####
output$rhat_warnings <- renderText({
paste(.rhat_warnings(fit_summary, threshold = input$rhat_threshold), collapse = "\n")
})
#### TEXT: mcmc se to posterior sd warnings ####
output$mcse_over_sd_warnings <- renderText({
paste(.mcse_over_sd_warnings(fit_summary, threshold = input$mcse_threshold), collapse = "\n")
mcse_over_sd_warnings()
})

#### PLOT: autocorrelation ####
output$autocorr_plot_out <- renderPlot({
autocorr_plot()
Expand Down
11 changes: 11 additions & 0 deletions inst/shinyStan/server_files/outputs/warnings_reactive.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
n_eff_warnings <- reactive({
paste(.n_eff_warnings(fit_summary, threshold = input$n_eff_threshold), collapse = "\n")
})

rhat_warnings <- reactive({
paste(.rhat_warnings(fit_summary, threshold = input$rhat_threshold), collapse = "\n")
})

mcse_over_sd_warnings <- reactive({
paste(.mcse_over_sd_warnings(fit_summary, threshold = input$mcse_threshold), collapse = "\n")
})
2 changes: 1 addition & 1 deletion inst/shinyStan/shinyStan.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

.navbar {
margin-bottom: 0px;
font-size: 16px ;
font-size: 15px ;
}

.well {
Expand Down

0 comments on commit 3ad70fa

Please sign in to comment.