Skip to content

atyre2/raretrans

Repository files navigation

raretrans

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status AppVeyor Build Status codecov CRAN_Status_Badge

Functions to create matrix population models from a combination of data on stage/age transitions and Bayesian prior information. This compensates for structural problems caused by missing observatons of rare transitions.

Installation

raretrans is not currently available from CRAN, but you can install from github.

Code and data used to produce Raymond L. Tremblay, Andrew J. Tyre , Maria-Eglée Pérez, James D. Ackerman (in review) Population projections from holey matrices: Using prior information to estimate rare transition events is tagged v1.0.0, so:

# install.packages("devtools") # if needed
devtools::install_github("atyre2/[email protected]")

Alternatively, download a package archive file from the release page.

Get the development version from github with:

# install.packages("devtools")
devtools::install_github("atyre2/raretrans")

If you want the vignettes, you have to add some additional arguments.

devtools::install_github("atyre2/raretrans", build = TRUE, build_opts = c("--no-resave-data", "--no-manual"))

Overview

There are two main functions in this package, fill_transitions() and fill_fertility(). Both of them take a list of two matrices as their first argument, the population projection matrix decomposed into a matrix of the probability of transitions between stages, and a matrix describing the contribution to the next census via reproduction. These matrices can be constructed by hand, or created with popbio::projection_matrix(..., TF = TRUE) from a data frame with transitions between stages for individuals. By default, they return a matrix ‘filled in’ with uninformative or uniform priors. Informative priors can be specified as well.

For detailed examples of using these functions with a single population see the vignette Working with a single population and transition. The vignette Effect of prior information on transition probabilities and fertilities shows how to work with a dataset of many populations and transitions, and produces all the figures for Tremblay et al. (submitted).

For an overview of population projection models generally, see Hal Caswell, 2001, Matrix Population Models: Construction, Analysis, and Interpretation.

Code of Conduct

Please note that the ‘raretrans’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.