This function combines MTE and stoichiometric theory in order to predict nescessary ingestion and excretion processes. A probability distribution is obtained by including uncertainty of parameters and using MCMC sampling with stan.

cnp_model_mcmc(
  TL,
  param,
  iter = 1000,
  cor = list(ro_Qc_Qn = 0.5, ro_Qc_Qp = -0.3, ro_Qn_Qp = -0.2, ro_Dc_Dn = 0.2, ro_Dc_Dp
    = -0.1, ro_Dn_Dp = -0.1, ro_lwa_lwb = 0.9, ro_alpha_f0 = 0.9),
  ...
)

Arguments

TL

Total length(s) in cm

param

List of all parameter means (add "_m") and standard deviations (add "_sd") Default parameters are set with very low sd's. parameters:

  • Qc_m, Qc_sd: percentage C of dry mass fish

  • Qn_m, Qn_sd: percentage N of dry mass fish

  • Qp_m, Qp_sd: percentage P of dry mass fish

  • Dc_m, Dc_sd: percentage C of dry mass food

  • Dn_m, Dn_sd: percentage N of dry mass food

  • Dp_m, Dp_sd: percentage P of dry mass food

  • ac_m, ac_sd: C-specific assimilation efficiency

  • an_m, an_sd: N-specific assimilation efficiency

  • ap_m, ap_sd: P-specific assimilation efficiency

  • linf_m, linf_sd: Von Bertalanffy Growth parameter, theoretical maximum size in TL (cm)

  • k_m, k_sd: Von Bertalanffy Growth parameter, growth rate (yr^-1)

  • t0_m, tO_sd: Von Bertalanffy Growth parameter (yr)

  • lwa_m, lwa_sd: Parameter length-weight relationship (g cm^-1)

  • lwb_m, lwb_sd: Parameter length-weight relationship

  • mdw_m, wprop_sd: Ratio between dry weight and wet weight of fish

  • F0nz_m, F0nz_sd: N-specific turnover rate

  • F0pz_m, F0pz_sd: P-specific turnover rate

  • f0_m, f0_sd: Metabolic normalisation constant independent of body mass (g C g^-alpha d^-1)

  • alpha_m, alpha_sd: Metabolic rate mass-scaling exponent

  • theta_m, theta_sd: Activity scope

  • r_m, r_sd: Aspect ratio of caudal fin

  • h_m, h_sd: Trophic level

  • v_m, v_sd: Environmental temperature (degrees celcius)

iter

A positive integer specifying the number of iterations. The default is 2000.

cor

A list of correlations between certain parameters: ro_Qc_Qn, ro_Qc_Qp, ro_Qn_Qp, ro_Dc_Dn, ro_Dc_Dp, ro_Dn_Dp, ro_lwa_lwb, ro_alpha_f0

...

Additional arguments rstan::sampling, see ?rstan:sampling

Details

Returns a list with two objects: A stanfit object and a data.frame with a summary of all model components. See extract to extract a summary of predicted variables and limitation to get information on the limiting element.

Examples

library(fishflux) model <- cnp_model_mcmc(TL = 10, param = list( Qc_m = 40, Qn_m = 10, Qp_m = 4, theta_m = 3))
#> Warning: not inputting certain parameters may give wrong results
#> Warning: adding standard values for ac_m
#> Warning: adding standard values for an_m
#> Warning: adding standard values for ap_m
#> Warning: adding standard values for Dc_m
#> Warning: adding standard values for Dn_m
#> Warning: adding standard values for Dp_m
#> Warning: adding standard values for linf_m
#> Warning: adding standard values for k_m
#> Warning: adding standard values for t0_m
#> Warning: adding standard values for r_m
#> Warning: adding standard values for h_m
#> Warning: adding standard values for lwa_m
#> Warning: adding standard values for lwb_m
#> Warning: adding standard values for mdw_m
#> Warning: adding standard values for v_m
#> Warning: adding standard values for F0nz_m
#> Warning: adding standard values for F0pz_m
#> Warning: adding standard values for alpha_m
#> Warning: adding standard values for f0_m
#> Warning: adding standard values for lt_sd
#> Warning: adding standard values for ac_sd
#> Warning: adding standard values for an_sd
#> Warning: adding standard values for ap_sd
#> Warning: adding standard values for Dc_sd
#> Warning: adding standard values for Dn_sd
#> Warning: adding standard values for Dp_sd
#> Warning: adding standard values for linf_sd
#> Warning: adding standard values for k_sd
#> Warning: adding standard values for t0_sd
#> Warning: adding standard values for theta_sd
#> Warning: adding standard values for r_sd
#> Warning: adding standard values for h_sd
#> Warning: adding standard values for lwa_sd
#> Warning: adding standard values for lwb_sd
#> Warning: adding standard values for mdw_sd
#> Warning: adding standard values for v_sd
#> Warning: adding standard values for F0nz_sd
#> Warning: adding standard values for F0pz_sd
#> Warning: adding standard values for Qc_sd
#> Warning: adding standard values for Qn_sd
#> Warning: adding standard values for Qp_sd
#> Warning: adding standard values for alpha_sd
#> Warning: adding standard values for f0_sd
#> #> SAMPLING FOR MODEL 'cnpmodelmcmc' NOW (CHAIN 1). #> Chain 1: Iteration: 1 / 1000 [ 0%] (Sampling) #> Chain 1: Iteration: 100 / 1000 [ 10%] (Sampling) #> Chain 1: Iteration: 200 / 1000 [ 20%] (Sampling) #> Chain 1: Iteration: 300 / 1000 [ 30%] (Sampling) #> Chain 1: Iteration: 400 / 1000 [ 40%] (Sampling) #> Chain 1: Iteration: 500 / 1000 [ 50%] (Sampling) #> Chain 1: Iteration: 600 / 1000 [ 60%] (Sampling) #> Chain 1: Iteration: 700 / 1000 [ 70%] (Sampling) #> Chain 1: Iteration: 800 / 1000 [ 80%] (Sampling) #> Chain 1: Iteration: 900 / 1000 [ 90%] (Sampling) #> Chain 1: Iteration: 1000 / 1000 [100%] (Sampling) #> Chain 1: #> Chain 1: Elapsed Time: 0 seconds (Warm-up) #> Chain 1: 0.010667 seconds (Sampling) #> Chain 1: 0.010667 seconds (Total) #> Chain 1: