# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Update beta estimates using Newton-Raphson algorithm
#'
#' The beta-update step requires optimizing a convex function. This version of the update function
#' uses a Newton-Raphson approach to minimizing the objective function.
#'
#' @param X Covariate matrix (no column for intercept)
#' @param y Vector of observations (coded in -1/1)
#' @param u Current value of u vector (ADMM optimization)
#' @param z Current value of z vector (ADMM optimization)
#' @param rho Tuning parameter for ADMM optimization
#' @param maxiter Maximum number of iterations
#' @param toler Convergence criterion
#' @param b Backtracking tuning parameter
#' @param alpha Backtracking tuning parameter
#' @return Vector containing updated estimate of beta vector
b_updateC <- function(X, y, u, z, rho, maxiter = 50L, toler = 1e-5, b = 0.5, alpha = 0.1) {
.Call('_aeffp_b_updateC', PACKAGE = 'aeffp', X, y, u, z, rho, maxiter, toler, b, alpha)
}
#' Fit l1-penalized logistic regression model using ADMM
#'
#' Use an ADMM approach to find the parameters for a l1-penalized logistic regression model.
#' Finds solution to argmin_beta sum(log(1+-yX beta)) + lambda*sum(|beta|)
#'
#' @param X Covariate matrix (no column for intercept)
#' @param y Vector of observations (coded in -1/1)
#' @param lam Tuning parameter for lasso penalty
#' @param rho Tuning parameter for ADMM optimization
#' @param maxit Maximum number of iterations
#' @param tol Convergence criterion
#' @return Vector containing updated estimate of beta vector
admmlasso_logC <- function(X, y, lam, rho = 1e-3, maxit = 1000L, tol = 1e-3) {
.Call('_aeffp_admmlasso_logC', PACKAGE = 'aeffp', X, y, lam, rho, maxit, tol)
}
#' Update beta estimates using Newton-Raphson algorithm
#'
#' The beta-update step requires optimizing a convex function. This version of the update function
#' uses a Newton-Raphson approach to minimizing the objective function.
#'
#' @param X Covariate matrix (no column for intercept)
#' @param y Matrix of opportunities (col 1) and observations (col 2, coded in -1/1)
#' @param u Current value of u vector (ADMM optimization)
#' @param z Current value of z vector (ADMM optimization)
#' @param rho Tuning parameter for ADMM optimization
#' @param maxiter Maximum number of iterations
#' @param toler Convergence criterion
#' @param b Backtracking tuning parameter
#' @param alpha Backtracking tuning parameter
#' @return Vector containing updated estimate of beta vector
b_updateC_tabled <- function(X, y, u, z, rho, maxiter = 50L, toler = 1e-5, b = 0.5, alpha = 0.1) {
.Call('_aeffp_b_updateC_tabled', PACKAGE = 'aeffp', X, y, u, z, rho, maxiter, toler, b, alpha)
}
#' Fit l1-penalized logistic regression model using ADMM
#'
#' Use an ADMM approach to find the parameters for a l1-penalized logistic regression model.
#' Finds solution to argmin_beta sum(log(1+-yX beta)) + lambda*sum(|beta|)
#' Assumes that y is a matrix with the first column containing the total number of opportunities
#' for the event and the second column contains the number of occurrences.
#'
#' @param X Covariate matrix (no column for intercept)
#' @param y Vector of observations (coded in -1/1)
#' @param lam Tuning parameter for lasso penalty
#' @param rho Tuning parameter for ADMM optimization
#' @param maxit Maximum number of iterations
#' @param tol Convergence criterion
#' @return Vector containing updated estimate of beta vector
admmlasso_logC_tabled <- function(X, y, lam, rho = 1e-3, maxit = 1000L, tol = 1e-3) {
.Call('_aeffp_admmlasso_logC_tabled', PACKAGE = 'aeffp', X, y, lam, rho, maxit, tol)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.