R/RcppExports.R

Defines functions fit_V_UV_const fit_V_VU_const fit_U_UV_const fit_U_VU_const lasso

Documented in fit_U_UV_const fit_U_VU_const fit_V_UV_const fit_V_VU_const lasso

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Fit lasso model (one iteration)
#'
#' Minimize .5|| Y - XB ||^2_2 + gamma |B|_1
#'
#' @param X NxP matrix of covariates.
#' @param Y N-vector of response.
#' @param B P-vector of coefficents.
#' @param lambda P-vector L1 regulation coeffs.
#' @param niter Integer, number of lasso iterations to perform.
#' @param fixd Integer, passed from R to indicate the column of the data
#'   during the inspre loop. Set to current column index to fix the diagonal
#'   of the result to 1.
#' @export
lasso <- function(X, Y, B, lambda, niter, fixd = -1L) {
    .Call(`_inspre_lasso`, X, Y, B, lambda, niter, fixd)
}

#' Fit U satisfying VU = I
#'
#' @param WX
#' @param W
#' @param V
#' @param U
#' @param theta
#' @param rho
#' @param gamma
#' @param solve_its
#' @param fixd
#' @param nthreads
#' @export
fit_U_VU_const <- function(WX, W, V, U, theta, rho, gamma = 0, solve_its = 10L, fixd = FALSE, nthreads = 1L) {
    .Call(`_inspre_fit_U_VU_const`, WX, W, V, U, theta, rho, gamma, solve_its, fixd, nthreads)
}

#' Fit U satisfying UV = I
#'
#' @param WX
#' @param W
#' @param V
#' @param U
#' @param theta
#' @param rho
#' @param gamma
#' @param solve_its
#' @param fixd
#' @param nthreads
#' @export
fit_U_UV_const <- function(WX, W, V, U, theta, rho, gamma = 0, solve_its = 10L, fixd = FALSE, nthreads = 1L) {
    .Call(`_inspre_fit_U_UV_const`, WX, W, V, U, theta, rho, gamma, solve_its, fixd, nthreads)
}

#' Fit V satisfying VU = I
#'
#' @param V
#' @param U
#' @param theta
#' @param rho
#' @param lambda
#' @param solve_its
#' @param fixd
#' @param nthreads
#' @export
fit_V_VU_const <- function(V, U, theta, rho, lambda = 0, solve_its = 10L, fixd = FALSE, nthreads = 1L) {
    .Call(`_inspre_fit_V_VU_const`, V, U, theta, rho, lambda, solve_its, fixd, nthreads)
}

#' Fit V satisfying VU = I
#'
#' @param V
#' @param U
#' @param theta
#' @param rho
#' @param lambda
#' @param solve_its
#' @param fixd
#' @param nthreads
#' @export
fit_V_UV_const <- function(V, U, theta, rho, lambda = 0, solve_its = 10L, fixd = FALSE, nthreads = 1L) {
    .Call(`_inspre_fit_V_UV_const`, V, U, theta, rho, lambda, solve_its, fixd, nthreads)
}
brielin/inspre documentation built on Dec. 3, 2023, 4:55 a.m.