Skip to contents

This function plots the negative log likelihood values for different components against a specified predictor (e.g., natural mortality). The function uses ggplot2 for visualization.

Usage

plot_likes(
  M,
  xlab = "Natural Mortality",
  ylab = "relative -ln Likelihood",
  ylim = NULL,
  xlim = NULL,
  alpha = 0.1,
  legend = TRUE
)

Arguments

M

A list of models from which likelihood values will be extracted.

xlab

Label for the x-axis. Default is "Natural Mortality".

ylab

Label for the y-axis. Default is "relative -ln Likelihood".

ylim

Limits for the y-axis. Default is NULL.

xlim

Limits for the x-axis. Default is NULL.

alpha

Alpha transparency level for the plotted lines. Default is 0.1.

legend

Logical indicating whether to display a legend. Default is TRUE.

Value

A ggplot object displaying the negative log likelihood values.

Examples

# Assuming 'model_list' is a list of models with the appropriate structure
# plot_likes(model_list)