R/RcppExports.R

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

#' @title Compute COM-Poisson normalizing constante in log scale
#' @description Computes the normalizing constant in the log scale
#'   usign the LogSumExp trick to avoid numerical issues (See details).
#' @details \code{logspace_add(a, b) = log(exp(a) + exp(b)) = b + log(1
#'   + exp(a - b))}, where \code{b > a}.
#' @param loglambda A vector of logarithm of the \eqn{\lambda}
#'   parameter.
#' @param mu A vector of the \eqn{\mu} parameter.
#' @param nu A vector of dispersion parameters \eqn{\nu}.
#' @return The normalizing constant.
#' @references Wikipedia, LogSumExp. \url{http://rstudio.com}.
#' @author Eduardo Jr <edujrrib@gmail.com>
#' @export
compute_logz <- function(loglambda, mu, nu) {
    .Call(`_flexcm_compute_logz`, loglambda, mu, nu)
}

#' @title Compute Double Poisson normalizing constante in log scale
#' @description Computes the normalizing constant in the log scale
#'   usign the LogSumExp trick to avoid numerical issues (See details).
#' @details \code{logspace_add(a, b) = log(exp(a) + exp(b)) = b + log(1
#'   + exp(a - b))}, where \code{b > a}.
#' @param mu a vector of the \eqn{\mu} parameter.
#' @param lmu logarithm of \eqn{\mu}.
#' @param phi value of \eqn{\varphi} parameter.
#' @param lphi logarithm of \eqn{\varphi}.
#' @return The normalizing constant.
#' @references Wikipedia, LogSumExp. \url{http://rstudio.com}.
#' @author Eduardo Jr <edujrrib@gmail.com>
#' @export
compute_logk <- function(mu, lmu, phi, lphi) {
    .Call(`_flexcm_compute_logk`, mu, lmu, phi, lphi)
}
jreduardo/flexcm documentation built on May 8, 2019, 12:41 p.m.