stage.bound {posum}R Documentation

Extract stage boundary information from posum objects

Description

Takes and input or output posum data object and extracts the stage boundary information from this, returning a function giving the boundary as a function of time, which interpolates the extracted boundary data and meets the biological constraint that its time derivative is always less than or equal to 1.

Usage

stage.bound(x,stage,low=TRUE)

Arguments

x A data frame containing the following named variables:
y
The stage population data. This may contain NA's: a feature whose prime function is to allow the user to supply extra information about stage boundaries, if needed.
stage
Which stage each element of y relates to.
a0
The lower age boundary for this observation.
a1
The upper age boundary for this observation. NA implies an adult stage. If an element is equal to the corresponding a0 element then the corresponding y is taken as a direct observation of the population surface height (rather than the usual integral under it.)
t
Sample time for each observation.
stage The stage for which the age boundary function is required.
low TRUE if a lower boundary is required, FALSE for an upper boundary.

Details

All a0 or a1 records are extracted for the relevant stage, along with their corresponding t records. After some checks, these data are then interpolated using cm.splinefun, which fits a cubic interpolating spline and then filters its coefficients it to ensure that its time derivative is never greater than 1. The resulting filtered interpolating function is then returned.

Value

An interpolating function of time.

WARNING

Author(s)

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

References

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

See Also

age.max, cm.splinefun, hyman.filter, posum.atplot, spl.coef.conv,

Examples

data<-population.data(fam="p",adult=TRUE) #simulate data
bound3<-stage.bound(data,3,low=TRUE)
time<-0:100
plot(time,bound3(time),type="l",
main="Simulated data stage 3 lower age boundary")

[Package Contents]