refund (version 0.1-9)

ff: Construct a function-on-function regression term

Description

Defines a term $\int^{s_{hi, i}}_{s_{lo, i}} X_i(s)\beta(t,s)ds$ for inclusion in an mgcv::gam-formula (or bam or gamm or gamm4:::gamm4) as constructed by pffr. Defaults to a cubic tensor product B-spline with marginal first order differences penalties for $\beta(t,s)$ and numerical integration over the entire range $[s_{lo, i}, s_{hi, i}] = [\min(s_i), \max(s_i)]$ by using Simpson weights. Can't deal with any missing $X(s)$, unequal lengths of $X_i(s)$ not (yet?) possible. Unequal integration ranges for different $X_i(s)$ should work. $X_i(s)$ is assumed to be numeric (duh...).

Usage

ff(X, yind = NULL, xind = seq(0, 1, l = ncol(X)),
    basistype = c("te", "t2", "s"),
    integration = c("simpson", "trapezoidal", "riemann"),
    L = NULL, limits = NULL,
    splinepars = list(bs = "ps", m = list(c(2, 1), c(2, 1))),
    check.ident = TRUE)

Arguments

X
an n by ncol(xind) matrix of function evaluations $X_i(s_{i1}),\dots, X_i(s_{iS})$; $i=1,\dots,n$.
yind
DEPRECATED used to supply matrix (or vector) of indices of evaluations of $Y_i(t)$, no longer used.
xind
matrix (or vector) of indices of evaluations of $X_i(s)$; i.e. matrix with rows $(s_{i1},\dots,s_{iS})$
basistype
defaults to "te", i.e. a tensor product spline to represent $\beta(t,s)$. Alternatively, use "s" for bivariate basis functions (see mgcv's
integration
method used for numerical integration. Defaults to "simpson"'s rule for calculating entries in L. Alternatively and for non-equidistant grids, "trapezoidal" or "riemann". "riemann"
L
optional: an n by ncol(xind) matrix giving the weights for the numerical integration over $s$.
limits
defaults to NULL for integration across the entire range of $X(s)$, otherwise specifies the integration limits $s_{hi, i}, s_{lo, i}$: either one of "s or "s<=t"< code=""> for $(s_{hi, i}, s_{lo, i}) = (0, t)$ or a function that
splinepars
optional arguments supplied to the basistype-term. Defaults to a cubic tensor product B-spline with marginal first difference penalties, i.e. list(bs="ps", m=list(c(2, 1), c(2,1))). See
check.ident
check identifiability of the model spec. See Details and References. Defaults to TRUE.

Value

  • a list containing
    • calla "call" tote(ors,t2) using the appropriately constructed covariate and weight matrices
    • dataa list containing the necessary covariate and weight matrices

Details

If check.ident==TRUE and basistype!="s" (the default), the routine checks for overlap between the kernels of Cov$(X(s))$ and the marginal penalty over s, as well as for sufficient rank of Cov$(X(s))$. If there is overlap of the kernels, the penalty and basis for the covariate direction are changed to B-splines with a modified `shrinkage' penalty, see smooth.construct.pss.smooth.spec. A warning is given if the effective rank of Cov$(X(s))$ (defined the number of eigenvalues accounting for at least 0.995 of the total variance in $X_i(s)$) is lower than the dimension of the basis for the covariate direction. See reference for details. Using an ffpc-term may be preferable if $X_i(s)$ is of very low rank.

References

For background on check.ident: Scheipl, F., & Greven, S. (2012). Identifiability in penalized function-on-function regression models. LMU Munich, Department of Statistics: Technical Report 125. http://epub.ub.uni-muenchen.de/13060/

See Also

mgcv's linear.functional.terms