Description Usage Arguments Details Value Author(s) References See Also Examples
Make prediction based on a fitted FuncompCGL object.
| 1 2 3 4 5 | 
| object | fitted  | 
| Znew | data frame or matrix  | 
| Zcnew | matrix  | 
| s | value(s) of the penalty parameter  | 
| T.name | a character string specifying names of the time variable and the Subject
ID variable in  | 
| ID.name | a character string specifying names of the time variable and the Subject
ID variable in  | 
| Trange, interval, insert, basis_fun, degree, method | the same as those in  | 
| sseq | full set of potential time points of observations;
used for interpolation when  | 
| ... | not used. | 
s is the vector at which predictions are requested. If s is not in the lam
sequence used for fitting the model, the predict function uses linear interpolation.
If the data frame X is provided in FuncompCGL mode, the integral
for new data newx is taken the same as that in the fitted
FuncompCGL model. This means that the parameters degree,
basis_fun, insert, method, inteval,
Trange, and K are exactly the same as these in the provided
object. If insert="X" or "basis", sseq is the
sorted sequence of all the observed time points in fitting FuncompCGL model and
all the observed time points in newx. Then interpolation is
conducted on sseq. If matrix X after integral is provided in
the FuncompCGL object, these parameters are required.
predicted values at the requested value(s) for s.
Zhe Sun and Kun Chen
Sun, Z., Xu, W., Cong, X., Li G. and Chen K. (2020) Log-contrast regression with functional compositional predictors: linking preterm infant's gut microbiome trajectories to neurobehavioral outcome, https://arxiv.org/abs/1808.02403 Annals of Applied Statistics
FuncompCGL, and coef,
plot and print
methods for "FuncompCGL" object.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | p = 30
n_train = 50
n_test = 30
df_beta = 5
beta_C_true = matrix(0, nrow = p, ncol = df_beta)
beta_C_true[1, ] <- c(-0.5, -0.5, -0.5 , -1, -1)
beta_C_true[2, ] <- c(0.8, 0.8,  0.7,  0.6,  0.6)
beta_C_true[3, ] <- c(-0.8, -0.8 , 0.4 , 1 , 1)
beta_C_true[4, ] <- c(0.5, 0.5, -0.6  ,-0.6, -0.6)
Data <- Fcomp_Model(n = n_train, p = p, m = 0, intercept = TRUE,
                    SNR = 2, sigma = 2,
                    rho_X = 0, rho_T = 0.5, df_beta = df_beta,
                    n_T = 20, obs_spar = 1, theta.add = c(3,4,5),
                    beta_C = as.vector(t(beta_C_true)))
m1 <- FuncompCGL(y = Data$data$y, X = Data$data$Comp , Zc = Data$data$Zc,
                 intercept = Data$data$intercept, k = df_beta)
arg_list <- as.list(Data$call)[-1]
arg_list$n <- n_test
TEST <- do.call(Fcomp_Model, arg_list)
predmat <- predict(m1, Znew = TEST$data$Comp, Zcnew = TEST$data$Zc)
predmat <- predict(m1, Znew = TEST$data$Comp, Zcnew = TEST$data$Zc, s = c(0.5, 0.1, 0.05))
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.