CCI.direction: Choose Direction for testing for the CCI test

View source: R/CCI.direction.R

CCI.directionR Documentation

Choose Direction for testing for the CCI test

Description

This function selects the best direction for the CCI test based on cross validation. For the condition Y || X | Z, the function return the recommended formula either Y ~ X | Z or X ~ Y | Z .

Usage

CCI.direction(
  formula,
  data,
  method = "rf",
  folds = 4,
  nrounds = 600,
  max_depth = 6,
  eta = 0.3,
  gamma = 0,
  colsample_bytree = 1,
  min_child_weight = 1,
  subsample = 1,
  poly = TRUE,
  degree = 3,
  interaction = TRUE,
  verbose = FALSE,
  ...
)

Arguments

formula

A formula object specifying the model to be fitted.

data

A data frame containing the variables specified in the formula.

method

A character string specifying the method to be used for model fitting. Options include "rf" (random forest), "xgboost" (XGBoost), "nnet" (neural network), "gpr" (Gaussian process regression), and "svm" (support vector machine).

folds

An integer specifying the number of folds for cross-validation. Default is 4.

nrounds

Integer. The number of rounds (trees) for methods like xgboost, ranger, and lightgbm. Default is 600.

max_depth

Integer. The maximum depth of the trees for methods like xgboost. Default is 6.

eta

Numeric. The learning rate for methods like xgboost. Default is 0.3.

gamma

Numeric. The minimum loss reduction required to make a further partition on a leaf node of the tree for methods like xgboost. Default is 0.

colsample_bytree

Numeric. The subsample ratio of columns when constructing each tree for methods like xgboost. Default is 1.

min_child_weight

Numeric. The minimum sum of instance weight (hessian) needed in a child for methods like xgboost. Default is 1.

subsample

Numeric. The proportion of the data to be used for subsampling. Default is 1 (no subsampling).

poly

Logical. If TRUE, polynomial terms of the conditioning variables are included in the model. Default is TRUE.

degree

Integer. The degree of polynomial terms to include if poly is TRUE. Default is 3.

interaction

Logical. If TRUE, interaction terms of the conditioning variables are included in the model. Default is TRUE.

verbose

Logical. If TRUE, prints additional information during the execution. Default is FALSE.

...

Additional arguments to be passed to the model fitting function.

Value

A formula object specifying the selected model direction.


CCI documentation built on Aug. 29, 2025, 5:17 p.m.