Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stock-and-flow Modelling with R

License

NotificationsYou must be signed in to change notification settings

KCEvers/sdbuildR

Repository files navigation

R-CMD-checkCodecov test coverageCRAN status

Model systems as stock-and-flow models in R. Stock-and-flow models arefoundational to system dynamics, and help to understand systemscomplicated by nonlinearities, delays, and feedback loops. sdbuildR aimsto make stock-and-flow modeling accessible and effortless, enabling youto dedicate your expertise to what matters most: building insightful,high-quality models. Get started athttps://kcevers.github.io/sdbuildR/!

Features

  • Accessibility: Get started with stock-and-flow models with limitedknowledge.
  • Flexibility: Modify your models easily and robustly.
  • Insight Maker integration: Import models fromInsightMaker.
  • Julia backend: Use Julia for high-performance simulations, withoutany knowledge of Julia.
  • Unit support: Use standard or custom units to verify and interpretyour model.

All package capabilities are described in the vignettes:

  • Build: Learnhow to build, modify, and debug stock-and-flow models.
  • Juliasetup:Install and set up the Julia environment for running ensemblesimulations and using units.
  • Ensemble:Learn how to assess a model’s sensitivity, uncertainty and robustnesswith ensemble simulations.
  • Units: Learnwhy and how to use (custom) units.

Installation

The release version can be installed from CRAN:

install.packages("sdbuildR")

The development version can be installed from GitHub:

if (!require("remotes")) install.packages("remotes")remotes::install_github("KCEvers/sdbuildR")

sdbuildR offers two simulation engines: R and Julia (supported byJuliaConnectoR). Ifyou would like to run ensemble simulations and use units, you will needto install and set up the Julia environment. Seethisvignettefor guidance.

Citation

To cite sdbuildR, please use:

citation("sdbuildR")#> To cite package 'sdbuildR' in publications use:#>#>   Evers K (2025). _sdbuildR: Easily Build, Simulate, and Visualise#>   Stock-and-Flow Models_. R package version 1.0.7.9000,#>   https://github.com/KCEvers/sdbuildR,#>   <https://kcevers.github.io/sdbuildR/>.#>#> A BibTeX entry for LaTeX users is#>#>   @Manual{,#>     title = {sdbuildR: Easily Build, Simulate, and Visualise Stock-and-Flow Models},#>     author = {Kyra Caitlin Evers},#>     year = {2025},#>     note = {R package version 1.0.7.9000, https://github.com/KCEvers/sdbuildR},#>     url = {https://kcevers.github.io/sdbuildR/},#>   }

Limitations

  • Unlike in other system dynamics software, sdbuildR provides onlyminimal support for non-negative stocks and flows. Specifically,setting stocks to non-negative will constrain the stocks to remainnon-negative, but will not adjust the corresponding flows. In anycase, enforcing either stocks or flows to be non-negative is notrecommended, as it may mask model misspecification. Stocks and flowsthat logically cannot be negative (e.g., animals or deaths) shouldideally remain non-negative as a result of the model’s equations andparameters, rather than by forcing them to be non-negative.

  • sdbuildR does not support vectorized operations, destructuringassignment, or minimum and maximum constraints for variables.

  • sdbuildR does not support the Insight Maker functions Stop(),Prompt(), Confirm(), Pause(), Fix(), Map(), Filter(), and Repeat(),nor the delay and past functions. A message is issued if any of theseare detected.

Other system dynamics software

sdbuildR is heavily based on common system dynamics software such asVensim,Powersim,Stella, andInsightMaker. To translate xmile models to R, seethe R packagereadsdr. Tobuild stock-and-flow models with the R packagedeSolve, the bookSystemDynamics Modeling withR by JimDuggan will prove useful. In Python, stock-and-flow models are supportedbyPySD.

Troubleshooting

sdbuildR is under active development. While thoroughly tested, thepackage may have bugs, particularly in complex model translations. Weencourage users to reportissues onGitHub - your input helpsthe package improve! Usedebugger() to diagnose model errors, and usethe vignettes for guidance.

About

Stock-and-flow Modelling with R

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp