FOptDes | R Documentation |
Optimal Designs for Functional and Longitudinal Data for Trajectory Recovery or Scalar Response Prediction
FOptDes(
Ly,
Lt,
Resp,
p = 3,
optns = list(),
isRegression = !missing(Resp),
isSequential = FALSE,
RidgeCand = NULL
)
Ly |
A list of n vectors containing the observed values for each individual. Missing values specified by |
Lt |
A list of n vectors containing the observation time points for each individual corresponding to y. Each vector should be sorted in ascending order. |
Resp |
A vector of response values, keep void for trajectory recovery, only necessary for scalar response prediction task. |
p |
A fixed positive integer indicating the number of optimal design points requested, with default: 3. |
optns |
A list of options control parameters specified by |
isRegression |
A logical argument, indicating the purpose of the optimal designs: TRUE for scalar response prediction, FALSE for trajectory recovery, with default value !missing(Resp). |
isSequential |
A logical argument, indicating whether to use the sequential optimization procedure for faster computation, recommended for relatively large p (default: FALSE). |
RidgeCand |
A vector of positive numbers as ridge penalty candidates for regularization. The final value is selected via cross validation. If only 1 ridge parameter is specified, CV procedure is skipped. |
To select a proper RidgeCand, check with the returned optimal ridge parameter. If the selected parameter is the maximum/minimum values in the candidates, it is possible that the selected one is too small/big.
A list containing the following fields:
OptDes |
The vector of optimal design points of the regular time grid of the observed data. |
R2 |
Coefficient of determination. (Check the paper for details.) |
R2adj |
Adjusted coefficient of determination. |
OptRidge |
The selected ridge parameter. |
Ji, H., Müller, H.G. (2017) "Optimal Designs for Longitudinal and Functional Data" Journal of the Royal Statistical Society: Series B 79, 859-876.
set.seed(1)
n <- 50
pts <- seq(0, 1, by=0.05)
sampWiener <- Wiener(n, pts)
sampWiener <- MakeFPCAInputs(IDs = rep(1:n, each=length(pts)),
tVec = rep(pts, times = n),
yVec = t(sampWiener))
res <- FOptDes(Ly=sampWiener$Ly, Lt=sampWiener$Lt, p=2,
isSequential=FALSE, RidgeCand = seq(0.02,0.2,0.02))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.