Last data update: 2014.03.03

R: Models growth allowing for cumulative bin estimation.
growthCumR Documentation

Models growth allowing for cumulative bin estimation.

Description

Generic function to predict the cdf (cummulative density function) of continuous (e.g. size) stage at t+1 given stage at t and a growth object.

Usage

growthCum(size, sizeNext, cov, growthObj)

Arguments

size

vector of current sizes.

sizeNext

vector of sizes in the next time step.

cov

covariate level in this time step (numeric of length 1).

growthObj

a growth object.

Value

a vector of length sizeNext giving the cdf (cummulative density function) of each value of sizeNext.

Author(s)

C. Jessica E. Metcalf, Sean M. McMahon, Roberto Salguero-Gomez, Eelke Jongejans & Cory Merow.

See Also

growth

Examples

dff <- generateData()
gr1 <- makeGrowthObj(dff)
sizeRange <- c(1:20)
sizeInit <- 1
growthCum(sizeInit, sizeRange, data.frame(cov=1), gr1)
plot(growthCum(sizeInit, sizeRange, data.frame(cov=1), gr1), type="l", 
	col = "dark gray", xlab = "Continuous (e.g. size) stage at time t+1", 
		ylab = paste("Cummulative growth 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/growthCum.Rd_%03d_medium.png", width=480, height=480)
> ### Name: growthCum
> ### Title: Models growth allowing for cumulative bin estimation.
> ### Aliases: growthCum
> 
> ### ** Examples
> 
> dff <- generateData()
> gr1 <- makeGrowthObj(dff)
> sizeRange <- c(1:20)
> sizeInit <- 1
> growthCum(sizeInit, sizeRange, data.frame(cov=1), gr1)
 [1] 0.5393145 0.8654465 0.9826368 0.9990894 0.9999814 0.9999999 1.0000000
 [8] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
[15] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
> plot(growthCum(sizeInit, sizeRange, data.frame(cov=1), gr1), type="l", 
+ 	col = "dark gray", xlab = "Continuous (e.g. size) stage at time t+1", 
+ 		ylab = paste("Cummulative growth to a specific size in t+1 from size ", 
+ 			sizeInit, " at time t"))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>