makeDiscreteTransInteger: Builds matrix for transitions between discrete (e.g....

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Function that takes a data frame reflecting a population that includes continuous (e.g., size) and discrete (e.g., diapause) classes of individuals, and builds a transition matrix from this for movement between discrete and continuous stages (providing just a single value for the continuous stages; the detail of movement between continuous stages (e.g., sizes) is generated elsewhere). This object can then be used as an argument in the function to "makeIPMPmatrix" to build a P matrix that contains both discrete and continuous stages.

The dataframe must contain columns "stage" and "stageNext" with values of the names of the discrete classes and the name "continuous" where appropriate, in the current and subsequent time step. Continuous categories are also defined by their measurements, contained in "size" and "sizeNext". This is necessary for defining the mean and variance of the continuous stage of individuals emerging from discrete stages. Alternatively, you can enter the transition matrix for the discrete stages in the 'discreteTrans' argument.

Usage

1
2
3
4
5
6
7
makeDiscreteTransInteger(dataf, 
		stages = NA,
		discreteTrans = NA,
		meanToCont = NA,
		thetaToCont = NA,
		continuousToDiscreteExplanatoryVariables = "size",
		distToCont = "poisson")

Arguments

dataf

a dataframe with columns "stage", "stageNext" (both FACTORS (use as.factor) containing either names of discrete stages or "continuous" or "dead"), "size", "sizeNext", and "surv" (continuous and boolean variables respectively).

stages

a character vector with the names of the discrete classes. Normally this argument does not have to be used as the names of discrete classes are extracted from the data or entered discreteTrans matrix.

discreteTrans

a matrix with transition probabilities between the discrete and continuous stages. The column names should match the stage/stageNext names in the data file. The names discrete stages should be in alphabetical order, followed by 'continuous'. The row names should be the same, but with 'dead' added at the bottom. Thus, this matrix represents all the fates of individuals from the various classes.

meanToCont

a matrix containing the mean sizeNext values for individuals moving from discrete classes to the continuous classes (should contain NA when no individuals move from a particular discrete class to a continuous sizeNext). The column names should be equal (in alphabetical order) to the names of the discrete classes (so no continuous).

thetaToCont

a matrix containing the size parameter of sizeNext values for individuals moving from discrete classes to the continuous classes (should contain NA when no individuals move from a particular discrete class to a continuous sizeNext). The column names should be equal (in alphabetical order) to the names of the discrete classes (so no continuous).

continuousToDiscreteExplanatoryVariables

a character defining the relationship defining size influences the probability of individuals in the continuous class moving to any of the discrete classes. This argument is not relevant when individuals in the continuous stage cannot move into any discrete stage.

distToCont

character indicating the desired distribution of emergent sizes (poisson or negative binomial)

Details

See help for makeDiscreteTrans; this is exactly analagous, except that it uses the poisson or negative binomial as descriptors for sizes on emergence from discrete stages

Value

an object of class "discreteTransInteger" with columns corresponding to all the discrete and the one continuous stage.

Author(s)

C. Jessica E. Metcalf, Sean M. McMahon, Roberto Salguero-Gomez, Eelke Jongejans & Cory Merow.

References

Easterling, Ellner & Dixon. 2000. Size-specific sensitivity: a new structured population model. Ecology 81, p694-708.

Ellner & Rees. 2006. Integral projection models for species with complex demography. The American Naturalist 167, p410-428.

See Also

makeIPMPmatrix, makeDiscreteTrans

Examples

1
2
3
4
5
6
7
dff <- generateData(type="discrete")
dff$fec[dff$fec==0] <- NA
dff$size <- pmax(floor(dff$size+10),0)
dff$sizeNext <- pmax(floor(dff$sizeNext+10),0)
discTrans <- makeDiscreteTransInteger(dff)
makeIPMPmatrix(nBigMatrix = 10, growObj = makeGrowthObj(dff), 
	survObj = makeSurvObj(dff), discreteTrans = discTrans)

Example output

Loading required package: Matrix
Loading required package: MASS
Loading required package: nlme
An object of class "IPMmatrix"
               [,1]          [,2]          [,3]          [,4]          [,5]
 [1,]  6.324504e-05  7.349365e-12  4.193360e-24  1.295539e-41  2.898881e-64
 [2,]  1.669571e-02  2.160279e-02  1.372472e-07  4.721431e-18  1.176346e-33
 [3,]  5.007925e-10  7.215132e-03  5.104105e-01  1.955110e-04  5.423928e-13
 [4,]  1.706810e-27  2.738124e-13  2.156800e-04  9.199051e-01  2.841629e-02
 [5,]  6.609777e-55  1.180691e-33  1.035559e-17  4.918009e-07  1.691590e-01
 [6,]  2.908459e-92  5.784875e-64  5.649551e-41  2.987515e-23  1.144188e-10
 [7,] 1.454164e-139 3.220521e-104  3.502092e-74  2.062079e-49  8.793750e-30
 [8,] 8.261111e-197 2.037195e-154 2.466696e-117  1.617241e-85  7.679363e-59
 [9,] 5.332586e-264 1.464244e-214 1.974140e-170 1.441182e-131  7.619926e-98
[10,]  0.000000e+00 1.195828e-284 1.795208e-233 1.459275e-187 8.591137e-147
               [,6]          [,7]          [,8]          [,9]         [,10]
 [1,]  5.481644e-92 8.446475e-125 8.443887e-163 4.222510e-206 1.080844e-254
 [2,]  2.476834e-54  4.249552e-80 4.730332e-111 2.633913e-147 7.507150e-189
 [3,]  1.271620e-26  2.429323e-45  3.011031e-69  1.866838e-98 5.924637e-133
 [4,]  7.418095e-09  1.577981e-20  2.177776e-37  1.503440e-59  5.312792e-87
 [5,]  4.917018e-01  1.164642e-05  1.789722e-15  1.375752e-30  5.413253e-51
 [6,]  3.703272e-03  9.766926e-01  1.671216e-03  1.430436e-11  6.267123e-25
 [7,]  3.169157e-15  9.306741e-06  1.773184e-01  1.689940e-02  8.244277e-09
 [8,]  3.081601e-37  1.007655e-20  2.137713e-09  2.268550e-03  1.232285e-02
 [9,]  3.404736e-69  1.239654e-45  2.928327e-27  3.460191e-14  2.092881e-06
[10,] 4.274299e-111  1.732859e-80  4.557892e-55  5.996890e-35  4.038797e-20
Slot "nDiscrete":
[1] 0

Slot "nEnvClass":
[1] 1

Slot "nBigMatrix":
[1] 10

Slot "meshpoints":
 [1]  1.55  6.65 11.75 16.85 21.95 27.05 32.15 37.25 42.35 47.45

Slot "env.index":
 [1] 1 1 1 1 1 1 1 1 1 1

Slot "names.discrete":
[1] ""

IPMpack documentation built on May 2, 2019, 4:59 p.m.