poems

Pattern-oriented ensemble modelling and simulation (with spatially explicit populations)

https://github.com/globalecologylab/poems

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    2 of 7 committers (28.6%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (20.9%) to scientific vocabulary

Keywords

biogeography population-model process-based r r-package rstats
Last synced: 6 months ago · JSON representation

Repository

Pattern-oriented ensemble modelling and simulation (with spatially explicit populations)

Basic Info
Statistics
  • Stars: 10
  • Watchers: 6
  • Forks: 2
  • Open Issues: 1
  • Releases: 15
Topics
biogeography population-model process-based r r-package rstats
Created about 5 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog Contributing Codemeta

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# poems: Pattern-oriented ensemble modeling system (for spatially explicit populations) 


[![Paper_doi](https://img.shields.io/badge/doi-10.1111/2041--210X.13720-orange.svg)](https://doi.org/10.1111/2041-210X.13720)
[![CRAN_version](https://www.r-pkg.org/badges/version/poems)](https://cran.r-project.org/package=poems)
[![Codecov test coverage](https://codecov.io/gh/GlobalEcologyLab/poems/branch/main/graph/badge.svg)](https://app.codecov.io/gh/GlobalEcologyLab/poems?branch=main)
[![Last commit](https://img.shields.io/github/last-commit/GlobalEcologyLab/poems.svg)](https://github.com/GlobalEcologyLab/poems/commits/main)
[![R-CMD-check](https://github.com/GlobalEcologyLab/poems/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/GlobalEcologyLab/poems/actions/workflows/R-CMD-check.yaml)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)


The poems package provides a framework of interoperable *R6* (Chang, 2020) classes
for building ensembles of viable models via the pattern-oriented modeling (POM)
approach (Grimm et al., 2005). Pattern-oriented modeling is a vigorous form of 
statistical validation in which simulations and their parameter settings are
summarized using key metrics and converged toward multiple observed patterns,
or targets.

The package provides a process-based population model related to the 
functionality of RAMAS or Vortex, but in a free and open source 
format, with high customizability. The package includes classes for encapsulating and 
generating model parameters, and managing the POM workflow. The workflow includes:

1. Model setup including generated spatial layers and demographic population 
   model parameters.
1. Generating model parameters via Latin hypercube sampling (Iman & Conover, 1980).
1. Running multiple sampled model simulations.
1. Collating summary results metrics via user-defined functions.
1. Validating and selecting an ensemble of models that best match known patterns.

By default, model validation and selection utilizes an approximate Bayesian computation 
(ABC) approach (Beaumont et al., 2002) using the *abc* package (Csillery et al., 2015). 
However, alternative user-defined functionality could be employed. 

The package includes a spatially explicit demographic population model simulation
engine, which incorporates default functionality for density dependence, correlated 
environmental stochasticity, stage-based transitions, and distance-based dispersal. 
The user may customize the simulator by defining functionality for translocations, 
harvesting, mortality, and other processes, as well as defining the sequence order 
for the simulator processes. The framework could also be adapted for use with other 
model simulators by utilizing its extendable (inheritable) base classes.

## Installation

You can install poems from the CRAN repository:

``` r
install.packages("poems")
```

Or you can install the development version of poems from [GitHub](https://github.com/) using:

``` r
# install.packages("devtools")
remotes::install_github("GlobalEcologyLab/poems")
```

## The poemsverse

`poems` can do spatial population models on its own, but it also provides the engine behind two extension packages: [paleopop](https://github.com/GlobalEcologyLab/paleopop) and [epizootic](https://github.com/viralemergence/epizootic). `paleopop` is an extension for simulating populations over very long timescales, and `epizootic` is an extension for simulating disease dynamics in wild populations.

## Example

The following simple example demonstrates how to run a single spatially explicit 
demographic population model using *poems*:

```{r example, message = FALSE, fig.align = "center"}
library(poems)

# Demonstration example region (U Island) and initial abundance
coordinates <- data.frame(
  x = rep(seq(177.01, 177.05, 0.01), 5),
  y = rep(seq(-18.01, -18.05, -0.01), each = 5)
)
template_raster <- Region$new(coordinates = coordinates)$region_raster # full extent
template_raster[][-c(7, 9, 12, 14, 17:19)] <- NA # make U Island
region <- Region$new(template_raster = template_raster)
initial_abundance <- seq(0, 300, 50)
raster::plot(region$raster_from_values(initial_abundance),
  main = "Initial abundance", xlab = "Longitude (degrees)",
  ylab = "Latitude (degrees)", zlim = c(0, 300), colNA = "blue"
)

# Set population model
pop_model <- PopulationModel$new(
  region = region,
  time_steps = 5,
  populations = 7,
  initial_abundance = initial_abundance,
  stage_matrix = matrix(c(
    0, 2.5, # Leslie/Lefkovitch matrix
    0.8, 0.5
  ), nrow = 2, ncol = 2, byrow = TRUE),
  carrying_capacity = rep(200, 7),
  density_dependence = "logistic",
  dispersal = (!diag(nrow = 7, ncol = 7)) * 0.05,
  result_stages = c(1, 2)
)

# Run single simulation
results <- population_simulator(pop_model)
results # examine
raster::plot(region$raster_from_values(results$abundance[, 5]),
  main = "Final abundance", xlab = "Longitude (degrees)",
  ylab = "Latitude (degrees)", zlim = c(0, 300), colNA = "blue"
)
```

Further examples utilizing the POM workflow and more advanced features of *poems*
can be found in the accompanying vignettes.

## Citation

You may cite poems in publications using our software paper in *Methods in Ecology and Evolution*:

Fordham, D. A., Haythorne, S., Brown, S. C., Buettel, J. C., & Brook, B. W. (2021). poems: R package for simulating species' range dynamics using pattern‐oriented validation. *Methods in Ecology and Evolution*, *12*(12), 2364-2371.

## References

Beaumont, M. A., Zhang, W., & Balding, D. J. (2002). 'Approximate Bayesian computation
in population genetics'. *Genetics*, vol. 162, no. 4, pp, 2025–2035.


Chang, W. (2020). 'R6: Encapsulated Classes with Reference Semantics'. *R package version 2.5.0*. 
Retrieved from  

Csillery, K., Lemaire L., Francois O., & Blum M. (2015). 'abc: Tools for Approximate 
Bayesian Computation (ABC)'. *R package version 2.1*. Retrieved from 


Grimm, V., Revilla, E., Berger, U., Jeltsch, F., Mooij, W. M., Railsback, S. F.,
Thulke, H. H., Weiner, J., Wiegand, T., DeAngelis, D. L., (2005). 'Pattern-Oriented
Modeling of Agent-Based Complex Systems: Lessons from Ecology'. *Science*
vol. 310, no. 5750, pp. 987–991. 

Iman R. L., Conover W. J. (1980). 'Small sample sensitivity analysis techniques for computer 
models, with an application to risk assessment'. *Commun Stat Theor Methods* A9, pp. 1749–1842.


Owner

  • Name: GLOBAL CH.E.C
  • Login: GlobalEcologyLab
  • Kind: organization

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "identifier": "poems",
  "description": "A framework of interoperable R6 classes (Chang, 2020, <https://CRAN.R-project.org/package=R6>) for building ensembles of viable models via the pattern-oriented modeling (POM) approach (Grimm et al.,2005, <doi:10.1126/science.1116681>). The package includes classes for encapsulating and generating model parameters, and managing the POM workflow. The workflow includes: model setup; generating model parameters via Latin hyper-cube sampling (Iman & Conover, 1980, <doi:10.1080/03610928008827996>); running multiple sampled model simulations; collating summary results; and validating and selecting an ensemble of models that best match known patterns. By default, model validation and selection utilizes an approximate Bayesian computation (ABC) approach (Beaumont et al., 2002, <doi:10.1093/genetics/162.4.2025>), although alternative user-defined functionality could be employed. The package includes a spatially explicit demographic population model simulation engine, which incorporates default functionality for density dependence, correlated environmental stochasticity, stage-based transitions, and distance-based dispersal. The user may customize the simulator by defining functionality for translocations, harvesting, mortality, and other processes, as well as defining the sequence order for the simulator processes. The framework could also be adapted for use with other model simulators by utilizing its extendable (inheritable) base classes.",
  "name": "poems: Pattern-Oriented Ensemble Modeling System",
  "relatedLink": [
    "https://globalecologylab.github.io/poems/",
    "https://CRAN.R-project.org/package=poems"
  ],
  "codeRepository": "https://github.com/GlobalEcologyLab/poems",
  "issueTracker": "https://github.com/GlobalEcologyLab/poems/issues",
  "license": "https://spdx.org/licenses/GPL-3.0",
  "version": "1.3.3",
  "programmingLanguage": {
    "@type": "ComputerLanguage",
    "name": "R",
    "url": "https://r-project.org"
  },
  "runtimePlatform": "R version 4.5.0 (2025-04-11)",
  "provider": {
    "@id": "https://cran.r-project.org",
    "@type": "Organization",
    "name": "Comprehensive R Archive Network (CRAN)",
    "url": "https://cran.r-project.org"
  },
  "author": [
    {
      "@type": "Person",
      "givenName": "Sean",
      "familyName": "Haythorne",
      "email": "sean.haythorne@unimelb.edu.au"
    },
    {
      "@type": "Person",
      "givenName": "Damien",
      "familyName": "Fordham",
      "email": "damien.fordham@adelaide.edu.au"
    },
    {
      "@type": "Person",
      "givenName": "Stuart",
      "familyName": "Brown",
      "email": "stuart.brown@sa.gov.au",
      "@id": "https://orcid.org/0000-0002-0669-1418"
    },
    {
      "@type": "Person",
      "givenName": "Jessie",
      "familyName": "Buettel",
      "email": "jessie.buettel@utas.edu.au"
    },
    {
      "@type": "Person",
      "givenName": "Barry",
      "familyName": "Brook",
      "email": "barry.brook@utas.edu.au"
    },
    {
      "@type": "Person",
      "givenName": "July",
      "familyName": "Pilowsky",
      "email": "pilowskyj@caryinstitute.org",
      "@id": "https://orcid.org/0000-0002-6376-2585"
    }
  ],
  "maintainer": [
    {
      "@type": "Person",
      "givenName": "July",
      "familyName": "Pilowsky",
      "email": "pilowskyj@caryinstitute.org",
      "@id": "https://orcid.org/0000-0002-6376-2585"
    }
  ],
  "softwareSuggestions": [
    {
      "@type": "SoftwareApplication",
      "identifier": "knitr",
      "name": "knitr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=knitr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "rmarkdown",
      "name": "rmarkdown",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=rmarkdown"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "sf",
      "name": "sf",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=sf"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "scales",
      "name": "scales",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=scales"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "stringi",
      "name": "stringi",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=stringi"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "testthat",
      "name": "testthat",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=testthat"
    }
  ],
  "softwareRequirements": {
    "1": {
      "@type": "SoftwareApplication",
      "identifier": "R",
      "name": "R",
      "version": ">= 4.1.0"
    },
    "2": {
      "@type": "SoftwareApplication",
      "identifier": "abc",
      "name": "abc",
      "version": ">= 2.1",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=abc"
    },
    "3": {
      "@type": "SoftwareApplication",
      "identifier": "doParallel",
      "name": "doParallel",
      "version": ">= 1.0.16",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=doParallel"
    },
    "4": {
      "@type": "SoftwareApplication",
      "identifier": "foreach",
      "name": "foreach",
      "version": ">= 1.5.1",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=foreach"
    },
    "5": {
      "@type": "SoftwareApplication",
      "identifier": "fossil",
      "name": "fossil",
      "version": ">= 0.4.0",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=fossil"
    },
    "6": {
      "@type": "SoftwareApplication",
      "identifier": "lhs",
      "name": "lhs",
      "version": ">= 1.1.1",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=lhs"
    },
    "7": {
      "@type": "SoftwareApplication",
      "identifier": "metRology",
      "name": "metRology",
      "version": ">= 0.9.28.1",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=metRology"
    },
    "8": {
      "@type": "SoftwareApplication",
      "identifier": "R6",
      "name": "R6",
      "version": ">= 2.5.0",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=R6"
    },
    "9": {
      "@type": "SoftwareApplication",
      "identifier": "raster",
      "name": "raster",
      "version": ">= 3.6",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=raster"
    },
    "10": {
      "@type": "SoftwareApplication",
      "identifier": "trend",
      "name": "trend",
      "version": ">= 1.1.4",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=trend"
    },
    "11": {
      "@type": "SoftwareApplication",
      "identifier": "truncnorm",
      "name": "truncnorm",
      "version": ">= 1.0",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=truncnorm"
    },
    "12": {
      "@type": "SoftwareApplication",
      "identifier": "gdistance",
      "name": "gdistance",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=gdistance"
    },
    "13": {
      "@type": "SoftwareApplication",
      "identifier": "qs",
      "name": "qs",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=qs"
    },
    "SystemRequirements": null
  },
  "fileSize": "6407.82KB",
  "citation": [
    {
      "@type": "ScholarlyArticle",
      "datePublished": "2021",
      "author": [
        {
          "@type": "Person",
          "givenName": "Damien",
          "familyName": "Fordham"
        },
        {
          "@type": "Person",
          "givenName": "Sean",
          "familyName": "Haythorne"
        },
        {
          "@type": "Person",
          "givenName": "Stuart",
          "familyName": "Brown"
        },
        {
          "@type": "Person",
          "givenName": "Jessie",
          "familyName": "Buettel"
        },
        {
          "@type": "Person",
          "givenName": "Barry",
          "familyName": "Brook"
        }
      ],
      "name": "poems: R package for simulating species' range dynamics using pattern-oriented validation",
      "identifier": "10.1111/2041-210X.13720",
      "url": "https://besjournals.onlinelibrary.wiley.com/doi/abs/10.1111/2041-210X.13720",
      "pagination": "2364-2371",
      "@id": "https://doi.org/10.1111/2041-210X.13720",
      "sameAs": "https://doi.org/10.1111/2041-210X.13720",
      "isPartOf": {
        "@type": "PublicationIssue",
        "issueNumber": "12",
        "datePublished": "2021",
        "isPartOf": {
          "@type": [
            "PublicationVolume",
            "Periodical"
          ],
          "volumeNumber": "12",
          "name": "Methods in Ecology and Evolution"
        }
      }
    }
  ],
  "releaseNotes": "https://github.com/GlobalEcologyLab/poems/blob/master/NEWS.md",
  "readme": "https://github.com/GlobalEcologyLab/poems/blob/main/README.md",
  "contIntegration": [
    "https://app.codecov.io/gh/GlobalEcologyLab/poems?branch=main",
    "https://github.com/GlobalEcologyLab/poems/actions/workflows/R-CMD-check.yaml"
  ],
  "developmentStatus": "https://www.repostatus.org/#active",
  "keywords": [
    "biogeography",
    "population-model",
    "process-based",
    "r",
    "r-package",
    "rstats"
  ]
}

GitHub Events

Total
  • Push event: 18
Last Year
  • Push event: 18

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 114
  • Total Committers: 7
  • Avg Commits per committer: 16.286
  • Development Distribution Score (DDS): 0.404
Past Year
  • Commits: 27
  • Committers: 5
  • Avg Commits per committer: 5.4
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
Sean Haythorne s****e@a****u 68
seanhaythorne s****e@h****m 20
July Pilowsky j****o 19
Stuart Brown s****6@g****m 3
japilo j****o@g****m 2
ecanteri e****2@g****m 1
Stuart Brown s****n@a****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 2
  • Total pull requests: 3
  • Average time to close issues: about 1 year
  • Average time to close pull requests: 8 days
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 6.5
  • Average comments per pull request: 2.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • rsbivand (1)
  • scbrown86 (1)
Pull Request Authors
  • japilo (2)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 624 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 1
  • Total versions: 7
  • Total maintainers: 1
cran.r-project.org: poems

Pattern-Oriented Ensemble Modeling System

  • Versions: 7
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 624 Last month
Rankings
Forks count: 17.0%
Dependent packages count: 18.1%
Stargazers count: 18.3%
Dependent repos count: 23.9%
Average: 24.5%
Downloads: 45.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.6.0 depends
  • R6 >= 2.5.0 imports
  • abc >= 2.1 imports
  • doParallel >= 1.0.16 imports
  • foreach >= 1.5.1 imports
  • gdistance >= 1.3.6 imports
  • geosphere >= 1.5.10 imports
  • lhs >= 1.1.1 imports
  • metRology >= 0.9.28.1 imports
  • raster >= 3.4.5 imports
  • trend >= 1.1.4 imports
  • knitr * suggests
  • rmarkdown * suggests
  • testthat * suggests
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite