glm_adapt: Gradient Descent for GLM (adaptive step)

Description Usage Arguments Value Author(s) Examples

View source: R/gradient_descent_glm.R

Description

Implement a first-order solution for the GLM maximum likelihood problem using only gradient information, avoiding the Hessian matrix.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
glm_adapt(
  X,
  Y,
  mu_fun,
  var_fun,
  maxit = 1e+06,
  tol = 1e-10,
  gamma = 1e-05,
  m = 0.9
)

Arguments

X

design matrix

Y

response vector

mu_fun

function from eta to the expected value

maxit

integer maximum number of iterations

tol

numeric tolerance parameter

gamma

The step size

mom

momentum parameter

Value

a list of beta coefficients

Author(s)

Yijun Yang

Examples

1
2
3
4
## Not run: 
glm_adapt(X, Y, mu_fun = function(eta) 1/(1+exp(-eta)), var_fun = function(eta) eta)

## End(Not run)

yijunyang/bis557 documentation built on Dec. 21, 2020, 3:06 a.m.