|
83 | 83 | #' # marginal predictive check using LOO probability integral transform
|
84 | 84 | #' color_scheme_set("orange")
|
85 | 85 | #' ppc_loo_pit_overlay(y, yrep, lw = lw)
|
86 |
| -#' ppc_loo_pit_overlay(y, yrep, lw = lw, boundary_correction = TRUE) |
87 | 86 | #'
|
88 | 87 | #' ppc_loo_pit_qq(y, yrep, lw = lw)
|
89 | 88 | #' ppc_loo_pit_qq(y, yrep, lw = lw, compare = "normal")
|
@@ -188,7 +187,11 @@ ppc_loo_pit_overlay <- function(y,
|
188 | 187 | data = function(x) dplyr::filter(x, .data$is_y),
|
189 | 188 | size = 1,
|
190 | 189 | lineend = "round",
|
191 |
| - na.rm = TRUE) |
| 190 | + na.rm = TRUE) + |
| 191 | + scale_x_continuous( |
| 192 | + limits = c(0, 1), |
| 193 | + expand = expansion(0, 0) |
| 194 | + ) |
192 | 195 |
|
193 | 196 | } else {
|
194 | 197 | p <- ggplot(data) +
|
@@ -218,18 +221,20 @@ ppc_loo_pit_overlay <- function(y,
|
218 | 221 | adjust = adjust,
|
219 | 222 | kernel = kernel,
|
220 | 223 | n = n_dens,
|
221 |
| - na.rm = TRUE) |
| 224 | + na.rm = TRUE) + |
| 225 | + scale_x_continuous( |
| 226 | + limits = c(0.05, 0.95), |
| 227 | + expand = expansion(0, 0), |
| 228 | + breaks = seq(from = .1, to = .9, by = .2) |
| 229 | + ) |
222 | 230 | }
|
223 | 231 |
|
224 | 232 | p +
|
225 | 233 | scale_color_ppc_dist(labels = c("PIT", "Unif")) +
|
226 |
| - scale_x_continuous( |
227 |
| - limits = c(0.05, 0.95), |
228 |
| - expand = expansion(0, 0), |
229 |
| - breaks = seq(from = .1, to = .9, by = .2)) + |
230 | 234 | scale_y_continuous(
|
231 | 235 | limits = c(0, NA),
|
232 |
| - expand = expansion(mult = c(0, .25))) + |
| 236 | + expand = expansion(mult = c(0, .25)) |
| 237 | + ) + |
233 | 238 | bayesplot_theme_get() +
|
234 | 239 | yaxis_title(FALSE) +
|
235 | 240 | xaxis_title(FALSE) +
|
|
0 commit comments