diagnosticsPmatrix(Pmatrix, growObj, survObj, dff=NULL, integrateType,
correction, cov = data.frame(covariate = 1), sizesToPlot = c(),
extendSizeRange = c())
midpoint
(which uses probability density function); other option is cumul
(which uses the cumulative density function).
none
. The first 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. The second option is discretizeExtremes
which will place all transitions to sizes smaller than minSize
into the smallest bin, and transitions to sizes larger than maxSize
into the largest bin.
minSize
and maxSize
arguments in makeIPMPmatrix
. The discretization of a continuous function can result in under- or over-estimation of the true density. Where this occurs, the sum of the columns of the discretized Pmatrix will not match predictions from the fitted survival model. The middle panel plots these against each other for the three matrices in the first panel (current, extended range and increased bin number) using the same colours as in the first panel. Lines should fall along the (0,1) line shown in grey; if they do not, the argument correction="constant"
may be of use. This ensures that the columns sum to the fitted survival by multiplying every column in the Integral Projection Model by the value that allows this. The third panel checks whether extending the size range included in the matrix and increasing the number of bins (by increasing nBigMatrix
and thereby having narrower bins) does not alter basic predictions from the IPM.
The six panels on the next plot show the discretized IPM (histograms) for the current IPM (top) and one with an increased number of bins (bottom) and the theoretical density function (red line) . These are plotted either for three chosen sizes (sizesToPlot
) or the 0.25, 0.5 and 0.75 quantiles of either the observed data or the range of meshpoints; this size is printed in the top right hand of every plot. If the theoretical density function curve is very distant from the histograms, increasing the nBigMatrix
argument may correct this discrepancy.
Note that it is important that the comparison be "fair" - i.e., whatever the correction
argument used in your current IPM, the same argument must be used in diagnosticsPmatrix.
Note also that if survival is constant across size, the patterns apparent in the life expectancy plot will reflect numerical slippage (since all sizes will have exactly the same life expectancy) and disagreement between the different lines should be ignored.
Finally, note that if the correction used is discretizeExtremes
then the column sums of the Pmatrix and survival will not match towards the extremes.
Ellner & Rees. 2006. Integral projection models for species with complex demography. The American Naturalist 167, p410-428.
For effects of mesh size on IPM output: 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.
makeIPMPmatrix
, convergeIPM
# Example where mesh size does not have a major effect on model output:
dff <- generateData()
Pmatrix <- makeIPMPmatrix(minSize = min(dff$size, na.rm = TRUE),
maxSize = max(dff$size, na.rm = TRUE), growObj = makeGrowthObj(dff),
survObj = makeSurvObj(dff))
diagnosticsPmatrix(Pmatrix, growObj = makeGrowthObj(dff),
survObj = makeSurvObj(dff), dff = dff)
# Compare with the following example where mesh size has an important
# effect on output:
Pmatrix <- makeIPMPmatrix(nBigMatrix = 8,
minSize = min(dff$size, na.rm = TRUE),
maxSize = 0.5*max(dff$size, na.rm = TRUE),
growObj = makeGrowthObj(dff),
survObj = makeSurvObj(dff))
diagnosticsPmatrix(Pmatrix, growObj = makeGrowthObj(dff),
survObj = makeSurvObj(dff), dff = dff)
#with cumul
Pmatrix <- makeIPMPmatrix(nBigMatrix = 10,
minSize = min(dff$size, na.rm = TRUE),
maxSize = max(dff$size, na.rm = TRUE), growObj = makeGrowthObj(dff),
survObj = makeSurvObj(dff),
integrateType = "cumul")
diagnosticsPmatrix(Pmatrix, growObj = makeGrowthObj(dff),
survObj = makeSurvObj(dff), dff = dff, integrateType = "cumul")
#with log increment
Pmatrix <- makeIPMPmatrix(nBigMatrix = 50,
minSize = min(dff$size, na.rm = TRUE),
maxSize = max(dff$size, na.rm = TRUE),
growObj = makeGrowthObj(dff,Formula = logincr~size),
survObj = makeSurvObj(dff))
diagnosticsPmatrix(Pmatrix,
growObj = makeGrowthObj(dff,Formula = logincr~size),
survObj = makeSurvObj(dff), dff = dff)
#example with correction="discretizeExtremes"
Pmatrix <- makeIPMPmatrix(minSize = min(dff$size, na.rm = TRUE),
maxSize = max(dff$size, na.rm = TRUE), growObj = makeGrowthObj(dff),
survObj = makeSurvObj(dff), correction="discretizeExtremes")
diagnosticsPmatrix(Pmatrix, growObj = makeGrowthObj(dff),
survObj = makeSurvObj(dff), dff = dff, correction="discretizeExtremes")
Run the code above in your browser using DataLab