posum.con {posum} | R Documentation |
Produces the linear inequality constraints that ensure
(approximate) non-negativeness of model population and death rates.
This routine is called by posum
during model set up in order
to generate the required constraints.
posum.con(b,amax,data,fdi=0.01,m=40,adults=FALSE)
b |
A gam object containing the bases used to represent the population
surface and adults if present. |
amax |
A function returning the upper age boundary of the populaiton surface
at any time. Usually this will have been generated by routine age.max . |
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.) |
fdi |
coefficient controlling the size of finite difference interval to use for
numerical calculation of derivatives required in constraints. Constraints are applied
at each point on a regular m by m grid over the age time plane.
The minimum of the grid spacing in age and time is found, and multiplied by
fdi to get the finite difference interval to use. |
m |
constraints are applied on an m by m grid over the model age
time plane. |
adults |
set to TRUE if adult constraints are required, FALSE
otherwise. |
Let n be the population per unit age interval. If n>=0 along the upper age boundary of the surface, and final sample time boundary of the surface, and if: dn/da+dn/dt <=0 everywhere, then n will be positive and will not imply negative death rates. These constraints are applied in practice on a relatively fine mesh across the age-time domain of n.
If there is an adult stage a then additional constraints are required (partly in replacement for the surface non-negativity constraint at the upper age boundary). The adult stage is governed by: da/dt=R(t)-m(t)a(t) where m is per capita death rate and R(t) is recruitment to the adult stage. R(t)=n(T)[1-dT/dt] where T is the age at the upper boundary of the surface. We require that a>=0 and R(t)-da/dt >=0 to ensure non-negativeness of the adult population and its death rate respectively. Once again, these constraints are applied at on a fine time mesh in practice.
The routine is called by posum
, rather than being used directly:
fdi
and m
would usually be set using posum.options
in a
call to posum
.
A matrix C
is returned such that if
C b$coeff>=0
then the
(approximate) constraints are met.
Simon N. Wood snw@st-and.ac.uk
http://www.ruwpa.st-and.ac.uk/simon.html