Skip to contents

Shows distributions of parameters from bootstrap samples or hierarchical individual estimates.

Usage

plot_distributions.fb4_result(
  fb4_result,
  color_scheme = "green",
  show_individuals = TRUE
)

Arguments

fb4_result

FB4 result object with distribution data

color_scheme

Color scheme to use, default "green"

show_individuals

For hierarchical: show individual estimates, default TRUE

Value

Called for its plotting side-effect. Invisibly returns NULL.

Examples

# \donttest{
data(fish4_parameters)
sp   <- fish4_parameters[["Oncorhynchus tshawytscha"]]$life_stages$adult
info <- fish4_parameters[["Oncorhynchus tshawytscha"]]$species_info
bio  <- Bioenergetic(
  species_params     = sp,
  species_info       = info,
  environmental_data = list(
    temperature = data.frame(Day = 1:30, Temperature = rep(12, 30))
  ),
  diet_data = list(
    proportions = data.frame(Day = 1:30, Prey1 = 1.0),
    energies    = data.frame(Day = 1:30, Prey1 = 5000),
    prey_names  = "Prey1"
  ),
  simulation_settings = list(initial_weight = 100, duration = 30)
)
#> Bioenergetic object created for: Oncorhynchus tshawytscha
bio$species_params$predator$ED_ini <- 5000
bio$species_params$predator$ED_end <- 5500
set.seed(42)
obs_weights <- rnorm(10, mean = 90, sd = 5)
result_boot <- run_fb4(bio, strategy = "bootstrap", fit_to = "Weight",
                       observed_weights = obs_weights, n_bootstrap = 20,
                       verbose = FALSE)
#> Validation warnings:
#> Missing optional parameters (will be calculated): CG1, CG2
#> Object is ready for simulation
#> Validation warnings:
#> Missing optional parameters (will be calculated): CG1, CG2
#> Object is ready for simulation
#> Processing species parameters...
#> Processing temporal data...
#> No indigestible fraction data provided, using default 0% for all prey (FB4 default)
#> Processing simulation settings...
#> Simulation data preparation complete. Ready for simulation.
#> Warning: Initial weight (100g) is not smaller than minimum final weight (87.2g). Check your data.
plot_distributions.fb4_result(result_boot)
# }