# Standard set of diagnostic plots ---- # fit = fit4_pot # plot_fit_diagnostics <- function(fit, type = c("dens_overlay", "bars"), draws = 100) { # y <- fit$data[,1] # yrep_poisson <- posterior_predict(object = fit, draws = draws) # # p1 <- pp_check(object = fit, type = type, ndraws = draws) + # # coord_cartesian(xlim = c(0, 15)) + # labs(x = "CPUE (lobsters/pot)", y = "Density") + # theme_bw() # p2 <- ppc_stat(y, yrep, stat = "prop_zero") # p3 <- ppc_stat(y, yrep, stat = "max") # pp_check(fit2, type = "loo_pit_qq") # # p1 + P2 + P3 # }
Standard set of diagnostic plots ----
fit = fit4_pot
plot_fit_diagnostics <- function(fit, type = c("dens_overlay", "bars"), draws = 100) {
y <- fit$data[,1]
yrep_poisson <- posterior_predict(object = fit, draws = draws)
p1 <- pp_check(object = fit, type = type, ndraws = draws) +
# coord_cartesian(xlim = c(0, 15)) +
labs(x = "CPUE (lobsters/pot)", y = "Density") +
theme_bw()
p2 <- ppc_stat(y, yrep, stat = "prop_zero")
p3 <- ppc_stat(y, yrep, stat = "max")
pp_check(fit2, type = "loo_pit_qq")
p1 + P2 + P3
}