irls.lr: Iteratively Re-weighted Least Squares

Description Usage Arguments Details Value

View source: R/LogisticRegression.R

Description

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

Usage

1
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 β from the least squares problem

β = argmin (z - Xβ)^T W (z- Xβ),

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

σ(x_i ; β) (1 - σ(x_i ; β)),

and z is the vector

z = X β + W^{-1} (y - σ(x_i ; β)).

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

β = (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 Feb. 1, 2021, 6:39 p.m.