age.max {posum} | R Documentation |
Given a posum input data frame/list, this returns a function [amax(t)] the value of which is the upper age boundary of the juvenile populaiton surface at time t.
age.max(data)
data |
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.) |
The routine collects the data in the input dataframe relating to the
upper age boundary of the juvenile population surface. This is either the
lower, a0
, boundary data for the adult stage, or if there is no adult
stage, the upper, a1
, boundary of the last juvenile stage. (`Adult' is
here used to mean a final stage of indeterminate duration, if the final adult
stage is of fixed duration then it is treated as a juvenile stage). Having
collected the data then it is interpolated in time using a cubic spline,
filtered using a version of Hyman's (1983) method to ensure that the function
never increases by more than one day per day (this restriction is simply a
biological fact!).
A function is returned. The returned function returns the population surface upper age boundary at each time supplied in its array argument.
Simon N. Wood snw@st-and.ac.uk
Hyman (1983) SIAM J. Sci. Stat. Comput. 4(4):645-654
cm.splinefun
,
hyman.filter
,
spl.coef.conv
,
stage.bound
,
data<-population.data(fam="p",adult=TRUE) #simulate dataframe amax<-age.max(data) # get upper juvenile age boundary function seq(min(data$t),max(data$t),length=100)->times plot(times,amax(times),type="l",main="Demonstration of age.max (posum)") data<-population.data(adult=FALSE) #simulate dataframe (no adults) amax<-age.max(data) # get upper juvenile age boundary function plot(times,amax(times),type="l",main="Demonstration of age.max (posum)")