irls.lr: Iteratively Re-weighted Least Squares

View source: R/LogisticRegression.R

irls.lrR Documentation

Iteratively Re-weighted Least Squares

Description

Optimisation procedure based on iteratively re-weighted least squares, called by lr.

Usage

irls.lr(y, x, init = NULL, tol = 1e-06, maxiter = 100)

Arguments

y

response vector

x

model matrix of covariates

init

initial estimate of theta

tol

tolerance parameter, default 1e-6

maxiter

optional number of iterations

Details

Iterative method used to find parameter estimates of \beta from the least squares problem

\beta = argmin (z - X\beta)^T W (z- X\beta),

where W is a diagonal matrix of weights with i-th diagonal element being

\sigma(x_i ; \beta) (1 - \sigma(x_i ; \beta)),

and z is the vector

z = X \beta + W^{-1} (y - \sigma(x_i ; \beta)).

The parameter vector \beta is updated iteratively with a Newton update of the form

\beta = (X^T W X)^{-1} X^T W z.

Value

a list containing

par

a vector of estimates of theta, the parameters being optimised

val

the value of the log-likelihood at the final theta estimate

iters

the number of iterations needed to converge


dannyjameswilliams/danielR documentation built on Aug. 20, 2023, 3:25 a.m.