R/RcppExports.R

Defines functions gbsamplerC

Documented in gbsamplerC

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

#' @title A Gibbs sampler using Rcpp
#' @description A specific Gibbs sampler for 2 dimension (x,y) with bivariate density using Rcpp
#' @param m numbers of sample want to generate 
#' @param a the a parameter in Beta(x+a,n-x+b)
#' @param b the b parameter in Beta(x+a,n-x+b)
#' @param n the n parameter in Binomial(n,y)
#' @return a matrix including two random sample with dimension of (\code{m},2)
#' @examples
#' \dontrun{
#'   dir_cpp <- '/data/cenmin/statistical computing/Rcpp/'
#'   sourceCpp(paste0(dir_cpp,"GBSampler.cpp"))
#'   set.seed(12)
#'   m = 10000
#'   a = 2
#'   b = 3
#'   n = 5
#'   t1 <- proc.time()
#'   xC <- gbsamplerC(m,a,b,n)
#'   t2 <- proc.time()
#'   t <- t2-t1
#'   paste0(t[3][[1]],'s') 
#' } 
#' @export
gbsamplerC <- function(m, a, b, n) {
    .Call(`_StatComp21097_gbsamplerC`, m, a, b, n)
}
mimic0127/StatComp21097 documentation built on Dec. 24, 2021, 1:28 a.m.