Obtain the optimal sparsity parameter given a search grid based on cross validation score with replications.
tunelambda(data, time, ode.model, par.names, state.names,
par.initial, basis.list,lambda_grid,cv_portion,kfolds, rep,controls)
The original input vector of a search grid for the optimal lambda.
The matrix contains the cross validation score for each lambda of each replication
A data frame or matrix contrain observations from each dimension of the ODE model.
The vector contain observation times or a matrix if time points are different between dimensions.
Defined R function that computes the time derivative of the ODE model given observations of states variable.
The names of structural parameters defined in the 'ode.model'.
The names of state variables defined in the 'ode.model'.
Initial value of structural parameters to be optimized.
A list of basis objects for smoothing each dimension's observations. Can be the same or different across dimensions.
A search grid for finding the optimial sparsity parameter lambda.
A number indicating the proportion of data will be saved for doing cross validation. Default is set at 5 as minimum.
A number indicating the number of folds the data should be seprated into.
A integer controls the number of replication of doing cross-validation for each penalty parameter.
A list of control parameters. See ‘Details’.