tunelambda: Find optimial penalty parameter lambda by cross-validation.

View source: R/PCODE.R

tunelambdaR Documentation

Find optimial penalty parameter lambda by cross-validation.

Description

Obtain the optimal sparsity parameter given a search grid based on cross validation score with replications.

Usage

tunelambda(data, time, ode.model, par.names, state.names,
                  par.initial, basis.list,lambda_grid,cv_portion,kfolds, rep,controls)

Arguments

data

A data frame or matrix contrain observations from each dimension of the ODE model.

time

The vector contain observation times or a matrix if time points are different between dimensions.

ode.model

Defined R function that computes the time derivative of the ODE model given observations of states variable.

par.names

The names of structural parameters defined in the 'ode.model'.

state.names

The names of state variables defined in the 'ode.model'.

par.initial

Initial value of structural parameters to be optimized.

basis.list

A list of basis objects for smoothing each dimension's observations. Can be the same or different across dimensions.

lambda_grid

A search grid for finding the optimial sparsity parameter lambda.

cv_portion

A number indicating the proportion of data will be saved for doing cross validation. Default is set at 5 as minimum.

kfolds

A number indicating the number of folds the data should be seprated into.

rep

A integer controls the number of replication of doing cross-validation for each penalty parameter.

controls

A list of control parameters. See ‘Details’.

Value

lambda_grid

The original input vector of a search grid for the optimal lambda.

cv.score

The matrix contains the cross validation score for each lambda of each replication


pCODE documentation built on Sept. 8, 2022, 9:06 a.m.