smoothCon(object,data,knots,absorb.cons=FALSE,
scale.penalty=TRUE,n=nrow(data),dataX=NULL,
null.space.penalty=FALSE)
PredictMat(object,data,n=nrow(data))
n
must be supplied.TRUE
in order to have identifiability
constraints absorbed into the basis.gamm
fitting.data
is a list.data
, but the model matrix
should be constructed with another set of data provided in dataX
--- n
is assumed to
be the same for both. Facilitates smooth id's.smoothCon
a list of smooth
objects returned by the
appropriate smooth.construct
method function. If constraints are
to be absorbed then the objects will have attributes "qrc"
and
"nCons"
, the qr decomposition of the constraint matrix (returned by
qr
) and the number of constraints, respectively: these are used in
the re-parameterization. For predictMat
a matrix which will map the parameters associated with
the smooth to the vector of values of the smooth evaluated at the covariate
values given in object
.
smooth.construct
and Predict.matrix
method
functions to be re-parameterized so that identifiability constraints are no
longer required in fitting. This is done in a user transparent
manner, but is typically of no importance in use of GAMs. The routine's
also handle by
variables and will create default identifiability
constraints.If a user defined smooth constructor handles by
variables itself, then its
returned smooth object should contain an object by.done
. If this does not exist
then smoothCon
will use the default code. Similarly if a user defined Predict.matrix
method handles by
variables internally then the returned matrix should have a
"by.done"
attribute.
Default centering constraints, that terms should sum to zero over the covariates, are produced unless
the smooth constructor includes a matrix C
of constraints. To have no constraints (in which case
you had better have a full rank penalty!) the matrix C
should have no rows.
smoothCon
returns a list of smooths because factor by
variables result in multiple copies
of a smooth, each multiplied by the dummy variable associated with one factor level. smoothCon
modifies
the smooth object labels in the presence of by
variables, to ensure that they are unique, it also stores
the level of a by variable factor associated with a smooth, for later use by PredMat
.
The parameterization used by gam
can be controlled via
gam.control
.
gam.control
,
smooth.construct
, Predict.matrix