vows-mgcv: Utility functions related to the mgcv package

Description Usage Arguments Details Value Author(s) Examples

Description

These internal functions are used by semipar.mix.mp (but can also be used more generally) to customize the implementation of B-spline smoothing by gam. Specifically, a B-spline smooth with equispaced knots can be incorporated in a call to gam using a term of the form s(x,bs="be"), whereas knots at equally spaced quantiles of the data can be specified by s(x,bs="bq").

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'bq.smooth.spec'
smooth.construct(object, data, knots)

## S3 method for class 'be.smooth.spec'
smooth.construct(object, data, knots)

## S3 method for class 'bspline.smooth'
Predict.matrix(object, data)

Arguments

object

a gam smooth specification object generated by a term such as s(x,bs="be") or s(x,bs="bq").

data

For smooth.construct.be.smooth.spec and smooth.construct.bq.smooth.spec, a list containing just the data (including any by variable) required by the given term, with names corresponding to object$term (and object$by). The by variable is the last element. For Predict.matrix.bspline.smooth, a data frame containing the values of the (named) covariates at which the smooth term is to be evaluated. Exact requirements are as for smooth.construct and smooth.construct2.

knots

a list containing any knots supplied for basis setup, in the same order and with the same names as data. If NULL, a default set of knots is used.

Details

These functions are not normally called directly. For further details, please see smooth.construct.ps.smooth.spec and Predict.matrix.cr.smooth.

Value

Either smooth.construct.be.smooth.spec or smooth.construct.bq.smooth.spec produces an object of class "bspline.smooth"; see smooth.construct for the elements that this object will contain. Predict.matrix.bspline.smooth produces a matrix mapping the coefficients for the smooth term to its values at the supplied data values.

Author(s)

Yin-Hsiu Chen enjoychen0701@gmail.com and Philip Reiss phil.reiss@nyumc.org

Examples

1
2
3
4
x. = rnorm(20)
smoo.be <- smooth.construct.be.smooth.spec(s(x), data.frame(x = x.), NULL)
smoo.bq <- smooth.construct.bq.smooth.spec(s(x), data.frame(x = x.), NULL)
Predict.matrix.bspline.smooth(smoo.bq, data.frame(x = seq(min(x.),max(x.),,100)))

vows documentation built on May 2, 2019, 9:26 a.m.