Skip to contents

Plot close-kin match observations and fitted values for POP and HSP data, with an optional total-match panel that also includes gene tagging when available.

Usage

plot_hsps(
  fit = NULL,
  object = NULL,
  return_list = FALSE,
  verbose = FALSE,
  observed_color = "#D55E00",
  predicted_color = "#0072B2",
  data = NULL
)

Arguments

fit

An sbt_fit object. This diagnostic uses its fitted point estimate; posterior intervals are not materialized.

object

Legacy RTMB objective used only with a legacy data-list input.

return_list

Logical. If TRUE, return a named list of individual close-kin fit plots. If FALSE, return the total-match plot for backward compatibility.

verbose

Logical. If TRUE, print cohort progress messages.

observed_color

Color used for observed match counts.

predicted_color

Color used for predicted match counts and intervals.

data

Legacy named alias for a model data list; supply object as well.

Value

If return_list = FALSE, a ggplot2 object displaying total POP, HSP, and optional GT observations and fitted values. If return_list = TRUE, a named list of ggplot2 and patchwork plot objects for the close-kin fit panels.

Details

Displayed count intervals are conditional plug-in approximations and do not propagate posterior parameter uncertainty.

Examples

fit <- sbt_example_fit()
#> Warning: Dependency versions differ: RTMBdist, TMB
#> Warning: Dependency versions differ: RTMBdist, TMB
plot_hsps(fit)