mizer: Multi-Species Size Spectrum Modelling in R
Le résumé fourni par la source
Version 3.1.0 builds on 3.0.0 with an experimental second-order accurate numerical scheme in size, additional higher-order time-stepping options, and a range of smaller improvements and bug fixes. Unless you opt in to the experimental scheme, results are unchanged from 3.0.0. For an overview see the release announcement on the mizer blog. Experimental second-order in w accuracy mizer gains an optional, experimental second-order accurate finite-volume scheme in the size variable w. It is controlled by a new second_order_w slot and is switched off by default, so all default results are unchanged (the first-order path is byte-identical to previous mizer). Enabling it shifts size-integrated diagnostics and the resource spectrum by O(Δw) (more on coarse grids), so calibrated models may need recalibrating. See ?second_order_w and the "Numerical Details" vignette. The second_order_w slot is a named list with a character entry flux ("upwind", "van_leer" or "centred") selecting the advective reconstruction, and a logical entry bin_average selecting the bin-averaged rate quadratures. A fully second-order scheme needs both. Use the new second_order_w() / second_order_w<-() accessors to get and set them. The setter accepts a single logical, which sets both entries — flux = "van_leer" (a TVD reconstruction that keeps abundances non-negative) and bin_average = TRUE — or a named vector for individual control, e.g. second_order_w(params) <- c(flux = "centred") for the unlimited flux that is genuinely second order even at extrema. Setting it re-runs setParams() to rebuild the precomputed arrays. The default flux = "upwind", bin_average = FALSE is the original first-order upwind scheme. Old objects are upgraded automatically. newMultispeciesParams(), newTraitParams(), newCommunityParams() and newSingleSpeciesParams() gain a second_order_w argument (default FALSE, accepting the same values as the setter) that builds the new model with the scheme already selected. Under bin_average the resource and abundance power laws are constructed bin-averaged from the start; the construction-time steady-state solve always uses the robust upwind flux, and the chosen flux is activated only for the returned model. (#379) When bin_average is TRUE, every point-sampled power law and quadrature that feeds the finite-volume update is replaced by its exact bin average over each size bin (the bin straddling w_pp_cutoff receiving the partial average), so the sinks, sources and capacities are consistent with the bin-integrated encounter convolution (#374): the external mortality \eqn{z_{ext} w^d} (setExtMort()) and external diffusion \eqn{D_{ext} w^{n+1}} (setExtDiffusion()); the auto-calculated resource intrinsic growth \eqn{r_p w^{n-1}} and carrying capacity \eqn{\kappa w^{-\lambda}} (setResource(); user-supplied full vectors are left untouched), together with the matching initial resource abundance \eqn{\kappa w^{-\lambda}} used both for the initial spectrum and for the temporary prey spectra behind the default gamma/f0 and consumer abundances; the predation kernels, which are now predator- and prey-bin averaged (via trapezoid folds), so getEncounter(), getPredRate(), getPredMort(), getResourceMort() and getDiffusion() become second order with no change to the rate functions and no extra runtime cost. The predation-diffusion integral uses a dedicated Fourier kernel held in the new ft_pred_kernel_d slot, which carries the extra power of prey size (\eqn{w_p^2 dw_p}, the \eqn{\beta^{3s}} Jacobian) that the diffusion integrand needs; in the first-order scheme it equals ft_pred_kernel_e, so existing models are byte-identical. (#384) the gear selectivity (calc_selectivity()), so a knife-edge gear gets the exact fraction of the straddling bin above the knife edge and fishing mortality is second order; the per-capita reproductive investment \eqn{\psi(w) E_r(w)} in mizerRDI() (the full investment averaged together, not psi alone), making density-independent reproduction second order. The advective growth flux uses the chosen flux reconstruction ("van_leer" or "centred") for a second-order transport step. Combined with the bin-averaged diffusion from getDiffusion(), the full growth-transport step is second order. The diffusion coefficient is consumed from getDiffusion() directly rather than being re-averaged by the transport routine. Size-integrated and size-resolved diagnostics are placed and weighted consistently with the finite-volume scheme when bin_average is TRUE: the summary integrals getBiomass(), getSSB(), getYield(), getYieldGear(), getDiet() and getTrophicLevel() use the trapezoidal bin-average of the size weight (getN() is already exact); the size-resolved bin-average diagnostics — the mortalities getPredMort(), getFMort(), getMort(), getExtMort() and the reproductive investment getERepro() — are reported at the geometric bin centre \eqn{\sqrt{w_j w_{j+1}}}, the location where a bin average actually lives, while point-valued quantities (encounter, growth) stay on the grid nodes. The ArraySpeciesBySize / ArrayTimeBySpeciesBySize classes carry a representation tag ("point" / "average") recording this. (#382) the spectrum plots plotSpectra(), plotlySpectra(), plotSpectraRelative() and animateSpectra() evaluate both the w^power weight and the marker location at the geometric bin centre \eqn{w^* = w \sqrt{\beta}}, placing each marker as a point on the continuous N w^power curve instead of misplacing it at the bin edge (the error grows with power, worst for the common power = 2 Sheldon plot). (#383) Higher-order time-stepping project() gains a new time-stepping option method = "tr_bdf2". This is an L-stable, second-order TR-BDF2 scheme that retains the second-order accuracy of method = "predictor_corrector" while damping the oscillations the Crank-Nicolson corrector can show at large time steps. Like the other methods it only requires tridiagonal solves. See the "Numerical Details" vignette. Under the second-order methods ("predictor_corrector" and "tr_bdf2") the resource is now advanced with midpoint resource mortality rather than the start-of-step value, and the other components (set via setComponent()) now also receive a corrector step with the midpoint rates. So the resource and the other components are integrated to the same second-order accuracy in time as the consumer spectra. The "euler" method and the steady states are unchanged. Other improvements Extension packages can now upgrade their own data in saved model objects independently of the mizer version. The @extensions slot can record, for each extension, the version of the extension package that the object conforms to (write entries with the new recordExtension()). needs_upgrading() flags an object when an extension's recorded version is missing or older than the installed package version, and validParams() then calls the extension's own upgrade() method (an S3 method on utils::upgrade(), registered with @exportS3Method utils::upgrade). The core mizer upgrade is now itself the upgrade.MizerParams() / upgrade.MizerSim() method. See the "Upgrading objects across versions of your extension" section of vignette("creating-extension-packages"). getDiet() gains a MizerSim method and plotDiet() for a MizerSim now accepts a time_range argument, computing the diet from the simulated abundances at the requested times rather than always using the initial abundances. As for the other MizerSim plotting functions, time_range defaults to the final saved time step. When a range spanning several saved time steps is given, the consumption rates are averaged over the range and then normalised to proportions (rather than averaging the per-step proportions, which are normalised independently). (#357) New getFluxGradient() function returns the flux divergence \eqn{(J_{j+1} - J_j)/\Delta w_j} that appears as the transport term in the discretised size-spectrum equation. The bin-boundary fluxes are obtained from getFlux(), so the advective-flux scheme stor
Ce résumé expose les affirmations des auteurs. BNTIC ne l’interprète pas comme une validation indépendante des résultats.