R/RcppExports.R

Defines functions gradient_API loss_API fit_ordinal loss_function grad_cpp pro gamma_fit_IWLS_method gamma_fit_approximate_newton_method

Documented in gamma_fit_approximate_newton_method gamma_fit_IWLS_method

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

#' @title gamma fit approximate newton method
#' @description fit gamma model with approximate newton method.
#' @param x Input matrix, of dimension \eqn{n \times p}; each row is an observation vector and each column is a predictor/feature/variable.
#' @param y The response variable, of \code{n} observations.
#' @param weights Observation weights.
#' @param beta Initial value of linear coefficient.
#' @param coef0 Initial value of intercept.
#' @param lambda L2 penalty coefficient.
#' @return Intercept and linear coefficient.
gamma_fit_approximate_newton_method <- function(x, y, weights, beta, coef0, lambda) {
    .Call('_StatComp21077_gamma_fit_approximate_newton_method', PACKAGE = 'StatComp21077', x, y, weights, beta, coef0, lambda)
}

#' @title gamma fit IWLS method
#' @description fit gamma model with IWLS method.
#' @param x Input matrix, of dimension \eqn{n \times p}; each row is an observation vector and each column is a predictor/feature/variable.
#' @param y The response variable, of \code{n} observations.
#' @param weights Observation weights.
#' @param beta Initial value of linear coefficient.
#' @param coef0 Initial value of intercept.
#' @param lambda L2 penalty coefficient.
#' @return Intercept and linear coefficient.
gamma_fit_IWLS_method <- function(x, y, weights, beta, coef0, lambda) {
    .Call('_StatComp21077_gamma_fit_IWLS_method', PACKAGE = 'StatComp21077', x, y, weights, beta, coef0, lambda)
}

pro <- function(X, beta, coef0) {
    .Call('_StatComp21077_pro', PACKAGE = 'StatComp21077', X, beta, coef0)
}

grad_cpp <- function(X, y, beta, coef0) {
    .Call('_StatComp21077_grad_cpp', PACKAGE = 'StatComp21077', X, y, beta, coef0)
}

loss_function <- function(X, y, weights, beta, coef0, lambda) {
    .Call('_StatComp21077_loss_function', PACKAGE = 'StatComp21077', X, y, weights, beta, coef0, lambda)
}

fit_ordinal <- function(X, y, weights, beta, coef0, lambda, primary_model_fit_max_iter, step0) {
    .Call('_StatComp21077_fit_ordinal', PACKAGE = 'StatComp21077', X, y, weights, beta, coef0, lambda, primary_model_fit_max_iter, step0)
}

loss_API <- function(n, X, y, beta, xpsexp) {
    .Call('_StatComp21077_loss_API', PACKAGE = 'StatComp21077', n, X, y, beta, xpsexp)
}

gradient_API <- function(n, X, y, beta, xpsexp) {
    .Call('_StatComp21077_gradient_API', PACKAGE = 'StatComp21077', n, X, y, beta, xpsexp)
}
bbayukari/StatComp21077 documentation built on March 21, 2022, 2:03 a.m.