Skip to content

Commit 3ad70fa

Browse files
committed
reactive functions for warnings
1 parent 64e751e commit 3ad70fa

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

inst/shinyStan/server.R

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,26 +157,24 @@ shinyServer(function(input, output, session) {
157157
output$n_eff_warnings_title <- renderText({
158158
paste0("The following parameters have an effective sample size less than ", input$n_eff_threshold,"% of the total number of samples: ")
159159
})
160+
output$n_eff_warnings <- renderText({
161+
n_eff_warnings()
162+
})
160163
#### TEXT: rhat warnings ####
161164
output$rhat_warnings_title <- renderText({
162165
paste0("The following parameters have an Rhat value above ", input$rhat_threshold,": ")
163166
})
167+
output$rhat_warnings <- renderText({
168+
rhat_warnings()
169+
})
164170
#### TEXT: mcmc se to posterior sd warnings ####
165171
output$mcse_over_sd_warnings_title <- renderText({
166172
paste0("The following parameters have a Monte Carlo standard error greater than ", input$mcse_threshold ,"% of the posterior standard deviation:")
167173
})
168-
#### TEXT: n_eff warnings ####
169-
output$n_eff_warnings <- renderText({
170-
paste(.n_eff_warnings(fit_summary, threshold = input$n_eff_threshold), collapse = "\n")
171-
})
172-
#### TEXT: rhat warnings ####
173-
output$rhat_warnings <- renderText({
174-
paste(.rhat_warnings(fit_summary, threshold = input$rhat_threshold), collapse = "\n")
175-
})
176-
#### TEXT: mcmc se to posterior sd warnings ####
177174
output$mcse_over_sd_warnings <- renderText({
178-
paste(.mcse_over_sd_warnings(fit_summary, threshold = input$mcse_threshold), collapse = "\n")
175+
mcse_over_sd_warnings()
179176
})
177+
180178
#### PLOT: autocorrelation ####
181179
output$autocorr_plot_out <- renderPlot({
182180
autocorr_plot()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
n_eff_warnings <- reactive({
2+
paste(.n_eff_warnings(fit_summary, threshold = input$n_eff_threshold), collapse = "\n")
3+
})
4+
5+
rhat_warnings <- reactive({
6+
paste(.rhat_warnings(fit_summary, threshold = input$rhat_threshold), collapse = "\n")
7+
})
8+
9+
mcse_over_sd_warnings <- reactive({
10+
paste(.mcse_over_sd_warnings(fit_summary, threshold = input$mcse_threshold), collapse = "\n")
11+
})

inst/shinyStan/shinyStan.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
.navbar {
2929
margin-bottom: 0px;
30-
font-size: 16px ;
30+
font-size: 15px ;
3131
}
3232

3333
.well {

0 commit comments

Comments
 (0)