R/RcppExports.R

Defines functions logLike_negbin nll_max_alpha nll_max_beta par_bootstrap_mle inverse_FIM logistic_misclassification_mle em

Documented in em inverse_FIM logistic_misclassification_mle logLike_negbin nll_max_alpha nll_max_beta par_bootstrap_mle

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

#' EM algorithm to compute the MLE for beta regression with rounded responses
#'
#' @param y a n-vector of response
#' @param x a n x p matrix of design
#' @param theta vector of parameter
#' @param maxit maximum number of iteration
#' @param eps tolerance
#' @param verbose boolean for printing information
#' @export
em <- function(y, x, theta, maxit = 30L, eps = 1e-7, verbose = TRUE) {
    .Call('_IBpaper_em', PACKAGE = 'IBpaper', y, x, theta, maxit, eps, verbose)
}

#' MLE for logistic regression with misclassified responses
#'
#' @param x a n x p matrix of design
#' @param y a n-vector of response
#' @param fp false positive rate
#' @param fn false negative rate
#' @export
logistic_misclassification_mle <- function(x, y, fp, fn) {
    .Call('_IBpaper_logistic_misclassification_mle', PACKAGE = 'IBpaper', x, y, fp, fn)
}

#' Inverse Fisher information matrix for logistic regression with misclassified
#' responses
#'
#' @param x a n x p matrix of design
#' @param beta a p-vector of parameter
#' @param fp false positive rate
#' @param fn false negative rate
#' @export
inverse_FIM <- function(x, beta, fp, fn) {
    .Call('_IBpaper_inverse_FIM', PACKAGE = 'IBpaper', x, beta, fp, fn)
}

#' Parametric bootstrap for logistic regression with misclassified responses
#'
#' @param beta a p-vector of parameter
#' @param x a n x p design matrix
#' @param B the number of bootstrap replicates
#' @param seed for random number generator
#' @param ncores number of cores for parallelisation
#' @param fp false positive rate
#' @param fn false negative rate
#' @export
par_bootstrap_mle <- function(beta, x, B, seed, ncores, fp = 0, fn = 0) {
    .Call('_IBpaper_par_bootstrap_mle', PACKAGE = 'IBpaper', beta, x, B, seed, ncores, fp, fn)
}

#' Negative log-likelihood for beta coefficients (negative binomial regression)
#'
#' @param beta a p-vector of coefficients
#' @param alpha parameter of negative binomial
#' @param y a n-vector of response
#' @param x a n x p matrix of design
#' @param lambda mean of Poisson censoring process
#' @export
nll_max_beta <- function(beta, alpha, y, x, lambda) {
    .Call('_IBpaper_nll_max_beta', PACKAGE = 'IBpaper', beta, alpha, y, x, lambda)
}

#' Negative log-likelihood for the overdispersion parameter (negative binomial regression)
#'
#' @param alpha parameter of negative binomial
#' @param beta a p-vector of coefficients
#' @param y a n-vector of response
#' @param x a n x p matrix of design
#' @param lambda mean of Poisson censoring process
#' @export
nll_max_alpha <- function(alpha, beta, y, x, lambda) {
    .Call('_IBpaper_nll_max_alpha', PACKAGE = 'IBpaper', alpha, beta, y, x, lambda)
}

#' Log-likelihood for negative binomial with interfered responses
#'
#' @param beta a p-vector of coefficients
#' @param alpha overdispersion parameter of negative binomial
#' @param y a n-vector of response
#' @param x a n x p matrix of design
#' @param lambda mean of Poisson censoring process
#' @export
logLike_negbin <- function(beta, alpha, y, x, lambda) {
    .Call('_IBpaper_logLike_negbin', PACKAGE = 'IBpaper', beta, alpha, y, x, lambda)
}
samorso/IBpaper documentation built on April 29, 2022, 10:21 p.m.