lm_gradient_cv: Cross validation for Linear Models with gradient

Description Usage Arguments Value

View source: R/lm_gradient_cv.R

Description

lm_gradient_cv is used to perform a k-fold cross validation to a linear model with gradient or steepest descent.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
lm_gradient_cv(
  n.folds,
  b,
  formula,
  data = NULL,
  maxit = 1000,
  tolerance = 1e-05,
  stepsize = 1e-04,
  fun = "sd",
  parallel = FALSE
)

Arguments

n.folds

number of folds (k)

b

initial values for beta

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted

data

an optional data frame, list or environment. If not found in data, the variables are taken from environment(formula)

maxit

number of max iterations of the algorithm

tolerance

the algorithm will stop if tolerance is reached

stepsize

size of each step (only for gradient descent)

fun

function can be sd for steepest descent or gd for gradient descent

parallel

perform the cross validation in multi-core

Value

the function returns an object of class "gradient"


vincnardelli/gradient documentation built on July 30, 2020, 9:57 a.m.