cv_trac: Perform cross validation for tuning parameter selection

Description Usage Arguments

View source: R/cv_trac.R

Description

This function is to be called after calling trac. It performs nfold-fold cross validation.

Usage

1
2
3
4
5
6
7
8
9
cv_trac(
  fit,
  Z,
  y,
  A,
  folds = NULL,
  nfolds = 5,
  summary_function = stats::median
)

Arguments

fit

output of trac function.

Z, y, A

same arguments as passed to trac

folds

a partition of 1:nrow(Z).

nfolds

number of folds for cross-validation

summary_function

how to combine the errors calculated on each observation within a fold (e.g. mean or median)


jacobbien/trac documentation built on Oct. 18, 2021, 9:30 p.m.