MyNixOS website logo
Description

Fitting Functional Responses in 1- and 2-Prey Systems.

Easy application of Bayesian inference for functional responses via 'brms'. This package allows to fit various FR models for single- and multi-prey experiments by providing nonlinear prediction functions for 'brms'. It uses dynamical prediction models to correct for prey depletion. The 'brms' framework facilitates statistical modeling and enables users to conveniently incorporate covariates such as temperature gradients, experimental treatment variables, or random effects that account for grouping in experimental units. Default 'brms' functions make it easy to perform model checking, model comparison and hypothesis testing. Potential statistical issues with data from feeding trials, such as overdispersion, can be resolved by effortlessly switching between likelihood functions. This package, together with its tutorials, should provide students and researchers with a comprehensive and integrated statistical framework for easily testing their hypotheses on trophic interactions. References: Rosenbaum and Rall (2018) <doi:10.1111/2041-210X.13039>; Rosenbaum et al. (2024) <doi:10.1111/2041-210X.14372>.

BayesFR package

DOI

Fitting functional responses in 1- and 2-prey systems

Easy application of Bayesian inference for functional responses via brms.

This package allows to fit various FR models for single- and multi-prey experiments by providing nonlinear prediction functions for brms. It uses dynamical prediction models to correct for prey depletion. The brms framework facilitates statistical modeling and enables users to conveniently incorporate covariates such as temperature gradients, experimental treatment variables, or random effects that account for grouping in experimental units. Default brms functions make it easy to perform model checking, model comparison and hypothesis testing. Potential statistical issues with data from feeding trials, such as overdispersion, can be resolved by effortlessly switching between likelihood functions.

The BayesFR package, together with its tutorials, provides students and researchers with a comprehensive and integrated statistical framework for easily testing their hypotheses on trophic interactions.

For an introduction to brms, see for example here.

Installation

library(remotes)
install_github("benjamin-rosenbaum/BayesFR")

Tutorials

  1. Minimal example: data with prey replacement
  2. Minimal example: data without prey replacement
  3. Model testing, model comparison, hypothesis testing: type 2 vs. type 3
  4. Categorical predictors: predator and prey size classes
  5. Continuous predictors: size and temperature gradients
  6. Random effects: individual- and population-level estimates
  7. Prey mortality
  8. Predator interference
  9. Likelihood functions and response distributions
  10. Prior distributions
  11. Multi-species functional responses

Example

# Example code for fitting a Type 3 FR dynamical model:
FR.formula = bf( NE | trials(N0) ~ Type3H_dyn(N0,P0,Time,b,h)/N0,
                 b~1, h~1, nl = TRUE)
FR.priors  = c(prior(exponential(1.0), nlpar="b", lb=0),
               prior(exponential(1.0), nlpar="h", lb=0) )
fit.1      = brm(FR.formula,
                 family   = binomial(link="identity"),
                 prior    = FR.priors,
                 stanvars = stanvar(scode=Type3H_dyn_code, block="functions"),
                 data     = df )

References

While a publication is in progress, please cite Rosenbaum & Rall (2018) for single-prey systems, or Rosenbaum et al. (2024) for multi-prey systems. The FoRAGE database (Uiterwaal et al. 2022) was searched for suitable example datasets, and data was downloaded from original sources when available.

Rosenbaum B. & Rall B. C. (2018). Fitting functional responses: Direct parameter estimation by simulating differential equations. Methods in Ecology and Evolution, 9(10), 2076–2090. https://doi.org/10.1111/2041-210X.13039

Rosenbaum B., Li J., Hirt M. R., Ryser R. & Brose, U. (2024). Towards understanding interactions in a complex world: Design and analysis of multi‐species functional response experiments. Methods in Ecology and Evolution, 15(9), 1704–1719. https://doi.org/10.1111/2041-210x.14372

Uiterwaal S. F., Lagerstrom I. T., Lyon S. R. & DeLong J. P. (2022). FoRAGE Database: A Compilation of Functional Responses for Consumers and Parasitoids. Ecology 103(7): e3706. https://doi.org/10.1002/ecy.3706

Metadata

Version

1.0.1

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows