Learn R Programming

refund (version 0.1-1)

amc: Additive model with constraints

Description

An internal function, called by fosr(), that fits additive models with linear constraints via a call to the gam() function in the mgcv package.

Usage

amc(y, Xmat, S, gam.method = "REML", C = NULL, lambda = NULL)

Arguments

y
response vector.
Xmat
design matrix.
S
list of penalty matrices.
gam.method
smoothing parameter selection method: "REML" for restricted maximum likelihood, "GCV.Cp" for generalized cross-validation.
C
matrix of linear constraints. Dimension should be number of constraints times ncol(Xmat).
lambda
smoothing parameter value. If NULL, the smoothing parameter(s) will be estimated.

Value

  • A list with the following elements:
  • gamthe gam object returned by gam().
  • coefficientscoefficients with respect to design matrix Xmat, derived from the gam() fit.
  • Vp, GinvXtoutputs used by fosr().
  • methodthe gam.method argument of the call to amc().

See Also

fosr