Derive relative difference from terminal year from a retrospective analysis.
get_retrospective_relative_difference.Rd
Derive relative difference from terminal year from a retrospective analysis.
See also
Other Model Diagnostics:
do_jitter()
,
do_likelihood_profile()
,
do_retrospective()
,
do_runs_test()
,
get_catch_fits_plot()
,
get_comp_prop()
,
get_idx_fits()
,
get_idx_fits_plot()
,
get_model_rep_from_mcmc()
,
get_nLL_plot()
,
get_osa()
,
get_retrospective_plot()
,
plot_resids()
Examples
if (FALSE) { # \dontrun{
ret <- do_retrospective(7, data, parameters, mapping, random = NULL, do_par = TRUE, n_cores = 7, do_francis = TRUE, n_francis_iter = 5)
ret_df <- get_retrospective_relative_difference(ret)
ggplot(ret_df %>% filter(Type == 'SSB'), aes(x = Year, y = rd, group = 2024- as.numeric(peel), color = 2024 - as.numeric(peel))) +
geom_hline(yintercept = 0, lty = 2, lwd = 1.3) +
coord_cartesian(ylim = c(-0.4, 0.4)) +
geom_line(lwd = 1.5) +
guides (color = guide_colourbar(barwidth = 15, barheight = 1.3)) +
labs(x = 'Year', y = 'Relative Difference from Terminal Year', color = 'Retrospective Year') +
scale_color_viridis_c() +
theme_bw(base_size = 15) +
theme(legend.position = 'top')
} # }