Learn R Programming

popbio (version 2.8)

projection.matrix: Construct projection matrix models using transition frequency tables

Description

Construct an age or stage-structure projection model from a transition table listing stage in time t, fate in time t+1, and one or more individual fertility columns.

Usage

projection.matrix(
  transitions,
  stage = NULL,
  fate = NULL,
  fertility = NULL,
  sort = NULL,
  add = NULL,
  TF = FALSE
)

Value

The default output is a single projection matrix A. If the TF flag is true, then a list with 2 items where A=T+F

Arguments

transitions

a stage-fate data frame with stage or age class in the current census, fate in the subsequent census, and one or more fertility columns

stage

a column name or position of the stage column in the stage-fate data frame. Defaults to "stage".

fate

name of the fate column in the stage-fate data frame. Defaults to "fate"

fertility

one or more names of fertility columns in the stage-fate data frame. By default, any column names matching stage class names are assumed to contain individual fertilities

sort

a vector listing stage classes that correspond to the rows and columns of the desired projection matrix. Currently, names in this vector must match a level in the stage column. Also, this option should only be used if stages are not ordered, since the default is to sort by levels in the stage column.

add

a vector listing row, column and value, used to add estimated transtions to the transition matrix (e.g., a transition from seed bank to seedling). May be repeated.

TF

output separate transition (T) and fertility (F) matrices. Default is FALSE and outputs a single projection matrix A

Author

Chris Stubben

Details

The state transition rates are estimated using transition frequency tables (see section 6.1.1, Caswell 2001), so this technique will most likely apply to demographic studies of plants or other sessile organisms where individuals are tagged and then consistently relocated in annual censuses. The fertility rates are calculated by averaging individuals fertilities by stage class; therefore, some care should be taken to correctly estimate individual fertilities based on the timing of the census.

Examples

Run this code
trans01 <- subset(merge(test.census, test.census, by = "plant", sort =FALSE),
                    year.x==2001 & year.y==2002 )
## Add individual fertilities using "anonymous reproduction"  based on the
## proportional reproductive outputs of flowering plants and the total number
## of seedlings at the end of the projection interval
trans01$seedferts <- trans01$fruits.x/sum(trans01$fruits.x) * 5
trans01
stages <- c("seedling", "vegetative", "reproductive")
## three ways to specify columns
projection.matrix(trans01, stage.x, stage.y, seedferts, stages)
projection.matrix(trans01, 3, 6, 8, c(3,4,2))
projection.matrix(trans01, "stage.x", "stage.y", "seedferts", stages)
## BEST to use column default (fertility column (seedling) now matches stage class name)
names(trans01)[c(3, 6, 8)] <- c("stage", "fate", "seedling")
# AND order stages in dataframe
trans01$stage <- ordered(trans01$stage, stages)
projection.matrix(trans01)
projection.matrix(trans01, TF=TRUE)
## Example using Aquilegia data
sf <- subset(aq.trans, year==1998 & plot==909, c(year, plant, stage, fruits, fate))
## rows and columns of final matrix
levels(sf$stage)
## seedlings next year
seedlings <- nrow(subset(aq.trans, plot==909 & year==1999 & stage=="recruit"))
## ADD individual fertility estimates for recruits and seeds assuming seed bank and
## new seeds contribute to a common germinant pool with equal chance of recruitment
seed.survival <- .4
seed.bank.size <- 1000
seeds.per.fruit <- 50
seeds.from.plants <- sum(sf$fruits)*seeds.per.fruit
recruitment.rate <- seedlings/(seed.bank.size + seeds.from.plants)
## add two fertility columns
sf$recruit <- sf$fruits/sum(sf$fruits) * seeds.from.plants * recruitment.rate
sf$seed <- sf$fruits * seeds.per.fruit * seed.survival
## add seed bank survival and seed bank recruitment rate to transition matrix
A <- projection.matrix(sf, add=c(1,1, seed.survival, 2,1, recruitment.rate ))
A
max(Re(eigen(A)$values))

Run the code above in your browser using DataLab