train_talasso: Do parameter tuning for Twin Adaptive Lasso (TALasso)

View source: R/train.R

train_talassoR Documentation

Do parameter tuning for Twin Adaptive Lasso (TALasso)

Description

If all variables are killed in the first step: return a random number
If more than 1 variables are left: just repeat the training process for alasso
If only 1 variable remained: use a brute-force process do the cross-validation.
FOR FUTURE WORK: INCORPORATE TALASSO INTO CARET FRAMEWORK.

Usage

train_talasso(
  x,
  y,
  b_first,
  gamma = 1,
  intercept = TRUE,
  scalex = FALSE,
  train_method = "timeslice",
  lambda_seq = NULL,
  nlambda = 100,
  lambda_min_ratio = 1e-04,
  k = 10,
  initial_window = ceiling(nrow(x) * 0.7),
  horizon = 1,
  fixed_window = TRUE,
  skip = 0
)

Arguments

x

Predictor matrix (n-by-p matrix)

y

Response variable

b_first

estimated slope from first step alasso

gamma

Parameter controlling the inverse of first step estimate. By default = 1.

intercept

A boolean: include an intercept term or not

scalex

A boolean: standardize the design matrix or not

train_method

"timeslice", "cv", "aic", "bic", "aicc", "hqc"

lambda_seq

Candidate sequnece of parameters. If NULL, the function generates the sequnce.

nlambda

# of lambdas

lambda_min_ratio

# lambda_min_ratio * lambda_max = lambda_min

k

k-fold cv if "cv" is chosen

initial_window

control "timeslice"

horizon

control "timeslice"

fixed_window

control "timeslice"

skip

control "timeslice"

Value

bestTune

Examples

train_talasso(x,y)

zhan-gao/LasForecast documentation built on Sept. 18, 2024, 9:40 p.m.