posum.X {posum} | R Documentation |
Given a posum input dataframe and a gam
object set up to
provide bases for the components of the posum model, this routine produces
the posum model matrix: the main part of this is integrating under the
populaiton surface in order to get the matrix mapping the parameters to
the stage populaiton data. The routine is called by posum
, rather
than directly by the user.
posum.X(data,b,ni=10)
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.) |
b |
a gam object containing the information specifying the
basis for the populaiton surface and optionally the adults. |
ni |
the number of points to use in each (trapezoidal rule) stage
integration - in practice controlled via option n.int in
call to posum.options as part of posum call. |
posum
sets up a population surface model as a gam
using the
functions provided in library mgcv
, however since the response data for the
posum models consist of integrals of the population surface it is necessary to create a
special gam
design matrix to take account of this. This is done by passing a
gam
object to posum.X
, which then uses it to call predict.gam
with
type="lpmatrix"
in order to get the matrix mapping the parameters to the populaiton
surface at a fine mesh of points appropriately spread over the population surface.
Summing rows of this matrix in the right way yields the desired model matrix.
The function returns the required model matrix.
Simon N. Wood snw@st-and.ac.uk
http://www.ruwpa.st-and.ac.uk/simon.html
posum
,
posum.con
,
posum.options
,