af_old {refund} | R Documentation |
Construct an FGAM regression term
Description
Defines a term \int_{T}F(X_i(t),t)dt
for inclusion in an mgcv::gam
-formula (or
bam
or gamm
or gamm4:::gamm
) as constructed by
fgam
, where F(x,t)
$ is an unknown smooth bivariate function and X_i(t)
is a functional predictor on the closed interval T
. Defaults to a cubic tensor product
B-spline with marginal second-order difference penalties for estimating F(x,t)
. The
functional predictor must be fully observed on a regular grid
Usage
af_old(
X,
argvals = seq(0, 1, l = ncol(X)),
xind = NULL,
basistype = c("te", "t2", "s"),
integration = c("simpson", "trapezoidal", "riemann"),
L = NULL,
splinepars = list(bs = "ps", k = c(min(ceiling(nrow(X)/5), 20), min(ceiling(ncol(X)/5),
20)), m = list(c(2, 2), c(2, 2))),
presmooth = TRUE,
Xrange = range(X),
Qtransform = FALSE
)
Arguments
X |
an |
argvals |
matrix (or vector) of indices of evaluations of |
xind |
Same as argvals. It will discard this argument in the next version of refund. |
basistype |
defaults to |
integration |
method used for numerical integration. Defaults to |
L |
optional weight matrix for the linear functional |
splinepars |
optional arguments specifying options for representing and penalizing the
function |
presmooth |
logical; if true, the functional predictor is pre-smoothed prior to fitting; see
|
Xrange |
numeric; range to use when specifying the marginal basis for the x-axis. It may
be desired to increase this slightly over the default of |
Qtransform |
logical; should the functional be transformed using the empirical cdf and
applying a quantile transformation on each column of |
Value
A list with the following entries:
-
call
- a"call"
tote
(ors
,t2
) using the appropriately constructed covariate and weight matrices. -
argvals
- theargvals
argument supplied toaf
-
L
-the matrix of weights used for the integration -
xindname
- the name used for the functional predictor variable in theformula
used bymgcv
. -
tindname
- the name used forargvals
variable in theformula
used bymgcv
-
Lname
- the name used for theL
variable in theformula
used bymgcv
-
presmooth
- thepresmooth
argument supplied toaf
-
Qtranform
- theQtransform
argument supplied toaf
-
Xrange
- theXrange
argument supplied toaf
-
ecdflist
- a list containing one empirical cdf function from applyingecdf
to each (possibly presmoothed) column ofX
. Only present ifQtransform=TRUE
-
Xfd
- anfd
object from presmoothing the functional predictors usingsmooth.basisPar
. Only present ifpresmooth=TRUE
. Seefd
.
Author(s)
Mathew W. McLean mathew.w.mclean@gmail.com and Fabian Scheipl
References
McLean, M. W., Hooker, G., Staicu, A.-M., Scheipl, F., and Ruppert, D. (2014). Functional generalized additive models. Journal of Computational and Graphical Statistics, 23 (1), pp. 249-269. Available at https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3982924/.
See Also
fgam
, lf
, mgcv's linear.functional.terms
,
fgam
for examples