Skip to contents

This function adjusts the interaction matrix of the model so that its diet matrix matches the given diet matrix (typically derived usingreduceEcopathDiet()).

Usage

matchDiet(params, diet_matrix, min_w_pred = 0, max_w_pred = Inf)

Arguments

params

A MizerParams object

diet_matrix

The Ecopath diet matrix as produced by reduceEcopathDiet().

min_w_pred

The minimum weight of predators to include in the diet matrix. Default is 0.

max_w_pred

The maximum weight of predators to include in the diet matrix. Default is Inf.

Value

A MizerParams object with the interaction matrix set so that the desired diet is achieved.

Details

This function first converts the input diet matrix from proportions to absolute consumption using species-specific consumption rates. It then calculates the interaction strengths required to reproduce this diet and applies them using makeInteracting(). External mortality and encounter terms are adjusted to preserve the model’s steady state.

If min_w_pred or max_w_pred are provided, the diet matrix is assumed to represent consumption by individuals within that size range

If matching the diet requires interaction strengths that would imply negative external mortality or encounter rates for any species, warnings will be issued by makeInteracting(). These indicate that the model assumptions may be biologically unrealistic or that the input diet matrix is incompatible with other model parameters.