Learn R Programming

longke (version 0.1.0)

KE_fit: KE_fit

Description

Function used to predict response trajectory by nonparametric kernel estimator

Usage

KE_fit(train,test,T1,T2,bw_time,bw_subj,alpha=0.05,seed=1,coefCI=FALSE)

Value

A list containing 6 elements

testTraj

A num.test x num.T2 matrix containing num.test subjects' trajectories where num.T2 is the total number of the discrete measurement time over T2

proxycoeff

Coefficient estimation for the non-negative least square regression. From left to right they are alpha_0, alpha_1, ...

fpca.fit

A list containing FPCA fit for the functional predictors and the functional response

w.hat

A list containing num.test elements where ith element contains the proxy distance/similarity between ith testing subject and other training subjects

bootCI.mean

Bootstrap confidence interval of alpha_0, alpha_1, ...

input.list

A list containing the input arguments

Arguments

train

A long format data matrix containing columns ordered by time, subject ID, response, predictor1, predictor2, ... where the measurement time of the longitudinal data should be discretized within T1.

test

A long format data matrix containing columns ordered by time, subject ID, response, predictor1, predictor2, ... where the measurement time of the longitudinal data should be discretized within T2.

T1

A measurement time domain where the functional predictors are measured within

T2

A measurement time domain where the functional response is of interest to predict

bw_time

(optimal) time bandwidth

bw_subj

(optimal) trajectory/subject bandwidth

alpha

confidence level for bootstrap CI of alpha_0, alpha_1, ...

seed

A random seed fo producing replicable bootstrap CI of alpha_0, alpha_1, ...

coefCI

Logical statement: TRUE to derive bootstrap CI of alpha0, alpha1, ... default is FALSE

References

Wang S, Kim S, Cho H, Chang W. Nonparametric predictive model for sparse and irregular longitudinal data. (2023+)

Examples

Run this code
t_all = 1:50
T1=c(1,25);T2=c(26,50)
data = datagen(ntotal=350,ntest=50,t_all=t_all,t_split=25,seed=1)
train = data$train
test = data$test
ke.fit = KE_fit(train=train,test=test,T1=T1,T2=T2,bw_time=1,bw_subj = 0.2)

Run the code above in your browser using DataLab