first_order_glm: First-Order GLM Maximum Likelihood Solution

Description Usage Arguments Value Examples

View source: R/first_order_glm.R

Description

First-Order GLM Maximum Likelihood Solution

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
first_order_glm(
  X,
  y,
  mu_fun,
  maxit = 100,
  tol = 1e-10,
  size,
  adapt = FALSE,
  gamma = 0.9
)

Arguments

X

A matrix of independent variables

y

A vector of response variable

mu_fun

The function specifying the mean function in exponential family

maxit

Maximum number of iterations

tol

Tolerance for the convergence

size

A number specifying the constant step size in gradient descent

adapt

A logical value. If TRUE, we use momentum gradient descent. If FALSE, we use constant step size

gamma

A parameter controlling the momentum update

Value

A vector of fitted regression coefficients.

Examples

1
## Not run: first_order_glm(X, y,mu_fun = function(eta) exp(eta), size = 0.00001,adapt = FALSE,maxit = 1000)

siqiangsu/bis557 documentation built on Dec. 21, 2020, 2:15 a.m.