Description Usage Arguments Value Author(s) References See Also Examples
Defines a term \int_{T}β(t)X_i(t)dt for inclusion in an mgcv::gam
formula (or
bam
or gamm
or gamm4:::gamm
) as constructed by
pfr
, where β(t) is an unknown coefficient
function and X_i(t) is a functional predictor on the closed interval
T. See
smooth.terms
for a list of basis and penalty options; the
default is thinplate regression splines, as this is the default option
for s
.
1 2 3 4 5 6 7 8 9 10 
X 
functional predictors, typically expressed as an 
argvals 
indices of evaluation of 
xind 
same as argvals. It will not be supported in the next version of refund. 
integration 
method used for numerical integration. Defaults to 
L 
an optional 
presmooth 
string indicating the method to be used for preprocessing functional predictor prior
to fitting. Options are 
presmooth.opts 
list including options passed to preprocessing method

... 
optional arguments for basis and penalization to be passed to

a list with the following entries

a 

the 

the matrix of weights used for the integration 

the name used for the functional predictor variable in the 

the name used for 

the name used for the 

the 

a function that preprocesses data based on the preprocessing method specified in 
Mathew W. McLean mathew.w.mclean@gmail.com, Fabian Scheipl, and Jonathan Gellar
Goldsmith, J., Bobb, J., Crainiceanu, C., Caffo, B., and Reich, D. (2011). Penalized functional regression. Journal of Computational and Graphical Statistics, 20(4), 830851.
Goldsmith, J., Crainiceanu, C., Caffo, B., and Reich, D. (2012). Longitudinal penalized functional regression for cognitive outcomes on neuronal tract measurements. Journal of the Royal Statistical Society: Series C, 61(3), 453469.
pfr
, af
, mgcv's smooth.terms
and linear.functional.terms
; pfr
for additional examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  data(DTI)
DTI1 < DTI[DTI$visit==1 & complete.cases(DTI),]
# We can apply various preprocessing options to the DTI data
fit1 < pfr(pasat ~ lf(cca, k=30), data=DTI1)
fit2 < pfr(pasat ~ lf(cca, k=30, presmooth="fpca.sc",
presmooth.opts=list(nbasis=8, pve=.975)), data=DTI1)
fit3 < pfr(pasat ~ lf(cca, k=30, presmooth="fpca.face",
presmooth.opts=list(m=3, npc=9)), data=DTI1)
fit4 < pfr(pasat ~ lf(cca, k=30, presmooth="fpca.ssvd"), data=DTI1)
fit5 < pfr(pasat ~ lf(cca, k=30, presmooth="bspline",
presmooth.opts=list(nbasis=8)), data=DTI1)
fit6 < pfr(pasat ~ lf(cca, k=30, presmooth="interpolate"), data=DTI1)
# All models should result in similar fits
fits < as.data.frame(lapply(1:6, function(i)
get(paste0("fit",i))$fitted.values))
names(fits) < c("none", "fpca.sc", "fpca.face", "fpca.ssvd", "bspline", "interpolate")
pairs(fits)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.