Fast Logistic Regression Fitting Using L-BFGS Algorithm
Fast Logistic Regression Fitting Using L-BFGS Algorithm
fastLR() uses the L-BFGS algorithm to efficiently fit logistic regression. It is in fact an application of the C++ function optim_lbfgs() provided by RcppNumerical to perform L-BFGS optimization.
start: The initial guess of the coefficient vector.
eps_f: Iteration stops if ∣f−f′∣/∣f∣<epsf, where f and f′ are the current and previous value of the objective function (negative log likelihood) respectively.
eps_g: Iteration stops if ∣∣g∣∣<epsg∗max(1,∣∣beta∣∣), where beta is the current coefficient vector and g is the gradient.
maxit: Maximum number of iterations.
Returns
fastLR() returns a list with the following components: - coefficients: Coefficient vector
fitted.values: The fitted probability values
linear.predictors: The fitted values of the linear part, i.e., X∗betahat
loglikelihood: The maximized log likelihood
converged: Whether the optimization algorithm has converged