R/RcppExports.R

Defines functions block_mat_mul simuh_dir_cpp estimate_pve evd_dnorm_hess_stan evd_dnorm_stan evd_dnorm_grad_stan evd_dnorm

Documented in estimate_pve evd_dnorm evd_dnorm_grad_stan evd_dnorm_hess_stan evd_dnorm_stan

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

#' RSSp marginalized likelihood function
#'
#' Compute the negative of the marginalized RSSp log-likelihood
#' @template RSSp_stat
#' @export
evd_dnorm <- function(par, D, quh) {
    .Call('_RSSp_evd_dnorm', PACKAGE = 'RSSp', par, D, quh)
}

#' Gradient for RSSp likelihood
#' This is an attempt to use stan's AD features to optimize the RSSp likelihood
#' @template RSSp_stat
#' @export
evd_dnorm_grad_stan <- function(par, D, quh) {
    .Call('_RSSp_evd_dnorm_grad_stan', PACKAGE = 'RSSp', par, D, quh)
}

#' evd_dnorm_grad_stan
#'
#' This is an attempt to use stan's AD features to calculate a gradient
#' for the RSSp likelihood
#'
#' @template RSSp_stat
#' @export
evd_dnorm_stan <- function(par, D, quh) {
    .Call('_RSSp_evd_dnorm_stan', PACKAGE = 'RSSp', par, D, quh)
}

#' evd_dnorm_hess_stan
#' 
#' This is an attempt to use stan's AD features to calculate a hessian 
#' for the RSSp likelihood
#' 
#' @template RSSp_stat
#' @export
evd_dnorm_hess_stan <- function(par, D, quh) {
    .Call('_RSSp_evd_dnorm_hess_stan', PACKAGE = 'RSSp', par, D, quh)
}

#' compute pve with confounding
#' @param cvec vector with length equal to the number of terms used to fit the model that contains parameter estimates
#' @param D vector of eigenvalues
#' @param quh vector of transformed summary statistics (must have length equal to quh)
#' @param sample_size integer giving sample size of original GWAS
#' @export
estimate_pve <- function(cvec, D, quh, sample_size) {
    .Call('_RSSp_estimate_pve', PACKAGE = 'RSSp', cvec, D, quh, sample_size)
}

simuh_dir_cpp <- function(sigu, bias, nreps, Q, D, fgeneids, usim) {
    .Call('_RSSp_simuh_dir_cpp', PACKAGE = 'RSSp', sigu, bias, nreps, Q, D, fgeneids, usim)
}

block_mat_mul <- function(mat_l, ymat, transpose_mat_l = FALSE) {
    .Call('_RSSp_block_mat_mul', PACKAGE = 'RSSp', mat_l, ymat, transpose_mat_l)
}
CreRecombinase/RSSp documentation built on April 10, 2021, 6:31 a.m.