[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"RrDOfl5bm9":3},"# forestIPM\n\n[![R-CMD-check](https://github.com/willvieira/forestIPM/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/willvieira/forestIPM/actions/workflows/R-CMD-check.yaml)\n[![codecov](https://codecov.io/github/willvieira/forestIPM/graph/badge.svg)](https://app.codecov.io/github/willvieira/forestIPM)\n[![Lean proofs](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/willvieira/forestIPM/master/lean/proof-status.json)](https://github.com/willvieira/forestIPM/tree/master/lean)\n\n`{forestIPM}` is an R package implementing a Bayesian hierarchical Integral Projection Model (IPM) designed to study tree population dynamics in eastern North America.\nIt combines growth, survival, and recruitment models, each parameterized as a function of climate and competition using forest inventory data.\nThe package provides two engines to compute population growth rates ($\\lambda$) for 31 tree species and to simulate plot-level community dynamics over time.\n\nThis framework enables users to explore how demographic processes scale up to community patterns.\nMore broadly, `{forestIPM}` can be used to investigate the effects of climate warming on tree performance, evaluate the sensitivity of $\\lambda$ to climate and competition ([📄](https://willvieira.github.io/ms_forest-ipm-sensitivity/)), examine how stochastic $\\lambda$ influences species range limits ([📄](https://willvieira.github.io/ms_forest-suitable-probability/)), provides a foundation for studying the mechanisms driving species coexistence, and many more.\n\n## Documentation\n\nA complete description of the methodology, ranging from fitting hierarchical Bayesian demographic models to constructing the IPM and applying it to ecological questions, is available in the companion book:\n\n📓 **[Forest Demography IPM Book](https://willvieira.github.io/book_forest-demography-IPM/)**\n\n## Basic usage\n\nThe package website provides the [function reference](https://willvieira.github.io/forestIPM/reference/index.html).\nThe workflow is structured around 5 constructor functions used to define the key components of the model:\n\n- `stand()` representing a forest plot\n- `species_model()` defining which species to model\n- `env_condition()` specifying climate drivers\n- `parameters()` defining a single reproducible parameter realization from Bayesian posteriors\n- `control()` Configure IPM projection settings\n\nThese components are then passed to two main IPM engines:\n\n- `lambda()` computing population growth rate (lambda) per species\n- `project()` projecting population or community dynamics through time\n\nFor a step-by-step introduction to the package, see the [Get Started](https://willvieira.github.io/book_forest-demography-IPM/guide_IPM.html) vignette in the IPM Book.\n\n## Installation\n\n```r\n# install.packages(\"devtools\")\ndevtools::install_github(\"willvieira/forestIPM\")\n```\n\n\u003C!-- lean-proofs-start -->\n## Mathematical Specification (Lean 4)\n\nThe mathematical model underlying `{forestIPM}` has been formally verified using\n[Lean 4](https://lean-lang.org/) and [Mathlib](https://leanprover-community.github.io/mathlib4_docs/).\nEach component of the model pipeline has a corresponding Lean module that proves key mathematical properties — such as convergence, non-negativity, and boundedness — hold by construction, independent of any numerical implementation.\n\nThese are not tests of the R code; they are machine-checked proofs that the *mathematical model* is internally consistent. The source files live in [`lean/`](lean/).\n\n| Component | Module | Theorems | Proved | Sorry | Status |\n|-----------|--------|----------|--------|-------|--------|\n| Demographic models | Growth             |        4 |      4 |     0 | fully proved   |\n|                    | Survival           |        4 |      4 |     0 | fully proved   |\n|                    | Ingrowth           |        9 |      8 |     1 | 1 open         |\n| Covariates         | Competition        |        5 |      5 |     0 | fully proved   |\n|                    | Climate            |        7 |      7 |     0 | fully proved   |\n| Population model   | MidpointRule       |        4 |      4 |     0 | fully proved   |\n|                    | GaussLegendre      |        4 |      2 |     2 | 2 open         |\n|                    | Kernel             |        6 |      5 |     1 | 1 open         |\n| Engines            | AsymptoticLambda   |        6 |      1 |     5 | 5 open         |\n|                    | CommunityDynamic   |        7 |      6 |     1 | 1 open         |\n|                    | **Total**          |       56 |     46 |    10 |                |\n\n> Table auto-generated by [lean/proof_status.sh](lean/proof_status.sh). \"Sorry\" indicates theorems stated but not yet proved (open proof obligations).\n\u003C!-- lean-proofs-end -->\n\n## Citation\n\nIf you use this package in your research, please cite the associated [article](https://willvieira.github.io/ms_forest-ipm-sensitivity/).\n",1780113394807]