Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

amc

Additive model with constraints


Description

An internal function, called by fosr(), that fits additive models with linear constraints via a call to gam or bam 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.

...

other arguments, passed to gam or bam.

Details

The additive model is fitted using gam, unless there are more than 10000 responses; in that case bam is used.

Value

A list with the following elements:

gam

the gam object returned by gam or bam.

coefficients

coefficients with respect to design matrix Xmat, derived from the gam() fit.

Vp, GinvXt

outputs used by fosr.

method

the gam.method argument of the call to amc.

Author(s)

Philip Reiss phil.reiss@nyumc.org

See Also


refund

Regression with Functional Data

v0.1-23
GPL (>= 2)
Authors
Jeff Goldsmith [aut], Fabian Scheipl [aut], Lei Huang [aut], Julia Wrobel [aut, cre], Chongzhi Di [aut], Jonathan Gellar [aut], Jaroslaw Harezlak [aut], Mathew W. McLean [aut], Bruce Swihart [aut], Luo Xiao [aut], Ciprian Crainiceanu [aut], Philip T. Reiss [aut], Yakuan Chen [ctb], Sonja Greven [ctb], Lan Huo [ctb], Madan Gopal Kundu [ctb], So Young Park [ctb], David L. Miller [ctb], Ana-Maria Staicu [ctb]
Initial release
2020-12-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.