stage.bound {posum} | R Documentation |
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.
stage.bound(x,stage,low=TRUE)
x |
A data frame containing the following named variables:
NA 's:
a feature whose prime function is to allow the user to
supply extra information about stage boundaries, if
needed.y relates to.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.) |
stage |
The stage for which the age boundary function is required. |
low |
TRUE if a lower boundary is required, FALSE for an upper boundary. |
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.
An interpolating function of time.
Simon N. Wood snw@st-and.ac.uk
http://www.ruwpa.st-and.ac.uk/simon.html
age.max
,
cm.splinefun
,
hyman.filter
,
posum.atplot
,
spl.coef.conv
,
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")