Skip to content

A tutorial accompanying the publication: B. Rosenbaum, E.A. Fronhofer 2023. Confronting population models with experimental microcosm data: from trajectory matching to state-space models

License

Notifications You must be signed in to change notification settings

benjamin-rosenbaum/fitting_deterministic_population_models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tutorial: Fitting deterministic population models in R using RStan

A tutorial accompanying the publication:

B. Rosenbaum, E.A. Fronhofer. 2023. Confronting population models with experimental microcosm data: from trajectory matching to state-space models. Ecosphere 14(4): e4503. https://doi.org/10.1002/ecs2.4503

For questions, contact benjamin.rosenbaum@idiv.de

Update 01/2024

Raw R-code is now available in a seperate folder.

I updated deprecated Stan code, concerning arrays and the ODE-solver function.

While I wrote R code using the popular RStan package, I strongly recommend using the CmdStanR package instead. This increases performance and I observed model fitting is three times faster. While the Stan model code is identical, R functions for compiling, fitting and analyzing the model are slightly different. An example is now given below.

Single-species system

Logistic growth - OBS model

Logistic growth - PROC model

Logistic growth - State-space model

Two-species system

Consumer resource - OBS model

Consumer resource - PROC model

Consumer resource - State-space model

CmdStanR

Logistic growth - OBS model cmdstanr

About

A tutorial accompanying the publication: B. Rosenbaum, E.A. Fronhofer 2023. Confronting population models with experimental microcosm data: from trajectory matching to state-space models

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages