posum.X {posum}R Documentation

Obtain model matrix for a posum model

Description

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.

Usage

posum.X(data,b,ni=10)

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

Details

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.

Value

The function returns the required model matrix.

WARNING

Author(s)

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

References

http://www.ruwpa.st-and.ac.uk/simon.html

See Also

posum, posum.con, posum.options,


[Package Contents]