These functions define nonlinear terms in the formula, with g defining
an index created from a collection of terms passed through the ...
argument while s is applied to a single variable, similarly to
s in mgcv.
For indices, g allows the definition of constraints applied to
the index only. This is a convenient alternative to passing the whole
constraint matrix Cmat in cgaim. Constraints can be
defined by a prespecified matrix through the argument Cmat or
through the argument acons for common constraints (see
build_constraints). Note that any provided Cmat must
match the total number of variables in ..., including potential
matrix expansion and factors. Both Cmat and acons can be
passed to the function, which will bind them internally.
Both g and s allow the definition of shape constraints for the
smooth. Eight shape-constraints are currently available:
monotone increasing (fcons = "inc"),
monotone decreasing (fcons = "dec"),
convex (fcons = "cvx"),
concave (fcons = "ccv"),
increasing and convex(fcons = "inccvx"),
decreasing and convex (fcons = "deccvx"),
increasing and concave (fcons = "incccv"),
decreasing and concave (fcons = "decccv").
Smoothing can be controlled by the s_opts parameter. It is a list of
argument depends on the method used for smoothing. See s
for smooth_method = "scam". For smooth_method = "cgam",
the parameters allowed may vary according to the shape-constraint chosen.
The full list can be found in cgam, but only the
constraints beginning with s. are allowed for now.
No parameter are necessary when smooth_method = "scar"
(see scar).