tune.par.vsflcm: tune key parameters(K,lambda,lam.nuc,lam.smo) using cross...

Description Usage Arguments Author(s)

View source: R/tune.par.vsflcm.R

Description

tune key parameters(K,lambda,lam.nuc,lam.smo) using cross validation in vsflcm, if you don't want to tune the parameter by yourself, this is for you.

Usage

1
2
3
4
5
6
7
tune.par.vsflcm(formula, data = NULL, id.time = NULL, id.sub = NULL,
  t.min = NULL, t.max = NULL, seed.split = 4, num.fold = 3,
  thre = 0.9, fpc.on = TRUE, intercept = TRUE, K = NULL,
  lambdas = 10^seq(-2, 2, 1), lam.smos = c(0, 10^seq(-2, 2, 1)),
  lam.nucs = c(0, 10^seq(-2, 2, 1)), K0 = 2, spline.fun = "B-spline",
  method.obj = "nuclear", K.max = 10, delta = 0.1,
  method.optim = "BFGS", times = 1, spline.fun2d = NULL, maxit = 200)

Arguments

formula

formula for the regression. should have form y ~ V1 + V2 + ... + Vk. Note: don't contain id.time

data

data frame

id.time

the variable that represents time

id.sub

variable giving subject ID

t.min

minimum value to be evaluated on the time domain. if 'NULL', taken to be minium observed value.

t.max

maximum value to be evaluated on the time domain. if 'NULL', taken to be minium observed value.

seed.split

seed to randomly split the data set into training set and test set

num.fold

num.fold-fold cross validation

thre

when automaticly chosing K, K will be chosen as the smallest one which ensures that the model can explain thre of the total variance.

fpc.on

Logical. Whether fpc will be used

intercept

logical, whether intercept is used

K

number of spline basis functions for coefficients and fpc. If default this function will automaticly choose K. Otherwise you need to provide a value.

lambdas

tuning parameter vector for lambda to choose from

lam.smos

tuning parameter vector for lam.smo to choose from

lam.nucs

tuning parameter vector for lam.nuc to choose from

K0

number of FPCs

spline.fun

spline basis functions. If not default, it should be a function taking a vector(corresponding to time) belonging to [0,1] as input and returning a length(vector)*K spline matrix where each row corresponds to a time point in the vector and each column corresponds to a spline basis function

method.obj

the methodology chosen. Should be 'nuclear' or 'nonconvex'. Typically, we recommend 'nuclear'

K.max

max K can be chosen automaticly, only useful when K is NULL

delta

Only useful when method.obj='nonconvex'. When the square of the norm of the coefficient is smaller than delta, L1 penalty will smoothly turned into L2 penalty

method.optim

the optimization method to be used. For details and other options, please refer to optim

times

Only useful when method.obj='nonconvex'. the algorithm randomly chooses times initial points to optimize and select the best

spline.fun2d

second derivative of spline.fun, if spline.fun is default then the second derivative will be computed automaticly and you don't need to provide values for spline.fun2d. Otherwise you need to provide a function with input and output dimensions in accordance with spline.fun if you want to model the smoothness.

maxit

maxit of optim

Author(s)

Hongming Pu phmhappier@163.com


Hongming-Pu/vsFlcm documentation built on May 28, 2019, 12:41 p.m.