R/RcppExports.R

Defines functions create_prior_xptr user_gev_flat user_gev_norm user_gp_flat log_j_xptr kgaps_log_j kgaps_logpost_xptr dgaps_logpost kgaps_logpost os_logpost_phi_xptr pp_logpost_phi_xptr gev_logpost_phi_xptr gp_logpost_phi_xptr pp_user_logpost_phi pp_quant_logpost_phi pp_prob_logpost_phi pp_beta_logpost_phi pp_flatflat_logpost_phi pp_flat_logpost_phi pp_loglognorm_logpost_phi pp_norm_logpost_phi pp_mdi_logpost_phi os_user_logpost_phi os_quant_logpost_phi os_prob_logpost_phi os_beta_logpost_phi os_flatflat_logpost_phi os_flat_logpost_phi os_loglognorm_logpost_phi os_norm_logpost_phi os_mdi_logpost_phi gev_user_logpost_phi gev_quant_logpost_phi gev_prob_logpost_phi gev_beta_logpost_phi gev_flatflat_logpost_phi gev_flat_logpost_phi gev_loglognorm_logpost_phi gev_norm_logpost_phi gev_mdi_logpost_phi gp_user_logpost_phi gp_beta_logpost_phi gp_jeffreys_logpost_phi gp_flatflat_logpost_phi gp_flat_logpost_phi gp_norm_logpost_phi gp_mdi_logpost_phi phi_to_theta_xptr kgaps_phi_to_theta pp_phi_to_theta gev_phi_to_theta gp_phi_to_theta pp_logpost_xptr os_logpost_xptr gev_logpost_xptr gp_logpost_xptr os_quant_logpost os_prob_logpost os_beta_logpost os_flatflat_logpost os_flat_logpost os_loglognorm_logpost os_norm_logpost os_mdi_logpost pp_quant_logpost pp_prob_logpost pp_beta_logpost pp_flatflat_logpost pp_flat_logpost pp_loglognorm_logpost pp_norm_logpost pp_mdi_logpost gev_quant_logpost gev_prob_logpost gev_beta_logpost gev_flatflat_logpost gev_flat_logpost gev_loglognorm_logpost gev_norm_logpost gev_mdi_logpost gp_beta_logpost gp_jeffreys_logpost gp_flatflat_logpost gp_flat_logpost gp_norm_logpost gp_mdi_logpost pp_user_logpost os_user_logpost gev_user_logpost gp_user_logpost cpp_gev_quant cpp_gev_prob qgev_cpp pgev_cpp lgdgev_cpp cpp_gev_beta cpp_gev_flatflat cpp_gev_flat cpp_gev_mdi cpp_gev_loglognorm cpp_gev_norm cpp_gp_beta cpp_gp_jeffreys cpp_gp_flatflat cpp_gp_flat cpp_gp_mdi cpp_gp_norm cpp_pp_loglik cpp_os_loglik cpp_gev_loglik cpp_gp_loglik any_nonpos

Documented in create_prior_xptr

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

any_nonpos <- function(x) {
    .Call(`_revdbayes_any_nonpos`, x)
}

cpp_gp_loglik <- function(x, ss) {
    .Call(`_revdbayes_cpp_gp_loglik`, x, ss)
}

cpp_gev_loglik <- function(x, ss) {
    .Call(`_revdbayes_cpp_gev_loglik`, x, ss)
}

cpp_os_loglik <- function(x, ss) {
    .Call(`_revdbayes_cpp_os_loglik`, x, ss)
}

cpp_pp_loglik <- function(x, ss) {
    .Call(`_revdbayes_cpp_pp_loglik`, x, ss)
}

cpp_gp_norm <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gp_norm`, x, ppars)
}

cpp_gp_mdi <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gp_mdi`, x, ppars)
}

cpp_gp_flat <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gp_flat`, x, ppars)
}

cpp_gp_flatflat <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gp_flatflat`, x, ppars)
}

cpp_gp_jeffreys <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gp_jeffreys`, x, ppars)
}

cpp_gp_beta <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gp_beta`, x, ppars)
}

cpp_gev_norm <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gev_norm`, x, ppars)
}

cpp_gev_loglognorm <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gev_loglognorm`, x, ppars)
}

cpp_gev_mdi <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gev_mdi`, x, ppars)
}

cpp_gev_flat <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gev_flat`, x, ppars)
}

cpp_gev_flatflat <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gev_flatflat`, x, ppars)
}

cpp_gev_beta <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gev_beta`, x, ppars)
}

lgdgev_cpp <- function(x, loc, scale, shape) {
    .Call(`_revdbayes_lgdgev_cpp`, x, loc, scale, shape)
}

pgev_cpp <- function(q, loc, scale, shape) {
    .Call(`_revdbayes_pgev_cpp`, q, loc, scale, shape)
}

qgev_cpp <- function(p, loc, scale, shape) {
    .Call(`_revdbayes_qgev_cpp`, p, loc, scale, shape)
}

cpp_gev_prob <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gev_prob`, x, ppars)
}

cpp_gev_quant <- function(x, ppars) {
    .Call(`_revdbayes_cpp_gev_quant`, x, ppars)
}

gp_user_logpost <- function(x, pars) {
    .Call(`_revdbayes_gp_user_logpost`, x, pars)
}

gev_user_logpost <- function(x, pars) {
    .Call(`_revdbayes_gev_user_logpost`, x, pars)
}

os_user_logpost <- function(x, pars) {
    .Call(`_revdbayes_os_user_logpost`, x, pars)
}

pp_user_logpost <- function(x, pars) {
    .Call(`_revdbayes_pp_user_logpost`, x, pars)
}

gp_mdi_logpost <- function(x, pars) {
    .Call(`_revdbayes_gp_mdi_logpost`, x, pars)
}

gp_norm_logpost <- function(x, pars) {
    .Call(`_revdbayes_gp_norm_logpost`, x, pars)
}

gp_flat_logpost <- function(x, pars) {
    .Call(`_revdbayes_gp_flat_logpost`, x, pars)
}

gp_flatflat_logpost <- function(x, pars) {
    .Call(`_revdbayes_gp_flatflat_logpost`, x, pars)
}

gp_jeffreys_logpost <- function(x, pars) {
    .Call(`_revdbayes_gp_jeffreys_logpost`, x, pars)
}

gp_beta_logpost <- function(x, pars) {
    .Call(`_revdbayes_gp_beta_logpost`, x, pars)
}

gev_mdi_logpost <- function(x, pars) {
    .Call(`_revdbayes_gev_mdi_logpost`, x, pars)
}

gev_norm_logpost <- function(x, pars) {
    .Call(`_revdbayes_gev_norm_logpost`, x, pars)
}

gev_loglognorm_logpost <- function(x, pars) {
    .Call(`_revdbayes_gev_loglognorm_logpost`, x, pars)
}

gev_flat_logpost <- function(x, pars) {
    .Call(`_revdbayes_gev_flat_logpost`, x, pars)
}

gev_flatflat_logpost <- function(x, pars) {
    .Call(`_revdbayes_gev_flatflat_logpost`, x, pars)
}

gev_beta_logpost <- function(x, pars) {
    .Call(`_revdbayes_gev_beta_logpost`, x, pars)
}

gev_prob_logpost <- function(x, pars) {
    .Call(`_revdbayes_gev_prob_logpost`, x, pars)
}

gev_quant_logpost <- function(x, pars) {
    .Call(`_revdbayes_gev_quant_logpost`, x, pars)
}

pp_mdi_logpost <- function(x, pars) {
    .Call(`_revdbayes_pp_mdi_logpost`, x, pars)
}

pp_norm_logpost <- function(x, pars) {
    .Call(`_revdbayes_pp_norm_logpost`, x, pars)
}

pp_loglognorm_logpost <- function(x, pars) {
    .Call(`_revdbayes_pp_loglognorm_logpost`, x, pars)
}

pp_flat_logpost <- function(x, pars) {
    .Call(`_revdbayes_pp_flat_logpost`, x, pars)
}

pp_flatflat_logpost <- function(x, pars) {
    .Call(`_revdbayes_pp_flatflat_logpost`, x, pars)
}

pp_beta_logpost <- function(x, pars) {
    .Call(`_revdbayes_pp_beta_logpost`, x, pars)
}

pp_prob_logpost <- function(x, pars) {
    .Call(`_revdbayes_pp_prob_logpost`, x, pars)
}

pp_quant_logpost <- function(x, pars) {
    .Call(`_revdbayes_pp_quant_logpost`, x, pars)
}

os_mdi_logpost <- function(x, pars) {
    .Call(`_revdbayes_os_mdi_logpost`, x, pars)
}

os_norm_logpost <- function(x, pars) {
    .Call(`_revdbayes_os_norm_logpost`, x, pars)
}

os_loglognorm_logpost <- function(x, pars) {
    .Call(`_revdbayes_os_loglognorm_logpost`, x, pars)
}

os_flat_logpost <- function(x, pars) {
    .Call(`_revdbayes_os_flat_logpost`, x, pars)
}

os_flatflat_logpost <- function(x, pars) {
    .Call(`_revdbayes_os_flatflat_logpost`, x, pars)
}

os_beta_logpost <- function(x, pars) {
    .Call(`_revdbayes_os_beta_logpost`, x, pars)
}

os_prob_logpost <- function(x, pars) {
    .Call(`_revdbayes_os_prob_logpost`, x, pars)
}

os_quant_logpost <- function(x, pars) {
    .Call(`_revdbayes_os_quant_logpost`, x, pars)
}

gp_logpost_xptr <- function(fstr) {
    .Call(`_revdbayes_gp_logpost_xptr`, fstr)
}

gev_logpost_xptr <- function(fstr) {
    .Call(`_revdbayes_gev_logpost_xptr`, fstr)
}

os_logpost_xptr <- function(fstr) {
    .Call(`_revdbayes_os_logpost_xptr`, fstr)
}

pp_logpost_xptr <- function(fstr) {
    .Call(`_revdbayes_pp_logpost_xptr`, fstr)
}

gp_phi_to_theta <- function(phi, user_args) {
    .Call(`_revdbayes_gp_phi_to_theta`, phi, user_args)
}

gev_phi_to_theta <- function(phi, user_args) {
    .Call(`_revdbayes_gev_phi_to_theta`, phi, user_args)
}

pp_phi_to_theta <- function(phi, user_args) {
    .Call(`_revdbayes_pp_phi_to_theta`, phi, user_args)
}

kgaps_phi_to_theta <- function(phi, user_args) {
    .Call(`_revdbayes_kgaps_phi_to_theta`, phi, user_args)
}

phi_to_theta_xptr <- function(fstr) {
    .Call(`_revdbayes_phi_to_theta_xptr`, fstr)
}

gp_mdi_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gp_mdi_logpost_phi`, phi, pars)
}

gp_norm_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gp_norm_logpost_phi`, phi, pars)
}

gp_flat_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gp_flat_logpost_phi`, phi, pars)
}

gp_flatflat_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gp_flatflat_logpost_phi`, phi, pars)
}

gp_jeffreys_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gp_jeffreys_logpost_phi`, phi, pars)
}

gp_beta_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gp_beta_logpost_phi`, phi, pars)
}

gp_user_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gp_user_logpost_phi`, phi, pars)
}

gev_mdi_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gev_mdi_logpost_phi`, phi, pars)
}

gev_norm_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gev_norm_logpost_phi`, phi, pars)
}

gev_loglognorm_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gev_loglognorm_logpost_phi`, phi, pars)
}

gev_flat_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gev_flat_logpost_phi`, phi, pars)
}

gev_flatflat_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gev_flatflat_logpost_phi`, phi, pars)
}

gev_beta_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gev_beta_logpost_phi`, phi, pars)
}

gev_prob_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gev_prob_logpost_phi`, phi, pars)
}

gev_quant_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gev_quant_logpost_phi`, phi, pars)
}

gev_user_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_gev_user_logpost_phi`, phi, pars)
}

os_mdi_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_os_mdi_logpost_phi`, phi, pars)
}

os_norm_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_os_norm_logpost_phi`, phi, pars)
}

os_loglognorm_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_os_loglognorm_logpost_phi`, phi, pars)
}

os_flat_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_os_flat_logpost_phi`, phi, pars)
}

os_flatflat_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_os_flatflat_logpost_phi`, phi, pars)
}

os_beta_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_os_beta_logpost_phi`, phi, pars)
}

os_prob_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_os_prob_logpost_phi`, phi, pars)
}

os_quant_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_os_quant_logpost_phi`, phi, pars)
}

os_user_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_os_user_logpost_phi`, phi, pars)
}

pp_mdi_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_pp_mdi_logpost_phi`, phi, pars)
}

pp_norm_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_pp_norm_logpost_phi`, phi, pars)
}

pp_loglognorm_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_pp_loglognorm_logpost_phi`, phi, pars)
}

pp_flat_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_pp_flat_logpost_phi`, phi, pars)
}

pp_flatflat_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_pp_flatflat_logpost_phi`, phi, pars)
}

pp_beta_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_pp_beta_logpost_phi`, phi, pars)
}

pp_prob_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_pp_prob_logpost_phi`, phi, pars)
}

pp_quant_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_pp_quant_logpost_phi`, phi, pars)
}

pp_user_logpost_phi <- function(phi, pars) {
    .Call(`_revdbayes_pp_user_logpost_phi`, phi, pars)
}

gp_logpost_phi_xptr <- function(fstr) {
    .Call(`_revdbayes_gp_logpost_phi_xptr`, fstr)
}

gev_logpost_phi_xptr <- function(fstr) {
    .Call(`_revdbayes_gev_logpost_phi_xptr`, fstr)
}

pp_logpost_phi_xptr <- function(fstr) {
    .Call(`_revdbayes_pp_logpost_phi_xptr`, fstr)
}

os_logpost_phi_xptr <- function(fstr) {
    .Call(`_revdbayes_os_logpost_phi_xptr`, fstr)
}

kgaps_logpost <- function(x, pars) {
    .Call(`_revdbayes_kgaps_logpost`, x, pars)
}

dgaps_logpost <- function(x, pars) {
    .Call(`_revdbayes_dgaps_logpost`, x, pars)
}

kgaps_logpost_xptr <- function(fstr) {
    .Call(`_revdbayes_kgaps_logpost_xptr`, fstr)
}

kgaps_log_j <- function(theta, user_args) {
    .Call(`_revdbayes_kgaps_log_j`, theta, user_args)
}

log_j_xptr <- function(fstr) {
    .Call(`_revdbayes_log_j_xptr`, fstr)
}

user_gp_flat <- function(x, ppars) {
    .Call(`_revdbayes_user_gp_flat`, x, ppars)
}

user_gev_norm <- function(x, ppars) {
    .Call(`_revdbayes_user_gev_norm`, x, ppars)
}

user_gev_flat <- function(x, ppars) {
    .Call(`_revdbayes_user_gev_flat`, x, ppars)
}

#' Create an external pointer to a C++ prior
#'
#' This function provides an example of a way in which a user can specify
#' their own prior density to \code{\link{rpost_rcpp}}.
#' More specifically, a function like this (the user will need to create
#' an edited version tailored to their own C++ function(s)) can be used to
#' generate an external pointer to a compiled C++ function that evaluates
#' the log-prior density.  Please see the vignette
#' "Faster simulation using revdbayes" for more information.
#'
#' @details
#' Suppose that the user's C++ functions are in a file called "user_fns.cpp".
#' These functions must be compiled and made available to R before the
#' pointer is created. This can be achieved using the function
#' \code{\link[Rcpp]{sourceCpp}} in the \strong{Rcpp} package
#' or using RStudio's Source button on the editor toolbar.
#'
#' For details see the examples in the documentation of the functions
#' \code{\link{rpost_rcpp}} and \code{\link{set_prior}},
#' the vignette "Faster simulation using revdbayes"
#' and the vignette "Rusting Faster: Simulation using Rcpp" in the package
#' \strong{rust}.
#'
#' @param fstr A string indicating the C++ function required.
#' @return An external pointer.
#' @seealso \code{\link{set_prior}} to specify a prior distribution using
#'   an external pointer returned by \code{create_prior_xptr} and for
#'   details of in-built named prior distributions.
#' @seealso The examples in the documentation of \code{\link{rpost_rcpp}}.
#' @examples
#' ptr_gp_flat <- create_prior_xptr("gp_flat")
#' prior_cfn <- set_prior(prior = ptr_gp_flat, model = "gp", min_xi = -1)
#'
#' ptr_gev_flat <- create_prior_xptr("gev_flat")
#' prior_cfn <- set_prior(prior = ptr_gev_flat, model = "gev", min_xi = -1,
#'                        max_xi = Inf)
#'
#' mat <- diag(c(10000, 10000, 100))
#' ptr_gev_norm <- create_prior_xptr("gev_norm")
#' pn_u <- set_prior(prior = ptr_gev_norm, model = "gev", mean = c(0,0,0),
#'                   icov = solve(mat))
#' @export
create_prior_xptr <- function(fstr) {
    .Call(`_revdbayes_create_prior_xptr`, fstr)
}

# Register entry points for exported C++ functions
methods::setLoadAction(function(ns) {
    .Call(`_revdbayes_RcppExport_registerCCallable`)
})
paulnorthrop/revdbayes documentation built on March 20, 2024, 1:01 a.m.