cv.FastStepGraph {FastStepGraph}R Documentation

Searches for the optimal combination of alpha_f and alpha_b parameters using Cross-Validation

Description

cv.FastStepGraph implements the cross-validation for the Fast Step Graph algorithm.

Usage

cv.FastStepGraph(
  x,
  n_folds = 5,
  alpha_f_min = 0.2,
  alpha_f_max = 0.8,
  b_coef = 0.5,
  n_alpha = 32,
  nei.max = 5,
  data_scale = FALSE,
  data_shuffle = TRUE,
  max.iterations = NULL,
  return_model = FALSE,
  parallel = FALSE,
  n_cores = NULL
)

Arguments

x

Data matrix (of size n x p).

n_folds

Number of folds for the cross-validation procedure (default value 5).

alpha_f_min

Minimum threshold value for the cross-validation procedure (default value 0.2).

alpha_f_max

Minimum threshold value for the cross-validation procedure (default value 0.8).

b_coef

This parameter applies the empirical rule alpha_b=b_coef*alpha_f during the initial search for the optimal alpha_f parameter while alpha_b remains fixed, after finding optimal alpha_f, alpha_b is varied to find its optimal value. The default value of b_coef is 0.5.

n_alpha

Number of elements in the grid for the cross-validation (default value 32).

nei.max

Maximum number of variables in every neighborhood (default value 5).

data_scale

Boolean parameter (TRUE or FALSE), when to scale data to zero mean and unit variance (default FALSE).

data_shuffle

Boolean parameter (default TRUE), when samples (rows of X) must be randomly shuffled.

max.iterations

Maximum number of iterations (integer), the defaults values is set to p*(p-1).

return_model

Default FALSE. If set to TRUE, at the end of cross-validation, FastStepGraph is called with the optimal parameters alpha_f and alpha_b, returning vareps, beta, Edges and Omega.

parallel

Boolean parameter (TRUE or FALSE), when to run Cross-Validation in parallel using a multicore architecture (default FALSE).

n_cores

An 'int' value specifying the number of cores do you want to use if 'parallel=TRUE'. If n_cores is not specified, the maximum number of cores on your machine minus one will be set automatically.

Value

A list with the values:

alpha_f_opt

the optimal alpha_f value.

alpha_f_opt

the optimal alpha_f value.

CV.loss

minimum loss.

If return_model=TRUE, then also returns:

vareps

Response variables.

beta

Regression coefficients.

Edges

Estimated set of edges.

Omega

Estimated precision matrix.

Author(s)

Prof. Juan G. Colonna, PhD. juancolonna@icomp.ufam.edu.br

Prof. Marcelo Ruiz, PhD. mruiz@exa.unrc.edu.ar

Examples

data <- FastStepGraph::SigmaAR(30, 50, 0.4) # Simulate Gaussian Data
res <- FastStepGraph::cv.FastStepGraph(data$X, data_scale=TRUE)

[Package FastStepGraph version 0.1.1 Index]