Learn R Programming

IPMpack (version 1.6)

getIPMoutput: Gets IPM output from a list of P matrices (only survival and size information) or full IPMs (P matrices + F matrices; the latter include sexual reproduction information).

Description

Gets synthetic values including life expectancy, passage time, and, if a fecundity matrix is available, population growth rate (lambda), stable stage distribution, reproductive output, etc.

Usage

getIPMoutput(PmatrixList, targetSize = c(), FmatrixList = NULL)

Arguments

PmatrixList
List of survival-size (T) matrices for which summary statistics desired.
targetSize
Target size for passage time. If none is provided defaults to the median of the IPM meshpoints.
FmatrixList
List of fecundity (F) matrices corresponding to the list of P matrices, facultative. When this information is included, population growth rate (lambda), and stable stage distribution will also be provided.

Value

  • LEmatrix of life expectancies, columns correspond to meshpoints, rows corresponding to each element of the list of P matrices
  • pTimematrix of passage times to the targetSize from each of the meshpoints (columns) and for each element in the P matrix list (columns).
  • lambdavector of population growth rates corresponding to value obtained combining each element of the list of P matrices with the corresponding element in the list of F matrices; if no F matrix list is provided, it returns a vector of NAs.
  • stableStagematrix of stable stage distributions rows corresponding to values obtained. combining each element of the list of Pmatrices with the corresponding element in the list of Fmatrices; if no Fmatrix list is provided, this is a matrix of NAs.

References

Zuidema, Jongejans, Chien, During & Schieving. Integral projection models for trees: a new parameterization method and a validation of model output. Journal of Ecology 98, p345-355.

See Also

getIPMoutputDirect

Examples

Run this code
dff <- generateData()

# Use package MCMCglmm to get Bayesian posteriors 
# NOT RUN ##
#svlist <- makePostSurvivalObjs(dataf = dff, explanatoryVariables = "size",
#meanB = rep(0, 3), varB = rep(1e+10), nitt = 5000)
#grlist <- makePostGrowthObjs(dataf = dff,  explanatoryVariables = "size",nitt = 5000)
#fvlist <- makePostFecObjs(dataf = dff, explanatoryVariables = "size",nitt = 5000)

# Use only first 10 of each list, for speed:
#Tlist <- makeListPmatrix(growObjList = grlist[1:10], survObjList = svlist[1:10], 
#nBigMatrix = 20, minSize = -5, maxSize = 20, cov = FALSE, envMat = NULL)
#Flist <- makeListFmatrix(fecObjList = fvlist[1:10], nBigMatrix = 20, minSize = -5, 
#maxSize = 20, cov = FALSE, envMat = NULL)
#res <- getIPMoutput(PmatrixList = Tlist, targetSize = 10, FmatrixList = Flist)
#names(res)

# Plot out with different colours for different rows:
#par(mfrow=c(2,2),bty="l",pty="s")
#plot(Tlist[[1]]@meshpoints,res$LE[1, ],xlab="Continuous (e.g. size) stage", 
#ylab="Life expectancy", type="l", 
#	ylim=range(res$LE,na.rm=TRUE))
#for (j in 1:nrow(res$LE)) points(Tlist[[1]]@meshpoints,res$LE[j,],col=j, type="l")

#plot(Tlist[[1]]@meshpoints,res$pTime[1, ], xlab = "Continuous (e.g. size) stage", 
#ylab = "Passage time", type = "l", ylim = range(res$pTime, na.rm=TRUE))
#for (j in 1:nrow(res$pTime)) points(Tlist[[1]]@meshpoints, res$pTime[j, ], col = j, 
#type = "l")

#plot(Tlist[[1]]@meshpoints, Re(res$stableStage[1, ]), xlab = "Continuous (e.g. size) stage", 
#	ylab = "Stable stage distribution", type = "l", 
#	ylim = range(Re(res$stableStage), na.rm=TRUE))
#for (j in 1:nrow(res$stableStage)) points(Tlist[[1]]@meshpoints, 
#	Re(res$stableStage[j, ]),col = j, type = "l")

#hist(res$lambda, xlab = expression(lambda), ylab = "", main = "", col = "grey")

Run the code above in your browser using DataLab