Description Usage Arguments Details Value Note Author(s) See Also Examples
View source: R/IPMpack-Analyses.r
Iteratively increases the number of bins specified in
binIncrease
until the difference in the chosen measure falls
below the selected tolerance level.
1 2 3 4 | convergeIPM(growObj, survObj, fecObj, nBigMatrix, minSize, maxSize,
discreteTrans = 1, integrateType = "midpoint", correction = "none",
preCensus = TRUE, tol = 1e-04, binIncrease = 5, chosenBin = 1,
response = "lambda")
|
growObj |
An object of class |
survObj |
An object of class |
fecObj |
An object of class |
nBigMatrix |
A numeric specifying the initial number of bins used in the matrix. This number will be increased in the function |
minSize |
A numeric specifying the lower size bound for the big matrix's meshpoints |
maxSize |
A numeric specifying the upper size bound for the big matrix's meshpoints |
discreteTrans |
A matrix of discrete transitions. If there are none, specify as 1 |
integrateType |
The type of function to integrate over. The default
is |
correction |
The type of correction to use for eviction.
The first option is |
preCensus |
A logical defining whether the |
tol |
The desired tolerance level for |
binIncrease |
The number of bins to add in each successive iteration. |
chosenBin |
The desired bin for which life expectancy should be assessed. The default is the first. |
response |
The variable to test for convergence. The options
are |
Different choices for responses will yield different values. 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 the life expectancy option, if discrete stages are included via discreteTrans then if chosenBin=1, this function will use the first discrete bin.
A list with the following elements:
binIncrease
- The number of bins used to increase the
matrix size
Pmatrix
- The final Pmatrix
if only life expectancy
is being considered
IPM
- The final IPM reached at convergence
R0
- The final R0
lambda
- The final lambda
LE
- The final vector of life expectancies
This code was modified from original code by Melissa Eitzel.
C. Jessica E. Metcalf, Sean M. McMahon, Roberto Salguero-Gomez, Eelke Jongejans & Cory Merow.
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 | dff<-generateData()
gr1<-makeGrowthObj(dff)
sv1<-makeSurvObj(dff)
fv1<-makeFecObj(dff,Transform="log")
res <- convergeIPM(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 <- convergeIPM(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, response="R0")
res <- convergeIPM(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,
response="lifeExpect")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.