R/RcppExports.R

Defines functions count_nonlin_cpp sampling_nonlin_cpp sampling_nonlin_r call_xptr bisection_cpp bisection_r count_auto_mult count_stepwise_multi count_mult sampling_mult ppp_mult rpm_mat sum_options rep_options rpdirichlet rdirichlet sampling_hitandrun count_auto_bin count_stepwise_bin count_bin sampling_bin ppp_bin rbeta_trunc rgamma_trunc adj_iterative start_random count_samples inside_Ab

Documented in rpdirichlet

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

inside_Ab <- function(X, A, b) {
    .Call(`_multinomineq_inside_Ab`, X, A, b)
}

count_samples <- function(X, A, b) {
    .Call(`_multinomineq_count_samples`, X, A, b)
}

start_random <- function(A, b, M, start) {
    .Call(`_multinomineq_start_random`, A, b, M, start)
}

adj_iterative <- function(par, c = .50, DIFF_BOUND = 0.0) {
    .Call(`_multinomineq_adj_iterative`, par, c, DIFF_BOUND)
}

rgamma_trunc <- function(shape, rate, min, max) {
    .Call(`_multinomineq_rgamma_trunc`, shape, rate, min, max)
}

rbeta_trunc <- function(shape1, shape2, min, max) {
    .Call(`_multinomineq_rbeta_trunc`, shape1, shape2, min, max)
}

ppp_bin <- function(prob, k, n) {
    .Call(`_multinomineq_ppp_bin`, prob, k, n)
}

sampling_bin <- function(k, n, A, b, prior, M, start, burnin = 5L, progress = TRUE) {
    .Call(`_multinomineq_sampling_bin`, k, n, A, b, prior, M, start, burnin, progress)
}

count_bin <- function(k, n, A, b, prior, M, batch, progress = TRUE) {
    .Call(`_multinomineq_count_bin`, k, n, A, b, prior, M, batch, progress)
}

count_stepwise_bin <- function(k, n, A, b, prior, M, steps, batch, start, burnin, progress = TRUE) {
    .Call(`_multinomineq_count_stepwise_bin`, k, n, A, b, prior, M, steps, batch, start, burnin, progress)
}

count_auto_bin <- function(k, n, A, b, prior, count, M, steps, M_iter, cmin, maxiter, start, burnin, progress = TRUE) {
    .Call(`_multinomineq_count_auto_bin`, k, n, A, b, prior, count, M, steps, M_iter, cmin, maxiter, start, burnin, progress)
}

sampling_hitandrun <- function(A, b, M, start, burnin = 5L, progress = TRUE) {
    .Call(`_multinomineq_sampling_hitandrun`, A, b, M, start, burnin, progress)
}

rdirichlet <- function(n, alpha) {
    .Call(`_multinomineq_rdirichlet`, n, alpha)
}

#' Random Samples from the Product-Dirichlet Distribution
#'
#' Random samples from the prior/posterior (i.e., product-Dirichlet) of the unconstrained
#' product-multinomial model (the encompassing model).
#'
#' @param n number of samples
#' @param alpha Dirichlet parameters concatenated across independent conditions
#'     (e.g., a1,a2,  b1,b2,b3)
#' @param options the number of choice options per item type, e.g., \code{c(2,3)}
#'     for a binary and ternary condition.
#'     The sum of \code{options} must be equal to the length of \code{alpha}.
#' @param drop_fixed whether the output matrix includes the last probability for each category
#'     (which is not a free parameter since probabilities must sum to one).
#'
#' @examples
#' # standard uniform Dirichlet
#' rpdirichlet(5, c(1,1,1,1), 4)
#' rpdirichlet(5, c(1,1,1,1), 4, drop_fixed = FALSE)
#'
#' # two ternary outcomes: (a1,a2,a3,  b1,b2,b3)
#' rpdirichlet(5, c(9,5,1,  3,6,6), c(3,3))
#' rpdirichlet(5, c(9,5,1,  3,6,6), c(3,3), drop_fixed = FALSE)
#' @export
rpdirichlet <- function(n, alpha, options, drop_fixed = TRUE) {
    .Call(`_multinomineq_rpdirichlet`, n, alpha, options, drop_fixed)
}

rep_options <- function(x, options) {
    .Call(`_multinomineq_rep_options`, x, options)
}

sum_options <- function(k, options) {
    .Call(`_multinomineq_sum_options`, k, options)
}

rpm_mat <- function(prob, n, options) {
    .Call(`_multinomineq_rpm_mat`, prob, n, options)
}

ppp_mult <- function(prob, k, options) {
    .Call(`_multinomineq_ppp_mult`, prob, k, options)
}

sampling_mult <- function(k, options, A, b, prior, M, start, burnin = 5L, progress = TRUE) {
    .Call(`_multinomineq_sampling_mult`, k, options, A, b, prior, M, start, burnin, progress)
}

count_mult <- function(k, options, A, b, prior, M, batch, progress = TRUE) {
    .Call(`_multinomineq_count_mult`, k, options, A, b, prior, M, batch, progress)
}

count_stepwise_multi <- function(k, options, A, b, prior, M, steps, batch, start, burnin, progress = TRUE) {
    .Call(`_multinomineq_count_stepwise_multi`, k, options, A, b, prior, M, steps, batch, start, burnin, progress)
}

count_auto_mult <- function(k, options, A, b, prior, count, M, steps, M_iter, cmin, maxiter, start, burnin, progress = TRUE) {
    .Call(`_multinomineq_count_auto_mult`, k, options, A, b, prior, count, M, steps, M_iter, cmin, maxiter, start, burnin, progress)
}

bisection_r <- function(f, x, i, min, max, eps = 1e-10) {
    .Call(`_multinomineq_bisection_r`, f, x, i, min, max, eps)
}

bisection_cpp <- function(f_, x, i, min, max, eps = 1e-10) {
    .Call(`_multinomineq_bisection_cpp`, f_, x, i, min, max, eps)
}

call_xptr <- function(f_, x) {
    .Call(`_multinomineq_call_xptr`, f_, x)
}

sampling_nonlin_r <- function(k, options, inside, prior, M, start, burnin = 5L, progress = TRUE, eps = 1e-10) {
    .Call(`_multinomineq_sampling_nonlin_r`, k, options, inside, prior, M, start, burnin, progress, eps)
}

sampling_nonlin_cpp <- function(k, options, inside_, prior, M, start, burnin = 5L, progress = TRUE, eps = 1e-10) {
    .Call(`_multinomineq_sampling_nonlin_cpp`, k, options, inside_, prior, M, start, burnin, progress, eps)
}

count_nonlin_cpp <- function(k, options, inside_, prior, M, batch, progress = TRUE) {
    .Call(`_multinomineq_count_nonlin_cpp`, k, options, inside_, prior, M, batch, progress)
}

Try the multinomineq package in your browser

Any scripts or data that you put into this service are public.

multinomineq documentation built on Nov. 22, 2022, 5:09 p.m.