Predicts the probability density function of continuous (e.g. size) stage at time t+1 given stage values at time t and survival probability as a function of stage values at time t, given a growth and survival object.
Usage
growSurv(size, sizeNext, cov, growthObj, survObj)
Arguments
size
vector of current size(s).
sizeNext
vector of future size(s).
cov
covariate level (numeric of length 1).
growthObj
a growth object.
survObj
a survival object.
Details
makeIPMPmatrix and variants there-of apply outer to this function to efficiently obtain the IPM P matrix.
Value
numeric defining the pdf (probability density function).
Note
Code developed following Mark Rees, Dylan Childs & Karen Rose.
Author(s)
C. Jessica E. Metcalf, Sean M. McMahon, Roberto Salguero-Gomez, Eelke Jongejans & Cory Merow.
References
Easterling, Ellner & Dixon. 2000. Size-specific sensitivity: a new structured population model. Ecology 81, p694-708.
See Also
growth, surv
Examples
dff <- generateData()
gr1 <- makeGrowthObj(dff)
sv1 <- makeSurvObj(dff)
sizeRange <- c(1:20)
sizeInit <- 1
growSurv(sizeInit, sizeRange, data.frame(covariate=1), gr1, sv1)
plot(growSurv(sizeInit, sizeRange, data.frame(covariate=1), gr1, sv1),
type="l", col = "dark gray",
xlab = "Continuous (e.g. size) stage at time t+1",
ylab = paste("Probability of survival to a specific size in t+1 from size ",
sizeInit, " at time t"))
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(IPMpack)
Loading required package: Matrix
Loading required package: MASS
Loading required package: nlme
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IPMpack/growSurv.Rd_%03d_medium.png", width=480, height=480)
> ### Name: growSurv
> ### Title: Combines growth and survival.
> ### Aliases: growSurv
>
> ### ** Examples
>
> dff <- generateData()
> gr1 <- makeGrowthObj(dff)
> sv1 <- makeSurvObj(dff)
> sizeRange <- c(1:20)
> sizeInit <- 1
> growSurv(sizeInit, sizeRange, data.frame(covariate=1), gr1, sv1)
[1] 1.352037e-01 1.036662e-01 3.361383e-02 4.609256e-03 2.672857e-04
[6] 6.554702e-06 6.797703e-08 2.981286e-10 5.529390e-13 4.336936e-16
[11] 1.438537e-19 2.017860e-23 1.196997e-27 3.002807e-32 3.185620e-37
[16] 1.429199e-42 2.711586e-48 2.175637e-54 7.382126e-61 1.059275e-67
> plot(growSurv(sizeInit, sizeRange, data.frame(covariate=1), gr1, sv1),
+ type="l", col = "dark gray",
+ xlab = "Continuous (e.g. size) stage at time t+1",
+ ylab = paste("Probability of survival to a specific size in t+1 from size ",
+ sizeInit, " at time t"))
>
>
>
>
>
> dev.off()
null device
1
>