tlars_model {tlars}R Documentation

Creates a Terminating-LARS (T-LARS) object

Description

Creates an object of the class tlars_cpp.

Usage

tlars_model(
  lars_state,
  X,
  y,
  num_dummies,
  verbose = FALSE,
  intercept = FALSE,
  standardize = TRUE,
  type = "lar",
  info = TRUE
)

Arguments

lars_state

List of variables associated with previous T-LARS step (necessary to restart the forward selection process exactly where it was previously terminated). The lars_state is extracted from an object of class tlars_cpp via get_all() and is only required when the object (or its pointer) of class tlars_cpp is deleted or got lost in another R session (e.g., in parallel processing).

X

Real valued predictor matrix.

y

Response vector.

num_dummies

Number of dummies that are appended to the predictor matrix.

verbose

Logical. If TRUE progress in computations is shown when performing T-LARS steps on the created model.

intercept

Logical. If TRUE an intercept is included.

standardize

Logical. If TRUE the predictors are standardized and the response is centered.

type

'lar' for 'LARS' and 'lasso' for Lasso.

info

Logical. If TRUE and object is not recreated from previous T-LARS state, then information about the created object is printed.

Value

Object of the class tlars_cpp.

Examples

data("Gauss_data")
X <- Gauss_data$X
y <- drop(Gauss_data$y)
p <- ncol(X)
n <- nrow(X)
num_dummies <- p
dummies <- matrix(stats::rnorm(n * p), nrow = n, ncol = num_dummies)
XD <- cbind(X, dummies)
mod_tlars <- tlars_model(X = XD, y = y, num_dummies = num_dummies)
mod_tlars

[Package tlars version 1.0.1 Index]