-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
78 lines (58 loc) · 3.68 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# raretrans
[![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)
[![Build Status](https://travis-ci.com/atyre2/raretrans.svg?token=fZ6v1nEUhWRrRW3uj9TH&branch=master)](https://travis-ci.com/atyre2/raretrans)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/atyre2/raretrans?branch=master&svg=true)](https://ci.appveyor.com/project/atyre2/raretrans)
[![codecov](https://codecov.io/gh/atyre2/raretrans/branch/master/graph/badge.svg?token=NWFl8m4owW)](https://codecov.io/gh/atyre2/raretrans)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/raretrans)](https://cran.r-project.org/package=raretrans)
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:
```{r, eval = FALSE}
# install.packages("devtools") # if needed
devtools::install_github("atyre2/raretrans@v1.0.0")
```
Alternatively, [download a package archive file from the release page](https://github.com/atyre2/raretrans/releases).
Get the development version from github with:
```{r, eval = FALSE}
# install.packages("devtools")
devtools::install_github("atyre2/raretrans")
```
If you want the vignettes, you have to add some additional arguments.
```{r, eval = FALSE}
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](https://atyre2.github.io/raretrans/articles/onepopperiod.html).
The vignette [Effect of prior information on transition probabilities and fertilities](https://atyre2.github.io/raretrans/articles/transition_priors.html)
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](https://books.google.com/books/about/Matrix_Population_Models.html?id=CPsTAQAAIAAJ).
## Code of Conduct
Please note that the 'raretrans' project is released with a
[Contributor Code of Conduct](CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.