Learn R Programming

IPMpack (version 1.6)

convergeLambda: Iterates until obtaining the number of bins required so that the difference in the chosen measure (lambda, R0, life expectancy of the first bin) falls below a chosen tolerance level

Description

Increases bin number by a specified binIncrease until the difference in the chosen measure falls below a tolerance level

Usage

convergeLambda(growObj, survObj, fecObj, nBigMatrix, minSize, maxSize, 
			discreteTrans = 1, integrateType = "midpoint", correction = "none", preCensus = TRUE, tol=1e-4,binIncrease=5)
convergeR0(growObj, survObj, fecObj, nBigMatrix, minSize, maxSize, 
			discreteTrans = 1, integrateType = "midpoint", correction = "none", preCensus = TRUE, tol=1e-4,binIncrease=5)
convergeLifeExpectancyFirstBin(growObj, survObj,nBigMatrix, minSize, maxSize, 
				discreteTrans = 1, integrateType = "midpoint", correction = "none", 
				tol=1e-1,binIncrease=5)
convergeLifeExpectancyLastBin(growObj, survObj,nBigMatrix, minSize, maxSize, 
				discreteTrans = 1, integrateType = "midpoint", correction = "none", 
				tol=1e-1,binIncrease=5)

Arguments

growObj
a growth object.
survObj
a survival object.
fecObj
a fecundity object.
nBigMatrix
numeric, initial number of bins of size used in the matrix - will be increased for the assessment
minSize
numeric, minimum size used for meshpoints
maxSize
numeric, maximum size used for meshpoints of the P matrix.
discreteTrans
matrix of discrete transitions; or 1 if there is none
integrateType
integration type.
correction
correction (see createIPMPmatrix)
preCensus
boolean defining whether fecundity is pre or post census; defaults to pre
tol
desired tolerance level
binIncrease
increments in increase in the number of bins (should be an integer

Value

  • binIncreasethe number of bins used to increase matrix size in assessing tolerance
  • Pmatrixthe final Pmatrix if only LE is being considered
  • IPMthe final IPM
  • R0the final R0
  • lambdathe final lambda
  • LEthe final vector of life expectancies

Details

The pattern of change in lambda (or other response variables) can be complex, so it is advisable to start with large binIncrease and small tolerance, and then once one knows a general idea of how big the matrix needs to be, run the function again with a smaller binIncrease but start it closer to the goal.

For convergeLifeExpectancyFirstBin, if discrete stages are included via discreteTrans then convergeLifeExpectancyFirstBin will use the first discrete bin.

See Also

diagnosticsPmatrix

Examples

Run this code
dff<-generateData()
gr1<-makeGrowthObj(dff)
sv1<-makeSurvObj(dff)
fv1<-makeFecObj(dff,Transform="log")

res <- convergeLambda(growObj=gr1, survObj=sv1, fecObj=fv1, nBigMatrix=10, minSize=-2, maxSize=15, 
			discreteTrans = 1, integrateType = "midpoint", correction = "none", preCensus = TRUE, tol=1e-3,binIncrease=10)


res <- convergeR0(growObj=gr1, survObj=sv1, fecObj=fv1, nBigMatrix=10, minSize=-2, maxSize=15, 
			discreteTrans = 1, integrateType = "midpoint", correction = "none", preCensus = TRUE, tol=1e-3,binIncrease=10)

res <- convergeLifeExpectancyFirstBin(growObj=gr1, survObj=sv1, nBigMatrix=10, minSize=-2, maxSize=15, 
				discreteTrans = 1, integrateType = "midpoint", correction = "none",  tol=1e-1,binIncrease=10)

res <- convergeLifeExpectancyLastBin(growObj=gr1, survObj=sv1, nBigMatrix=10, minSize=-2, maxSize=15, 
				discreteTrans = 1, integrateType = "midpoint", correction = "none",  tol=1e-1,binIncrease=10)

Run the code above in your browser using DataLab