lm_gradient: Fitting Linear Models with gradient

Description Usage Arguments Value

View source: R/lm_gradient.R

Description

lm_gradient is used to fit linear model with gradient or steepest descent.

Usage

1
2
3
4
5
6
7
8
9
lm_gradient(
  b,
  formula,
  data = NULL,
  maxit = 1000,
  tolerance = 1e-05,
  stepsize = 1e-04,
  fun = "sd"
)

Arguments

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

Value

the function returns an object of class "gradient"


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