Learn R Programming

IPMpack (version 1.6)

makeListPmatrix: Builds list of P matrices from list growth and survival objects.

Description

Uses posteriors (or other) lists of growth and survival objects to create a list of P matrices.

Usage

makeListPmatrix(growObjList, survObjList, nBigMatrix, 
	minSize, maxSize, cov = FALSE, envMat = NULL, integrateType = "midpoint",
		correction = "none")

Arguments

growObjList
list of growth objects.
survObjList
list of survival objects.
nBigMatrix
number of meshpoints.
minSize
minimum size.
maxSize
maximum size.
cov
level of the covariate.
envMat
environmental matrix - defaults to NULL.
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 "none"; option is "constant" which will multiply every column of the IPM by a constant sufficient to adjust values to those predicted for survival at that size.

See Also

makeListPmatrix, makeListIPMs

Examples

Run this code
# Uncomment to run
#dff <- generateData()

#svlist <- makePostSurvivalObjs(dataf = dff, explanatoryVariables="size+size2",meanB = rep(0, 3), 
#	varB = rep(1e+10), nitt = 5000)
#grlist <- makePostGrowthObjs(dataf = dff,explanatoryVariables="size+size2",burnin=100, nitt = 500)

# Only first 10 for speed
#Tlist <- makeListPmatrix(growObjList = grlist[1:10], 
#	survObjList = svlist[1:10], nBigMatrix = 20, minSize = -5, 
#		maxSize = 20, cov = FALSE, envMat = NULL)

# Plots four P matrices at random:
#par(mfrow=c(2,2))
#image(Tlist[[1]]@meshpoints, Tlist[[1]]@meshpoints, 
#	t(Tlist[[1]]), xlab = "Continuous (e.g. size) stage at time t", 
#		ylab = "Continuous (e.g. size) stage at time t+1")

#image(Tlist[[2]]@meshpoints, Tlist[[2]]@meshpoints, 
#	t(Tlist[[2]]), xlab = "Continuous (e.g. size) stage at time t", 
#		ylab = "Continuous (e.g. size) stage at time t+1")

#image(Tlist[[3]]@meshpoints, Tlist[[3]]@meshpoints, 
#	t(Tlist[[3]]), xlab = "Continuous (e.g. size) stage at t", 
#		ylab = "Continuous (e.g. size) stage at t+1")

#image(Tlist[[4]]@meshpoints, Tlist[[4]]@meshpoints, 
#	t(Tlist[[4]]), xlab = "Continuous (e.g. size) stage at time t", 
#		ylab = "Continuous (e.g. size) stage at time t+1")

Run the code above in your browser using DataLab