[Ipmpack-users] stage stage distribution results from function largeMatrixCalc()

Wall, Wade A ERDC-RDE-CERL-IL CIV Wade.A.Wall at erdc.dren.mil
Fri Jan 13 22:25:25 CET 2017


Hi all,

I am working through the IPM pack and tried to use largeMatrixCalc() to estimate stable size distribution. However the results don't sum to 1, rather you have to take each value and divide by the sum of the values. Is this intended? Normally, I think of stable size distribution summing to one.

Here is an example from the vignette.

# Example with both continuous and discrete stages
dff <- generateData(type="discrete")
table(dff$stage)

#make fecundity object
fv1 <- makeFecObj(dataf = dff, Transform = "log",
                  offspringSplitter = data.frame(continuous = 0.2,
                                                 dormant = 0, seedAge1 = 0.8, seedOld = 0),
                  fecByDiscrete = data.frame(dormant = 0,
                                             seedAge1 = 0, seedOld = 0))

Fmatrix <- makeIPMFmatrix(fecObj = fv1, nBigMatrix = 5,
                          minSize = min(dff$size, na.rm = TRUE),
                          maxSize = max(dff$size, na.rm = TRUE),
                          correction = "constant")
# make survival and growth objects
gr1 <- makeGrowthObj(dataf = dff,Formula = sizeNext~size)
sv1 <- makeSurvObj(dff, Formula = surv~size)

discTrans <- makeDiscreteTrans(dff) # movement in and out of discrete stages.

Pmatrix <- makeIPMPmatrix(nBigMatrix = 5,
                          minSize = min(dff$size, na.rm = TRUE),
                          maxSize = max(dff$size, na.rm = TRUE),
                          growObj = makeGrowthObj(dff),
                          survObj = makeSurvObj(dff),
                          discreteTrans = discTrans,
                          correction = "constant")

print(Pmatrix)
IPM <- Pmatrix + Fmatrix
Re(eigen(IPM)$value[1])
sensitivity <- sens(IPM)
elasticity <- elas(IPM)
tmp = largeMatrixCalc(Pmatrix,Fmatrix)
stable = tmp$stableDist ### This doesn't sum to one
stable2 = stable/sum(stable) ### This does, and matches stable.stage from popbio
#### End code

Thanks for putting together such a great package. 

Wade





More information about the IPMpack-users mailing list