cv.nonlinear: Cross-validation for nonlinear function-on-function...

Description Usage Arguments Details Value Author(s) References Examples

Description

This function is used to perform cross-validation and build the final model using signal compression approach for the following nonlinear function-on-function regression model:

Y(t)= μ(t)+\int_{a_1}^{b_1}F_1(X_1(s), s,t)ds+...+\int_{a_p}^{b_p}F_p(X_p(s), s,t)ds+ε(t),

where μ(t) is the intercept function, {F_i(x,s,t), 1≤ i≤ p} are all unspecified nonlinear functions of x, s, t, {X_i(s), 1≤ i≤ p} are functional predictors, and ε(t) is the noise function.

In this method, we require that all the sample curves of each functional predictor be observed in a common dense set, but the observation points can be different for different functional predictors. All the sample curves of the functional response are observed in a common dense set.

Usage

1
2
cv.nonlinear(X, Y, t.x.list, t.y, s.n.basis = 40, x.n.basis = 40,
        t.n.basis = 40, K.cv = 5, upper.comp = 10, thresh = 0.01)

Arguments

X

a list of length p, the number of functional predictors. Its i-th element is the n*m_i data matrix for the i-th functional predictor X_i(s), where n is the sample size and m_i is the number of observation time points for X_i(s).

Y

the n*m data matrix for the functional response Y(t), where n is the sample size and m is the number of the observation time points for Y(t).

t.x.list

a list of length p. Its i-th element is the vector of observation time points of the i-th functional predictor X_i(s), 1≤ i≤ p.

t.y

the vector of observation time points of the functional response Y(t).

s.n.basis

the number of B-spline basis functions for the argument s. Default is 40.

x.n.basis

the number of B-spline basis functions for x. Default is 40.

t.n.basis

the number of B-spline basis functions for t. Default is 4.

K.cv

the number of CV folds. Default is 5.

upper.comp

the upper bound for the maximum number of components to be calculated. Default is 10.

thresh

a number between 0 and 1 used to determine the maximum number of components we need to calculate. The maximum number is between one and the "upp.comp" above. The optimal number of components will be chosen between 1 and this maximum number, together with other tuning parameters by cross-validation. A smaller thresh value leads to a larger maximum number of components and a longer running time. A larger thresh value needs less running time, but may miss some important components and lead to a larger prediction error. Default is 0.01.

Details

This method estimates a special decomposition:

F_i(x,s,t)=G_{i1}(x,s)w_1(t)+...+G_{iK}(x,s)w_K(t), 1≤ i≤ p.

We first estimate \bold{G}_k=(G_{1k}(x_1,s),...,G_{pk}(x_p,s))^T for each k>0 by solving a generalized penalized functional eigenvalue problem

max_{\bold{G}} \frac{\hat{\bold{Λ}}(\bold{G},\bold{G})}{\hat{\bold{Σ}}(\bold{G},\bold{G})+P(\bold{G})}

{\rm{s.t.}} \quad \hat{\bold{Σ}}(\bold{G}_{k'},\bold{G})=0

{\rm{and}} \quad \int\int \bold{G}(s)^T \hat{Σ}(s,s')\bold{G}_{k'}(s')dsds'=0 \quad {\rm{for}} \quad k'<k

where

\hat{\bold{Λ}}(\bold{G},\bold{G})=\int ≤ft[∑_{\ell=1}^n∑_{i=1}^p \int \{G_i(x_{\ell,i}(s),s)-\bar{G}_i(s)\}ds \{y_{\ell}(t)-\bar{y}(t)\} \right]^2 dt /n^2,

\hat{\bold{Σ}}(\bold{G},\tilde{\bold{G}})=∑_{\ell=1}^n ≤ft[∑_{i=1}^p \int \{G_i(x_{\ell,i}(s),s)-\bar{G}_i(s)\}ds\right]≤ft[∑_{j=1}^p \int \{\tilde{G}_j(x_{\ell,j}(s),s)-\bar{\tilde{G}}_j(s)\}ds\right]/n,

penlaty

P(G)=λ ∑_{j=1}^p \{\|G_j\|^2+τ(\|\partial_{xx}G_j\|^2+\|\partial_{xs}G_j\|^2+\|\partial_{ss}G_j\|^2)\},

and <G,\tilde{G}>_{H^2}=<G,\tilde{G}>_{L^2}+<\partial_{xx}G,\partial_{xx}\tilde{G}>_{L^2}+<\partial_{xs}G,\partial_{xs}\tilde{G}>_{L^2}+<\partial_{ss}G,\partial_{ss}\tilde{G}>_{L^2} with <G,\tilde{G}>_{L^2}=\int\int G(x,s)\tilde{G}(x,s) dxds. Then we estimate {w_{k}(t), k>0} by regressing \{y_{\ell}(t)\}_{\ell=1}^n on \{\hat{z}_{\ell,1},... \hat{z}_{\ell,K}\}_{\ell=1}^n with penalty κ ∑_{k=0}^K \|w''_k\|^2 tuned by the smoothness parameter κ. Here \hat{z}_{\ell,k}= ∑_{i=1}^p \int (G_{ik}(x_{\ell,i}(s),s)-\bar{G}_{ik}(s))ds, and \bar{G}_{ik}(s)=∑_{\ell=1}^n G_{ik}(X_{\ell,i}(s),s)/n.

Value

A fitted CV-object, which is used in the function pred.nonlinear for prediction and getcoef.nonlinear for extracting the estimated coefficient functions.

opt.K

optimal number of components to be selected.

opt.lambda

optimal value for λ.

opt.tau

optimal value for τ.

opt.kappa

optimal value for κ, the smoothness tuning parameter for w_k(t).

...

other output for internal use.

Author(s)

Xin Qi and Ruiyan Luo

References

Xin Qi and Ruiyan Luo. (Accepted) Nonlinear function on function additive model with multiple predictor curves. Stistica Sinica.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#################################################################################
# Example: Nonlinear function-on-function model
###############################################################################

ptm <- proc.time()
library(FRegSigCom)
library(refund)
data(DTI)
I=which(is.na(apply(DTI$cca,1,mean)))
X=DTI$cca[-I,] # functional response
Y=DTI$rcst[-I,-(1:12)] #functional predictor
t.x <- list(seq(0,1,length=dim(X)[2]))
t.y <- seq(0,1,length=dim(Y)[2])
# randomly split all the observations into a training set with 200 observations
# and a test set.
train.id=sample(1:nrow(Y), 30)
X.train.list <- list(X[train.id,])
Y.train <- Y[train.id, ]
X.test.list <- list(X[-(train.id),])
Y.test <- Y[-(train.id), ]
fit.cv=cv.nonlinear(X.train.list, Y.train, t.x, t.y, upper.comp=3,
s.n.basis=20, x.n.basis=20,t.n.basis=20) 
           # in practice, use the default values (or larger) for
           # "upper.comp", "s.n.basis","x.n.basis", and "t.n.basis".
Y.pred=pred.nonlinear(fit.cv, X.test.list)
nonlinear.error= mean((Y.pred-Y.test)^2)
print(c("prediction error=",nonlinear.error))
print(proc.time()-ptm)

FRegSigCom documentation built on May 1, 2019, 9:45 p.m.