Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/IPMpack-Matrices.R
Uses growth, survival, discreteTrans, and environmental transition objects to construct a matrix defining probabilities for transitions between continuous stages (e.g. size) due to growth and survival given both size and environmental state and discrete stages. NOTE - old createCompoundPmatrix is being deprecated; use makeCompoundPmatrix instead.
1 2 3 | makeCompoundPmatrix(nEnvClass = 2, nBigMatrix = 50,
minSize = -1, maxSize = 50, envMatrix, growObj, survObj,
discreteTrans = 1, integrateType = "midpoint",correction = "none")
|
nEnvClass |
numeric, number of environmental classes, defaults to 2. |
nBigMatrix |
numeric, number of size bins in the P matrix, defaults to 50. |
minSize |
numeric, minimum size of the P matrix, defaults to -1. |
maxSize |
numeric, maximum size of the P matrix, defaults to 50. |
envMatrix |
envMatrix object defining transitions between environmental states for each size. |
growObj |
growth object. |
survObj |
survival object. |
discreteTrans |
object of class discreteTrans, or numeric. |
integrateType |
integration type, defaults to "midpoint" (which uses probability density function); other option is "cumul" (which uses the cumulative density function). |
correction |
correction type, defaults to |
This structure can also be used to define size x age IPMs, where the transition between ages is reflected by a similar matrix.
an object of class IPMmatrix with dimensions nBigMatrix * nEnvClass, or if discrete transitions exist (nBigMatrix + nDisc) * nEnvClass
C. Jessica E. Metcalf, Sean M. McMahon, Roberto Salguero-Gomez, Eelke Jongejans & Cory Merow.
For information on P matrix: Caswell. 2001. Matrix population models: construction, analysis, and interpretation. 2nd ed. Sinauer. p110-112.
For habitat x stage modeling: Tuljapurkar, Horvitz & Pascarella. 2003. The many growth rates and elasticities of populations in random environments. American Naturalist 162: p489-502.
Pascarella & Horvitz. 1998. Hurricane disturbance and the population dynamics of a tropical understory shrub: megamatrix elasticity analysis. Ecology 79: p547-563.
Horvitz & Schemske. 1986. Seed dispersal and environmental heterogeneity in a neotropical herb: A model of population and patch dynamics. In Symposium on frugivores and seed dispersal . (Estrada & Fleming, eds.) Dr. W. Junk Publishers, Dordrecht, Netherlands. pp. 169-186.
For age x size modeling: Garcia, Dahlgren and Ehrlen. 2011. No evidence of senescence in a 300-year-old mountain herb. Journal of Ecology 99, p1424-1430.
For general information:
Easterling, Ellner and Dixon. 2000. Size-specific sensitivity: a new structured population model. Ecology 81, p694-708.
Ellner and Rees. 2006. Integral projection models for species with complex demography. The American Naturalist 167, p410-428.
makeCompoundFmatrix
,makeIPMPmatrix
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 | # Data with only continuous stage and two habitats
dff <- generateData()
Pmatrix <- makeCompoundPmatrix(minSize = min(dff$size,na.rm = TRUE),
maxSize = max(dff$size,na.rm = TRUE), envMatrix = makeEnvObj(dff),
growObj = makeGrowthObj(dff, Formula = sizeNext~size+size2+covariate),
survObj = makeSurvObj(dff, Formula = surv~size+size2+covariate))
image(1:nrow(Pmatrix), 1:ncol(Pmatrix), t(log(Pmatrix)),
xlab = "Continuous stage (e.g. size) at t",
ylab = "Continuous stage (e.g. size) at t+1", axes = FALSE)
axis(1, at = 1:nrow(Pmatrix), lab = round(rep(Pmatrix@meshpoints,
Pmatrix@nEnvClass), 2))
axis(2, at = 1:nrow(Pmatrix), lab = round(rep(Pmatrix@meshpoints,
Pmatrix@nEnvClass), 2))
abline(h = length(Pmatrix@meshpoints) * (1:Pmatrix@nEnvClass))
abline(v = length(Pmatrix@meshpoints) * (1:Pmatrix@nEnvClass))
# Data with continuous and discrete stages
dff <- generateData(type="discrete")
dff$covariate <- sample(1:3, size = nrow(dff), replace = TRUE)
dff$covariateNext <- sample(1:3, size = nrow(dff), replace = TRUE)
discM <- makeDiscreteTrans(dff)
Pmatrix <- makeCompoundPmatrix(minSize = min(dff$size, na.rm = TRUE),
maxSize = max(dff$size, na.rm = TRUE), envMatrix = makeEnvObj(dff),
growObj = makeGrowthObj(dff, Formula = sizeNext~size+size2+covariate),
survObj = makeSurvObj(dff, Formula = surv~size+size2+covariate),
discreteTrans = discM)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.