smooth.construct.ar.smooth.spec: Autoregressive Penalty

View source: R/ar_basis.R

smooth.construct.ar.smooth.specR Documentation

Autoregressive Penalty

Description

The ar "basis" uses a separate coefficient for each value of the variables this is a smooth function of. The coefficients are penalized with an autoregressive penalty. This basis is useful when there are not very many unique values of the variable, making dimension reduction unnecessary.

Usage

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

Arguments

object

a smooth specification object, generated by s(), te(), ti(), or t2(), with bs="ar". The order of the autoregressive penalty is specified using the m argument, with the default being AR(2).

data

a list containing just the data (including any by variable) required by this term, with names corresponding to object$term (and object$by). The by variable is the last element.

knots

a list containing any knots supplied for basis setup - in same order and with same names as data. If supplied, coefficients will be used only at the indicated knot values. If NULL, all observed data values will be used.

Details

Note that the predict method needs to have the ability to evaluate the basis at any point in the range of the data; this requires interpolation for values between the observed data. The default is to use linear interpolation to evaluate the basis at these points. Alternative interpolation methods may be specified using the xt argument of the function used to create object (usually s()). xt="lowess" indicates lowess smoothing, and xt="bspline" indicates (unpenalized) b-spline smoothing. This method will also be used in the construction of the basis if the user specifies knots that are not equal to the unique data values.

Author(s)

Jonathan Gellar JGellar@mathematica-mpr.com

See Also

smooth.construct


jgellar/mgcvTrans documentation built on Aug. 10, 2022, 4:02 p.m.