age.max {posum}R Documentation

Upper age boundary function (posum)

Description

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.

Usage

 age.max(data) 

Arguments

data 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.

Details

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!).

Value

A function is returned. The returned function returns the population surface upper age boundary at each time supplied in its array argument.

WARNING

Author(s)

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

References

Hyman (1983) SIAM J. Sci. Stat. Comput. 4(4):645-654

See Also

cm.splinefun, hyman.filter, spl.coef.conv, stage.bound,

Examples

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)")

[Package Contents]