posum.stage {posum}R Documentation

Extract stage specific information from a fitted posum model

Description

Given a fitted model object as returned by posum, this function integrates the fitted population and death rate surfaces over stages lo to hi inclusive, to produce rates averaged over stage(s) at each of the points in array t. If aggregate is TRUE, then integrated quantities over all elements of t are produced.

Usage

posum.stage(x,lo=1,hi=lo,t=seq(min(x$data$t),max(x$data$t),length=100),
                      n.int=x$options$n.int,fdi=x$options$fdi,plot=TRUE,aggregate=FALSE)

Arguments

x A fitted model object as produced by posum.
lo The stage at which to start integration
hi The stage at which to stop integration (if equal to lo then only one stage is integrated over).
t array of times at which to evaluate populations and death rates. If aggregate==TRUE then this is an integration mesh.
n.int The number of age points to use in the integration over stages.
fdi The parameter controlling the finite difference interval used to evaluate death rates. The average spacing used in the integration mesh is found and then multiplied by this number to get the finite difference interval used for gradient estimation.
plot if TRUE then a plot is produced.
aggregate if TRUE then t is treated as an integration mesh, and rather than producing estimates for each time in t, integrated estimates are produced.

Details

All numerical inegration is by the trapezoidal rule. All evaluations use predict.gam. Standard errors are produced for all quantities, including per capita death rate (the latter se by local linearization).

Value

A dataframe is returned with the following elements:

p estimated population(s).
d estimated total death rate(s).
m estimated per capita death rate(s).
p.se standard error for p.
d.se standard error for d.
m.se standard error for m.

WARNING

Author(s)

Simon N. Wood snw@st-and.ac.uk

References

http://www.ruwpa.st-and.ac.uk/simon.html

See Also

posum.atplot, posum.plot, posum.stage.plot,

Examples

data<-population.data(fam="p",adult=TRUE) #simulate data
b<-posum(data,fam="p")
r<-posum.stage(b,1,10,aggregate=TRUE)
old.pcdr<-pcdr;old.rec<-rec;old.sim.age.bound<-sim.age.bound
rec<-function(t) {50*exp(-0.5*(t-5)^2)}
pcdr<-function(a,t) {0.2231+a*0}
sim.age.bound<-function(stage,t) { (stage-1)+t*0}
data<-population.data(t=0:9,ns=9,sc=0,fam="n",adult=FALSE) #simulate data
b<-posum(data,fam="n")
r<-posum.stage(b,1,9,aggregate=TRUE)
pcdr<-old.pcdr;rec<-old.rec;sim.age.bound<-old.sim.age.bound

[Package Contents]