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

#include "../inst/include/bayesm.h"
#include <RcppArmadillo.h>
#include <Rcpp.h>

using namespace Rcpp;

// bayesBLP_rcpp_loop
List bayesBLP_rcpp_loop(bool IV, mat const& X, mat const& Z, vec const& share, int J, int T, mat const& v, int R, vec const& sigmasqR, mat const& A, vec const& theta_hat, vec const& deltabar, mat const& Ad, double nu0, double s0_sq, mat const& VOmega, double ssq, mat const& cand_cov, vec const& theta_bar_initial, vec const& r_initial, double tau_sq_initial, mat const& Omega_initial, vec const& delta_initial, double tol, int keep, int nprint);
RcppExport SEXP _bayesm_bayesBLP_rcpp_loop(SEXP IVSEXP, SEXP XSEXP, SEXP ZSEXP, SEXP shareSEXP, SEXP JSEXP, SEXP TSEXP, SEXP vSEXP, SEXP RSEXP, SEXP sigmasqRSEXP, SEXP ASEXP, SEXP theta_hatSEXP, SEXP deltabarSEXP, SEXP AdSEXP, SEXP nu0SEXP, SEXP s0_sqSEXP, SEXP VOmegaSEXP, SEXP ssqSEXP, SEXP cand_covSEXP, SEXP theta_bar_initialSEXP, SEXP r_initialSEXP, SEXP tau_sq_initialSEXP, SEXP Omega_initialSEXP, SEXP delta_initialSEXP, SEXP tolSEXP, SEXP keepSEXP, SEXP nprintSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< bool >::type IV(IVSEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< vec const& >::type share(shareSEXP);
    Rcpp::traits::input_parameter< int >::type J(JSEXP);
    Rcpp::traits::input_parameter< int >::type T(TSEXP);
    Rcpp::traits::input_parameter< mat const& >::type v(vSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< vec const& >::type sigmasqR(sigmasqRSEXP);
    Rcpp::traits::input_parameter< mat const& >::type A(ASEXP);
    Rcpp::traits::input_parameter< vec const& >::type theta_hat(theta_hatSEXP);
    Rcpp::traits::input_parameter< vec const& >::type deltabar(deltabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Ad(AdSEXP);
    Rcpp::traits::input_parameter< double >::type nu0(nu0SEXP);
    Rcpp::traits::input_parameter< double >::type s0_sq(s0_sqSEXP);
    Rcpp::traits::input_parameter< mat const& >::type VOmega(VOmegaSEXP);
    Rcpp::traits::input_parameter< double >::type ssq(ssqSEXP);
    Rcpp::traits::input_parameter< mat const& >::type cand_cov(cand_covSEXP);
    Rcpp::traits::input_parameter< vec const& >::type theta_bar_initial(theta_bar_initialSEXP);
    Rcpp::traits::input_parameter< vec const& >::type r_initial(r_initialSEXP);
    Rcpp::traits::input_parameter< double >::type tau_sq_initial(tau_sq_initialSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Omega_initial(Omega_initialSEXP);
    Rcpp::traits::input_parameter< vec const& >::type delta_initial(delta_initialSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    rcpp_result_gen = Rcpp::wrap(bayesBLP_rcpp_loop(IV, X, Z, share, J, T, v, R, sigmasqR, A, theta_hat, deltabar, Ad, nu0, s0_sq, VOmega, ssq, cand_cov, theta_bar_initial, r_initial, tau_sq_initial, Omega_initial, delta_initial, tol, keep, nprint));
    return rcpp_result_gen;
END_RCPP
}
// breg
vec breg(vec const& y, mat const& X, vec const& betabar, mat const& A);
RcppExport SEXP _bayesm_breg(SEXP ySEXP, SEXP XSEXP, SEXP betabarSEXP, SEXP ASEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< vec const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    Rcpp::traits::input_parameter< vec const& >::type betabar(betabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type A(ASEXP);
    rcpp_result_gen = Rcpp::wrap(breg(y, X, betabar, A));
    return rcpp_result_gen;
END_RCPP
}
// cgetC
vec cgetC(double e, int k);
RcppExport SEXP _bayesm_cgetC(SEXP eSEXP, SEXP kSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type e(eSEXP);
    Rcpp::traits::input_parameter< int >::type k(kSEXP);
    rcpp_result_gen = Rcpp::wrap(cgetC(e, k));
    return rcpp_result_gen;
END_RCPP
}
// clusterMix_rcpp_loop
List clusterMix_rcpp_loop(mat const& zdraw, double cutoff, bool SILENT, int nprint);
RcppExport SEXP _bayesm_clusterMix_rcpp_loop(SEXP zdrawSEXP, SEXP cutoffSEXP, SEXP SILENTSEXP, SEXP nprintSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< mat const& >::type zdraw(zdrawSEXP);
    Rcpp::traits::input_parameter< double >::type cutoff(cutoffSEXP);
    Rcpp::traits::input_parameter< bool >::type SILENT(SILENTSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    rcpp_result_gen = Rcpp::wrap(clusterMix_rcpp_loop(zdraw, cutoff, SILENT, nprint));
    return rcpp_result_gen;
END_RCPP
}
// ghkvec
vec ghkvec(mat const& L, vec const& trunpt, vec const& above, int r, bool HALTON, vec pn);
RcppExport SEXP _bayesm_ghkvec(SEXP LSEXP, SEXP trunptSEXP, SEXP aboveSEXP, SEXP rSEXP, SEXP HALTONSEXP, SEXP pnSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< mat const& >::type L(LSEXP);
    Rcpp::traits::input_parameter< vec const& >::type trunpt(trunptSEXP);
    Rcpp::traits::input_parameter< vec const& >::type above(aboveSEXP);
    Rcpp::traits::input_parameter< int >::type r(rSEXP);
    Rcpp::traits::input_parameter< bool >::type HALTON(HALTONSEXP);
    Rcpp::traits::input_parameter< vec >::type pn(pnSEXP);
    rcpp_result_gen = Rcpp::wrap(ghkvec(L, trunpt, above, r, HALTON, pn));
    return rcpp_result_gen;
END_RCPP
}
// llmnl
double llmnl(vec const& beta, vec const& y, mat const& X);
RcppExport SEXP _bayesm_llmnl(SEXP betaSEXP, SEXP ySEXP, SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< vec const& >::type beta(betaSEXP);
    Rcpp::traits::input_parameter< vec const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(llmnl(beta, y, X));
    return rcpp_result_gen;
END_RCPP
}
// lndIChisq
mat lndIChisq(double nu, double ssq, mat const& X);
RcppExport SEXP _bayesm_lndIChisq(SEXP nuSEXP, SEXP ssqSEXP, SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< double >::type ssq(ssqSEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(lndIChisq(nu, ssq, X));
    return rcpp_result_gen;
END_RCPP
}
// lndIWishart
double lndIWishart(double nu, mat const& V, mat const& IW);
RcppExport SEXP _bayesm_lndIWishart(SEXP nuSEXP, SEXP VSEXP, SEXP IWSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    Rcpp::traits::input_parameter< mat const& >::type IW(IWSEXP);
    rcpp_result_gen = Rcpp::wrap(lndIWishart(nu, V, IW));
    return rcpp_result_gen;
END_RCPP
}
// lndMvn
double lndMvn(vec const& x, vec const& mu, mat const& rooti);
RcppExport SEXP _bayesm_lndMvn(SEXP xSEXP, SEXP muSEXP, SEXP rootiSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< vec const& >::type x(xSEXP);
    Rcpp::traits::input_parameter< vec const& >::type mu(muSEXP);
    Rcpp::traits::input_parameter< mat const& >::type rooti(rootiSEXP);
    rcpp_result_gen = Rcpp::wrap(lndMvn(x, mu, rooti));
    return rcpp_result_gen;
END_RCPP
}
// lndMvst
double lndMvst(vec const& x, double nu, vec const& mu, mat const& rooti, bool NORMC);
RcppExport SEXP _bayesm_lndMvst(SEXP xSEXP, SEXP nuSEXP, SEXP muSEXP, SEXP rootiSEXP, SEXP NORMCSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< vec const& >::type x(xSEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< vec const& >::type mu(muSEXP);
    Rcpp::traits::input_parameter< mat const& >::type rooti(rootiSEXP);
    Rcpp::traits::input_parameter< bool >::type NORMC(NORMCSEXP);
    rcpp_result_gen = Rcpp::wrap(lndMvst(x, nu, mu, rooti, NORMC));
    return rcpp_result_gen;
END_RCPP
}
// rDPGibbs_rcpp_loop
List rDPGibbs_rcpp_loop(int R, int keep, int nprint, mat y, List const& lambda_hyper, bool SCALE, int maxuniq, List const& PrioralphaList, int gridsize, double BayesmConstantA, int BayesmConstantnuInc, double BayesmConstantDPalpha);
RcppExport SEXP _bayesm_rDPGibbs_rcpp_loop(SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP, SEXP ySEXP, SEXP lambda_hyperSEXP, SEXP SCALESEXP, SEXP maxuniqSEXP, SEXP PrioralphaListSEXP, SEXP gridsizeSEXP, SEXP BayesmConstantASEXP, SEXP BayesmConstantnuIncSEXP, SEXP BayesmConstantDPalphaSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    Rcpp::traits::input_parameter< mat >::type y(ySEXP);
    Rcpp::traits::input_parameter< List const& >::type lambda_hyper(lambda_hyperSEXP);
    Rcpp::traits::input_parameter< bool >::type SCALE(SCALESEXP);
    Rcpp::traits::input_parameter< int >::type maxuniq(maxuniqSEXP);
    Rcpp::traits::input_parameter< List const& >::type PrioralphaList(PrioralphaListSEXP);
    Rcpp::traits::input_parameter< int >::type gridsize(gridsizeSEXP);
    Rcpp::traits::input_parameter< double >::type BayesmConstantA(BayesmConstantASEXP);
    Rcpp::traits::input_parameter< int >::type BayesmConstantnuInc(BayesmConstantnuIncSEXP);
    Rcpp::traits::input_parameter< double >::type BayesmConstantDPalpha(BayesmConstantDPalphaSEXP);
    rcpp_result_gen = Rcpp::wrap(rDPGibbs_rcpp_loop(R, keep, nprint, y, lambda_hyper, SCALE, maxuniq, PrioralphaList, gridsize, BayesmConstantA, BayesmConstantnuInc, BayesmConstantDPalpha));
    return rcpp_result_gen;
END_RCPP
}
// rbprobitGibbs_rcpp_loop
List rbprobitGibbs_rcpp_loop(vec const& y, mat const& X, vec const& Abetabar, mat const& root, vec beta, vec const& sigma, vec const& trunpt, vec const& above, int R, int keep, int nprint);
RcppExport SEXP _bayesm_rbprobitGibbs_rcpp_loop(SEXP ySEXP, SEXP XSEXP, SEXP AbetabarSEXP, SEXP rootSEXP, SEXP betaSEXP, SEXP sigmaSEXP, SEXP trunptSEXP, SEXP aboveSEXP, SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< vec const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    Rcpp::traits::input_parameter< vec const& >::type Abetabar(AbetabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type root(rootSEXP);
    Rcpp::traits::input_parameter< vec >::type beta(betaSEXP);
    Rcpp::traits::input_parameter< vec const& >::type sigma(sigmaSEXP);
    Rcpp::traits::input_parameter< vec const& >::type trunpt(trunptSEXP);
    Rcpp::traits::input_parameter< vec const& >::type above(aboveSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    rcpp_result_gen = Rcpp::wrap(rbprobitGibbs_rcpp_loop(y, X, Abetabar, root, beta, sigma, trunpt, above, R, keep, nprint));
    return rcpp_result_gen;
END_RCPP
}
// rdirichlet
vec rdirichlet(vec const& alpha);
RcppExport SEXP _bayesm_rdirichlet(SEXP alphaSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< vec const& >::type alpha(alphaSEXP);
    rcpp_result_gen = Rcpp::wrap(rdirichlet(alpha));
    return rcpp_result_gen;
END_RCPP
}
// rhierLinearMixture_rcpp_loop
List rhierLinearMixture_rcpp_loop(List const& regdata, mat const& Z, vec const& deltabar, mat const& Ad, mat const& mubar, mat const& Amu, double nu, mat const& V, double nu_e, vec const& ssq, int R, int keep, int nprint, bool drawdelta, mat olddelta, vec const& a, vec oldprob, vec ind, vec tau);
RcppExport SEXP _bayesm_rhierLinearMixture_rcpp_loop(SEXP regdataSEXP, SEXP ZSEXP, SEXP deltabarSEXP, SEXP AdSEXP, SEXP mubarSEXP, SEXP AmuSEXP, SEXP nuSEXP, SEXP VSEXP, SEXP nu_eSEXP, SEXP ssqSEXP, SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP, SEXP drawdeltaSEXP, SEXP olddeltaSEXP, SEXP aSEXP, SEXP oldprobSEXP, SEXP indSEXP, SEXP tauSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List const& >::type regdata(regdataSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< vec const& >::type deltabar(deltabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Ad(AdSEXP);
    Rcpp::traits::input_parameter< mat const& >::type mubar(mubarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Amu(AmuSEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    Rcpp::traits::input_parameter< double >::type nu_e(nu_eSEXP);
    Rcpp::traits::input_parameter< vec const& >::type ssq(ssqSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    Rcpp::traits::input_parameter< bool >::type drawdelta(drawdeltaSEXP);
    Rcpp::traits::input_parameter< mat >::type olddelta(olddeltaSEXP);
    Rcpp::traits::input_parameter< vec const& >::type a(aSEXP);
    Rcpp::traits::input_parameter< vec >::type oldprob(oldprobSEXP);
    Rcpp::traits::input_parameter< vec >::type ind(indSEXP);
    Rcpp::traits::input_parameter< vec >::type tau(tauSEXP);
    rcpp_result_gen = Rcpp::wrap(rhierLinearMixture_rcpp_loop(regdata, Z, deltabar, Ad, mubar, Amu, nu, V, nu_e, ssq, R, keep, nprint, drawdelta, olddelta, a, oldprob, ind, tau));
    return rcpp_result_gen;
END_RCPP
}
// rhierLinearModel_rcpp_loop
List rhierLinearModel_rcpp_loop(List const& regdata, mat const& Z, mat const& Deltabar, mat const& A, double nu, mat const& V, double nu_e, vec const& ssq, vec tau, mat Delta, mat Vbeta, int R, int keep, int nprint);
RcppExport SEXP _bayesm_rhierLinearModel_rcpp_loop(SEXP regdataSEXP, SEXP ZSEXP, SEXP DeltabarSEXP, SEXP ASEXP, SEXP nuSEXP, SEXP VSEXP, SEXP nu_eSEXP, SEXP ssqSEXP, SEXP tauSEXP, SEXP DeltaSEXP, SEXP VbetaSEXP, SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List const& >::type regdata(regdataSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Deltabar(DeltabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type A(ASEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    Rcpp::traits::input_parameter< double >::type nu_e(nu_eSEXP);
    Rcpp::traits::input_parameter< vec const& >::type ssq(ssqSEXP);
    Rcpp::traits::input_parameter< vec >::type tau(tauSEXP);
    Rcpp::traits::input_parameter< mat >::type Delta(DeltaSEXP);
    Rcpp::traits::input_parameter< mat >::type Vbeta(VbetaSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    rcpp_result_gen = Rcpp::wrap(rhierLinearModel_rcpp_loop(regdata, Z, Deltabar, A, nu, V, nu_e, ssq, tau, Delta, Vbeta, R, keep, nprint));
    return rcpp_result_gen;
END_RCPP
}
// rhierMnlDP_rcpp_loop
List rhierMnlDP_rcpp_loop(int R, int keep, int nprint, List const& lgtdata, mat const& Z, vec const& deltabar, mat const& Ad, List const& PrioralphaList, List const& lambda_hyper, bool drawdelta, int nvar, mat oldbetas, double s, int maxuniq, int gridsize, double BayesmConstantA, int BayesmConstantnuInc, double BayesmConstantDPalpha);
RcppExport SEXP _bayesm_rhierMnlDP_rcpp_loop(SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP, SEXP lgtdataSEXP, SEXP ZSEXP, SEXP deltabarSEXP, SEXP AdSEXP, SEXP PrioralphaListSEXP, SEXP lambda_hyperSEXP, SEXP drawdeltaSEXP, SEXP nvarSEXP, SEXP oldbetasSEXP, SEXP sSEXP, SEXP maxuniqSEXP, SEXP gridsizeSEXP, SEXP BayesmConstantASEXP, SEXP BayesmConstantnuIncSEXP, SEXP BayesmConstantDPalphaSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    Rcpp::traits::input_parameter< List const& >::type lgtdata(lgtdataSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< vec const& >::type deltabar(deltabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Ad(AdSEXP);
    Rcpp::traits::input_parameter< List const& >::type PrioralphaList(PrioralphaListSEXP);
    Rcpp::traits::input_parameter< List const& >::type lambda_hyper(lambda_hyperSEXP);
    Rcpp::traits::input_parameter< bool >::type drawdelta(drawdeltaSEXP);
    Rcpp::traits::input_parameter< int >::type nvar(nvarSEXP);
    Rcpp::traits::input_parameter< mat >::type oldbetas(oldbetasSEXP);
    Rcpp::traits::input_parameter< double >::type s(sSEXP);
    Rcpp::traits::input_parameter< int >::type maxuniq(maxuniqSEXP);
    Rcpp::traits::input_parameter< int >::type gridsize(gridsizeSEXP);
    Rcpp::traits::input_parameter< double >::type BayesmConstantA(BayesmConstantASEXP);
    Rcpp::traits::input_parameter< int >::type BayesmConstantnuInc(BayesmConstantnuIncSEXP);
    Rcpp::traits::input_parameter< double >::type BayesmConstantDPalpha(BayesmConstantDPalphaSEXP);
    rcpp_result_gen = Rcpp::wrap(rhierMnlDP_rcpp_loop(R, keep, nprint, lgtdata, Z, deltabar, Ad, PrioralphaList, lambda_hyper, drawdelta, nvar, oldbetas, s, maxuniq, gridsize, BayesmConstantA, BayesmConstantnuInc, BayesmConstantDPalpha));
    return rcpp_result_gen;
END_RCPP
}
// llmnl_con
double llmnl_con(vec const& betastar, vec const& y, mat const& X, vec const& SignRes);
RcppExport SEXP _bayesm_llmnl_con(SEXP betastarSEXP, SEXP ySEXP, SEXP XSEXP, SEXP SignResSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< vec const& >::type betastar(betastarSEXP);
    Rcpp::traits::input_parameter< vec const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    Rcpp::traits::input_parameter< vec const& >::type SignRes(SignResSEXP);
    rcpp_result_gen = Rcpp::wrap(llmnl_con(betastar, y, X, SignRes));
    return rcpp_result_gen;
END_RCPP
}
// rhierMnlRwMixture_rcpp_loop
List rhierMnlRwMixture_rcpp_loop(List const& lgtdata, mat const& Z, vec const& deltabar, mat const& Ad, mat const& mubar, mat const& Amu, double nu, mat const& V, double s, int R, int keep, int nprint, bool drawdelta, mat olddelta, vec const& a, vec oldprob, mat oldbetas, vec ind, vec const& SignRes);
RcppExport SEXP _bayesm_rhierMnlRwMixture_rcpp_loop(SEXP lgtdataSEXP, SEXP ZSEXP, SEXP deltabarSEXP, SEXP AdSEXP, SEXP mubarSEXP, SEXP AmuSEXP, SEXP nuSEXP, SEXP VSEXP, SEXP sSEXP, SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP, SEXP drawdeltaSEXP, SEXP olddeltaSEXP, SEXP aSEXP, SEXP oldprobSEXP, SEXP oldbetasSEXP, SEXP indSEXP, SEXP SignResSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List const& >::type lgtdata(lgtdataSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< vec const& >::type deltabar(deltabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Ad(AdSEXP);
    Rcpp::traits::input_parameter< mat const& >::type mubar(mubarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Amu(AmuSEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    Rcpp::traits::input_parameter< double >::type s(sSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    Rcpp::traits::input_parameter< bool >::type drawdelta(drawdeltaSEXP);
    Rcpp::traits::input_parameter< mat >::type olddelta(olddeltaSEXP);
    Rcpp::traits::input_parameter< vec const& >::type a(aSEXP);
    Rcpp::traits::input_parameter< vec >::type oldprob(oldprobSEXP);
    Rcpp::traits::input_parameter< mat >::type oldbetas(oldbetasSEXP);
    Rcpp::traits::input_parameter< vec >::type ind(indSEXP);
    Rcpp::traits::input_parameter< vec const& >::type SignRes(SignResSEXP);
    rcpp_result_gen = Rcpp::wrap(rhierMnlRwMixture_rcpp_loop(lgtdata, Z, deltabar, Ad, mubar, Amu, nu, V, s, R, keep, nprint, drawdelta, olddelta, a, oldprob, oldbetas, ind, SignRes));
    return rcpp_result_gen;
END_RCPP
}
// rhierNegbinRw_rcpp_loop
List rhierNegbinRw_rcpp_loop(List const& regdata, List const& hessdata, mat const& Z, mat Beta, mat Delta, mat const& Deltabar, mat const& Adelta, double nu, mat const& V, double a, double b, int R, int keep, double sbeta, double alphacroot, int nprint, mat rootA, double alpha, bool fixalpha);
RcppExport SEXP _bayesm_rhierNegbinRw_rcpp_loop(SEXP regdataSEXP, SEXP hessdataSEXP, SEXP ZSEXP, SEXP BetaSEXP, SEXP DeltaSEXP, SEXP DeltabarSEXP, SEXP AdeltaSEXP, SEXP nuSEXP, SEXP VSEXP, SEXP aSEXP, SEXP bSEXP, SEXP RSEXP, SEXP keepSEXP, SEXP sbetaSEXP, SEXP alphacrootSEXP, SEXP nprintSEXP, SEXP rootASEXP, SEXP alphaSEXP, SEXP fixalphaSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List const& >::type regdata(regdataSEXP);
    Rcpp::traits::input_parameter< List const& >::type hessdata(hessdataSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< mat >::type Beta(BetaSEXP);
    Rcpp::traits::input_parameter< mat >::type Delta(DeltaSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Deltabar(DeltabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Adelta(AdeltaSEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    Rcpp::traits::input_parameter< double >::type a(aSEXP);
    Rcpp::traits::input_parameter< double >::type b(bSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< double >::type sbeta(sbetaSEXP);
    Rcpp::traits::input_parameter< double >::type alphacroot(alphacrootSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    Rcpp::traits::input_parameter< mat >::type rootA(rootASEXP);
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< bool >::type fixalpha(fixalphaSEXP);
    rcpp_result_gen = Rcpp::wrap(rhierNegbinRw_rcpp_loop(regdata, hessdata, Z, Beta, Delta, Deltabar, Adelta, nu, V, a, b, R, keep, sbeta, alphacroot, nprint, rootA, alpha, fixalpha));
    return rcpp_result_gen;
END_RCPP
}
// rivDP_rcpp_loop
List rivDP_rcpp_loop(int R, int keep, int nprint, int dimd, vec const& mbg, mat const& Abg, vec const& md, mat const& Ad, vec const& y, bool isgamma, mat const& z, vec const& x, mat const& w, vec delta, List const& PrioralphaList, int gridsize, bool SCALE, int maxuniq, double scalex, double scaley, List const& lambda_hyper, double BayesmConstantA, int BayesmConstantnu);
RcppExport SEXP _bayesm_rivDP_rcpp_loop(SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP, SEXP dimdSEXP, SEXP mbgSEXP, SEXP AbgSEXP, SEXP mdSEXP, SEXP AdSEXP, SEXP ySEXP, SEXP isgammaSEXP, SEXP zSEXP, SEXP xSEXP, SEXP wSEXP, SEXP deltaSEXP, SEXP PrioralphaListSEXP, SEXP gridsizeSEXP, SEXP SCALESEXP, SEXP maxuniqSEXP, SEXP scalexSEXP, SEXP scaleySEXP, SEXP lambda_hyperSEXP, SEXP BayesmConstantASEXP, SEXP BayesmConstantnuSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    Rcpp::traits::input_parameter< int >::type dimd(dimdSEXP);
    Rcpp::traits::input_parameter< vec const& >::type mbg(mbgSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Abg(AbgSEXP);
    Rcpp::traits::input_parameter< vec const& >::type md(mdSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Ad(AdSEXP);
    Rcpp::traits::input_parameter< vec const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< bool >::type isgamma(isgammaSEXP);
    Rcpp::traits::input_parameter< mat const& >::type z(zSEXP);
    Rcpp::traits::input_parameter< vec const& >::type x(xSEXP);
    Rcpp::traits::input_parameter< mat const& >::type w(wSEXP);
    Rcpp::traits::input_parameter< vec >::type delta(deltaSEXP);
    Rcpp::traits::input_parameter< List const& >::type PrioralphaList(PrioralphaListSEXP);
    Rcpp::traits::input_parameter< int >::type gridsize(gridsizeSEXP);
    Rcpp::traits::input_parameter< bool >::type SCALE(SCALESEXP);
    Rcpp::traits::input_parameter< int >::type maxuniq(maxuniqSEXP);
    Rcpp::traits::input_parameter< double >::type scalex(scalexSEXP);
    Rcpp::traits::input_parameter< double >::type scaley(scaleySEXP);
    Rcpp::traits::input_parameter< List const& >::type lambda_hyper(lambda_hyperSEXP);
    Rcpp::traits::input_parameter< double >::type BayesmConstantA(BayesmConstantASEXP);
    Rcpp::traits::input_parameter< int >::type BayesmConstantnu(BayesmConstantnuSEXP);
    rcpp_result_gen = Rcpp::wrap(rivDP_rcpp_loop(R, keep, nprint, dimd, mbg, Abg, md, Ad, y, isgamma, z, x, w, delta, PrioralphaList, gridsize, SCALE, maxuniq, scalex, scaley, lambda_hyper, BayesmConstantA, BayesmConstantnu));
    return rcpp_result_gen;
END_RCPP
}
// rivGibbs_rcpp_loop
List rivGibbs_rcpp_loop(vec const& y, vec const& x, mat const& z, mat const& w, vec const& mbg, mat const& Abg, vec const& md, mat const& Ad, mat const& V, double nu, int R, int keep, int nprint);
RcppExport SEXP _bayesm_rivGibbs_rcpp_loop(SEXP ySEXP, SEXP xSEXP, SEXP zSEXP, SEXP wSEXP, SEXP mbgSEXP, SEXP AbgSEXP, SEXP mdSEXP, SEXP AdSEXP, SEXP VSEXP, SEXP nuSEXP, SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< vec const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< vec const& >::type x(xSEXP);
    Rcpp::traits::input_parameter< mat const& >::type z(zSEXP);
    Rcpp::traits::input_parameter< mat const& >::type w(wSEXP);
    Rcpp::traits::input_parameter< vec const& >::type mbg(mbgSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Abg(AbgSEXP);
    Rcpp::traits::input_parameter< vec const& >::type md(mdSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Ad(AdSEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    rcpp_result_gen = Rcpp::wrap(rivGibbs_rcpp_loop(y, x, z, w, mbg, Abg, md, Ad, V, nu, R, keep, nprint));
    return rcpp_result_gen;
END_RCPP
}
// rmixGibbs
List rmixGibbs(mat const& y, mat const& Bbar, mat const& A, double nu, mat const& V, vec const& a, vec const& p, vec const& z);
RcppExport SEXP _bayesm_rmixGibbs(SEXP ySEXP, SEXP BbarSEXP, SEXP ASEXP, SEXP nuSEXP, SEXP VSEXP, SEXP aSEXP, SEXP pSEXP, SEXP zSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< mat const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< mat const& >::type Bbar(BbarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type A(ASEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    Rcpp::traits::input_parameter< vec const& >::type a(aSEXP);
    Rcpp::traits::input_parameter< vec const& >::type p(pSEXP);
    Rcpp::traits::input_parameter< vec const& >::type z(zSEXP);
    rcpp_result_gen = Rcpp::wrap(rmixGibbs(y, Bbar, A, nu, V, a, p, z));
    return rcpp_result_gen;
END_RCPP
}
// rmixture
List rmixture(int n, vec pvec, List comps);
RcppExport SEXP _bayesm_rmixture(SEXP nSEXP, SEXP pvecSEXP, SEXP compsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< vec >::type pvec(pvecSEXP);
    Rcpp::traits::input_parameter< List >::type comps(compsSEXP);
    rcpp_result_gen = Rcpp::wrap(rmixture(n, pvec, comps));
    return rcpp_result_gen;
END_RCPP
}
// rmnlIndepMetrop_rcpp_loop
List rmnlIndepMetrop_rcpp_loop(int R, int keep, double nu, vec const& betastar, mat const& root, vec const& y, mat const& X, vec const& betabar, mat const& rootpi, mat const& rooti, double oldlimp, double oldlpost, int nprint);
RcppExport SEXP _bayesm_rmnlIndepMetrop_rcpp_loop(SEXP RSEXP, SEXP keepSEXP, SEXP nuSEXP, SEXP betastarSEXP, SEXP rootSEXP, SEXP ySEXP, SEXP XSEXP, SEXP betabarSEXP, SEXP rootpiSEXP, SEXP rootiSEXP, SEXP oldlimpSEXP, SEXP oldlpostSEXP, SEXP nprintSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< vec const& >::type betastar(betastarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type root(rootSEXP);
    Rcpp::traits::input_parameter< vec const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    Rcpp::traits::input_parameter< vec const& >::type betabar(betabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type rootpi(rootpiSEXP);
    Rcpp::traits::input_parameter< mat const& >::type rooti(rootiSEXP);
    Rcpp::traits::input_parameter< double >::type oldlimp(oldlimpSEXP);
    Rcpp::traits::input_parameter< double >::type oldlpost(oldlpostSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    rcpp_result_gen = Rcpp::wrap(rmnlIndepMetrop_rcpp_loop(R, keep, nu, betastar, root, y, X, betabar, rootpi, rooti, oldlimp, oldlpost, nprint));
    return rcpp_result_gen;
END_RCPP
}
// rmnpGibbs_rcpp_loop
List rmnpGibbs_rcpp_loop(int R, int keep, int nprint, int pm1, ivec const& y, mat const& X, vec const& beta0, mat const& sigma0, mat const& V, double nu, vec const& betabar, mat const& A);
RcppExport SEXP _bayesm_rmnpGibbs_rcpp_loop(SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP, SEXP pm1SEXP, SEXP ySEXP, SEXP XSEXP, SEXP beta0SEXP, SEXP sigma0SEXP, SEXP VSEXP, SEXP nuSEXP, SEXP betabarSEXP, SEXP ASEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    Rcpp::traits::input_parameter< int >::type pm1(pm1SEXP);
    Rcpp::traits::input_parameter< ivec const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    Rcpp::traits::input_parameter< vec const& >::type beta0(beta0SEXP);
    Rcpp::traits::input_parameter< mat const& >::type sigma0(sigma0SEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< vec const& >::type betabar(betabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type A(ASEXP);
    rcpp_result_gen = Rcpp::wrap(rmnpGibbs_rcpp_loop(R, keep, nprint, pm1, y, X, beta0, sigma0, V, nu, betabar, A));
    return rcpp_result_gen;
END_RCPP
}
// rmultireg
List rmultireg(mat const& Y, mat const& X, mat const& Bbar, mat const& A, double nu, mat const& V);
RcppExport SEXP _bayesm_rmultireg(SEXP YSEXP, SEXP XSEXP, SEXP BbarSEXP, SEXP ASEXP, SEXP nuSEXP, SEXP VSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< mat const& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Bbar(BbarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type A(ASEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    rcpp_result_gen = Rcpp::wrap(rmultireg(Y, X, Bbar, A, nu, V));
    return rcpp_result_gen;
END_RCPP
}
// rmvpGibbs_rcpp_loop
List rmvpGibbs_rcpp_loop(int R, int keep, int nprint, int p, ivec const& y, mat const& X, vec const& beta0, mat const& sigma0, mat const& V, double nu, vec const& betabar, mat const& A);
RcppExport SEXP _bayesm_rmvpGibbs_rcpp_loop(SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP, SEXP pSEXP, SEXP ySEXP, SEXP XSEXP, SEXP beta0SEXP, SEXP sigma0SEXP, SEXP VSEXP, SEXP nuSEXP, SEXP betabarSEXP, SEXP ASEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    Rcpp::traits::input_parameter< int >::type p(pSEXP);
    Rcpp::traits::input_parameter< ivec const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    Rcpp::traits::input_parameter< vec const& >::type beta0(beta0SEXP);
    Rcpp::traits::input_parameter< mat const& >::type sigma0(sigma0SEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< vec const& >::type betabar(betabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type A(ASEXP);
    rcpp_result_gen = Rcpp::wrap(rmvpGibbs_rcpp_loop(R, keep, nprint, p, y, X, beta0, sigma0, V, nu, betabar, A));
    return rcpp_result_gen;
END_RCPP
}
// rmvst
vec rmvst(double nu, vec const& mu, mat const& root);
RcppExport SEXP _bayesm_rmvst(SEXP nuSEXP, SEXP muSEXP, SEXP rootSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< vec const& >::type mu(muSEXP);
    Rcpp::traits::input_parameter< mat const& >::type root(rootSEXP);
    rcpp_result_gen = Rcpp::wrap(rmvst(nu, mu, root));
    return rcpp_result_gen;
END_RCPP
}
// rnegbinRw_rcpp_loop
List rnegbinRw_rcpp_loop(vec const& y, mat const& X, vec const& betabar, mat const& rootA, double a, double b, vec beta, double alpha, bool fixalpha, mat const& betaroot, double alphacroot, int R, int keep, int nprint);
RcppExport SEXP _bayesm_rnegbinRw_rcpp_loop(SEXP ySEXP, SEXP XSEXP, SEXP betabarSEXP, SEXP rootASEXP, SEXP aSEXP, SEXP bSEXP, SEXP betaSEXP, SEXP alphaSEXP, SEXP fixalphaSEXP, SEXP betarootSEXP, SEXP alphacrootSEXP, SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< vec const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    Rcpp::traits::input_parameter< vec const& >::type betabar(betabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type rootA(rootASEXP);
    Rcpp::traits::input_parameter< double >::type a(aSEXP);
    Rcpp::traits::input_parameter< double >::type b(bSEXP);
    Rcpp::traits::input_parameter< vec >::type beta(betaSEXP);
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< bool >::type fixalpha(fixalphaSEXP);
    Rcpp::traits::input_parameter< mat const& >::type betaroot(betarootSEXP);
    Rcpp::traits::input_parameter< double >::type alphacroot(alphacrootSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    rcpp_result_gen = Rcpp::wrap(rnegbinRw_rcpp_loop(y, X, betabar, rootA, a, b, beta, alpha, fixalpha, betaroot, alphacroot, R, keep, nprint));
    return rcpp_result_gen;
END_RCPP
}
// rnmixGibbs_rcpp_loop
List rnmixGibbs_rcpp_loop(mat const& y, mat const& Mubar, mat const& A, double nu, mat const& V, vec const& a, vec p, vec z, int const& R, int const& keep, int const& nprint);
RcppExport SEXP _bayesm_rnmixGibbs_rcpp_loop(SEXP ySEXP, SEXP MubarSEXP, SEXP ASEXP, SEXP nuSEXP, SEXP VSEXP, SEXP aSEXP, SEXP pSEXP, SEXP zSEXP, SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< mat const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< mat const& >::type Mubar(MubarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type A(ASEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    Rcpp::traits::input_parameter< vec const& >::type a(aSEXP);
    Rcpp::traits::input_parameter< vec >::type p(pSEXP);
    Rcpp::traits::input_parameter< vec >::type z(zSEXP);
    Rcpp::traits::input_parameter< int const& >::type R(RSEXP);
    Rcpp::traits::input_parameter< int const& >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int const& >::type nprint(nprintSEXP);
    rcpp_result_gen = Rcpp::wrap(rnmixGibbs_rcpp_loop(y, Mubar, A, nu, V, a, p, z, R, keep, nprint));
    return rcpp_result_gen;
END_RCPP
}
// rordprobitGibbs_rcpp_loop
List rordprobitGibbs_rcpp_loop(vec const& y, mat const& X, int k, mat const& A, vec const& betabar, mat const& Ad, double s, mat const& inc_root, vec const& dstarbar, vec const& betahat, int R, int keep, int nprint);
RcppExport SEXP _bayesm_rordprobitGibbs_rcpp_loop(SEXP ySEXP, SEXP XSEXP, SEXP kSEXP, SEXP ASEXP, SEXP betabarSEXP, SEXP AdSEXP, SEXP sSEXP, SEXP inc_rootSEXP, SEXP dstarbarSEXP, SEXP betahatSEXP, SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< vec const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    Rcpp::traits::input_parameter< int >::type k(kSEXP);
    Rcpp::traits::input_parameter< mat const& >::type A(ASEXP);
    Rcpp::traits::input_parameter< vec const& >::type betabar(betabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Ad(AdSEXP);
    Rcpp::traits::input_parameter< double >::type s(sSEXP);
    Rcpp::traits::input_parameter< mat const& >::type inc_root(inc_rootSEXP);
    Rcpp::traits::input_parameter< vec const& >::type dstarbar(dstarbarSEXP);
    Rcpp::traits::input_parameter< vec const& >::type betahat(betahatSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    rcpp_result_gen = Rcpp::wrap(rordprobitGibbs_rcpp_loop(y, X, k, A, betabar, Ad, s, inc_root, dstarbar, betahat, R, keep, nprint));
    return rcpp_result_gen;
END_RCPP
}
// rscaleUsage_rcpp_loop
List rscaleUsage_rcpp_loop(int k, mat const& x, int p, int n, int R, int keep, int ndghk, int nprint, mat y, vec mu, mat Sigma, vec tau, vec sigma, mat Lambda, double e, bool domu, bool doSigma, bool dosigma, bool dotau, bool doLambda, bool doe, double nu, mat const& V, mat const& mubar, mat const& Am, vec const& gsigma, vec const& gl11, vec const& gl22, vec const& gl12, int nuL, mat const& VL, vec const& ge);
RcppExport SEXP _bayesm_rscaleUsage_rcpp_loop(SEXP kSEXP, SEXP xSEXP, SEXP pSEXP, SEXP nSEXP, SEXP RSEXP, SEXP keepSEXP, SEXP ndghkSEXP, SEXP nprintSEXP, SEXP ySEXP, SEXP muSEXP, SEXP SigmaSEXP, SEXP tauSEXP, SEXP sigmaSEXP, SEXP LambdaSEXP, SEXP eSEXP, SEXP domuSEXP, SEXP doSigmaSEXP, SEXP dosigmaSEXP, SEXP dotauSEXP, SEXP doLambdaSEXP, SEXP doeSEXP, SEXP nuSEXP, SEXP VSEXP, SEXP mubarSEXP, SEXP AmSEXP, SEXP gsigmaSEXP, SEXP gl11SEXP, SEXP gl22SEXP, SEXP gl12SEXP, SEXP nuLSEXP, SEXP VLSEXP, SEXP geSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type k(kSEXP);
    Rcpp::traits::input_parameter< mat const& >::type x(xSEXP);
    Rcpp::traits::input_parameter< int >::type p(pSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type ndghk(ndghkSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    Rcpp::traits::input_parameter< mat >::type y(ySEXP);
    Rcpp::traits::input_parameter< vec >::type mu(muSEXP);
    Rcpp::traits::input_parameter< mat >::type Sigma(SigmaSEXP);
    Rcpp::traits::input_parameter< vec >::type tau(tauSEXP);
    Rcpp::traits::input_parameter< vec >::type sigma(sigmaSEXP);
    Rcpp::traits::input_parameter< mat >::type Lambda(LambdaSEXP);
    Rcpp::traits::input_parameter< double >::type e(eSEXP);
    Rcpp::traits::input_parameter< bool >::type domu(domuSEXP);
    Rcpp::traits::input_parameter< bool >::type doSigma(doSigmaSEXP);
    Rcpp::traits::input_parameter< bool >::type dosigma(dosigmaSEXP);
    Rcpp::traits::input_parameter< bool >::type dotau(dotauSEXP);
    Rcpp::traits::input_parameter< bool >::type doLambda(doLambdaSEXP);
    Rcpp::traits::input_parameter< bool >::type doe(doeSEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    Rcpp::traits::input_parameter< mat const& >::type mubar(mubarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type Am(AmSEXP);
    Rcpp::traits::input_parameter< vec const& >::type gsigma(gsigmaSEXP);
    Rcpp::traits::input_parameter< vec const& >::type gl11(gl11SEXP);
    Rcpp::traits::input_parameter< vec const& >::type gl22(gl22SEXP);
    Rcpp::traits::input_parameter< vec const& >::type gl12(gl12SEXP);
    Rcpp::traits::input_parameter< int >::type nuL(nuLSEXP);
    Rcpp::traits::input_parameter< mat const& >::type VL(VLSEXP);
    Rcpp::traits::input_parameter< vec const& >::type ge(geSEXP);
    rcpp_result_gen = Rcpp::wrap(rscaleUsage_rcpp_loop(k, x, p, n, R, keep, ndghk, nprint, y, mu, Sigma, tau, sigma, Lambda, e, domu, doSigma, dosigma, dotau, doLambda, doe, nu, V, mubar, Am, gsigma, gl11, gl22, gl12, nuL, VL, ge));
    return rcpp_result_gen;
END_RCPP
}
// rsurGibbs_rcpp_loop
List rsurGibbs_rcpp_loop(List const& regdata, vec const& indreg, vec const& cumnk, vec const& nk, mat const& XspXs, mat Sigmainv, mat const& A, vec const& Abetabar, double nu, mat const& V, int nvar, mat E, mat const& Y, int R, int keep, int nprint);
RcppExport SEXP _bayesm_rsurGibbs_rcpp_loop(SEXP regdataSEXP, SEXP indregSEXP, SEXP cumnkSEXP, SEXP nkSEXP, SEXP XspXsSEXP, SEXP SigmainvSEXP, SEXP ASEXP, SEXP AbetabarSEXP, SEXP nuSEXP, SEXP VSEXP, SEXP nvarSEXP, SEXP ESEXP, SEXP YSEXP, SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List const& >::type regdata(regdataSEXP);
    Rcpp::traits::input_parameter< vec const& >::type indreg(indregSEXP);
    Rcpp::traits::input_parameter< vec const& >::type cumnk(cumnkSEXP);
    Rcpp::traits::input_parameter< vec const& >::type nk(nkSEXP);
    Rcpp::traits::input_parameter< mat const& >::type XspXs(XspXsSEXP);
    Rcpp::traits::input_parameter< mat >::type Sigmainv(SigmainvSEXP);
    Rcpp::traits::input_parameter< mat const& >::type A(ASEXP);
    Rcpp::traits::input_parameter< vec const& >::type Abetabar(AbetabarSEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    Rcpp::traits::input_parameter< int >::type nvar(nvarSEXP);
    Rcpp::traits::input_parameter< mat >::type E(ESEXP);
    Rcpp::traits::input_parameter< mat const& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    rcpp_result_gen = Rcpp::wrap(rsurGibbs_rcpp_loop(regdata, indreg, cumnk, nk, XspXs, Sigmainv, A, Abetabar, nu, V, nvar, E, Y, R, keep, nprint));
    return rcpp_result_gen;
END_RCPP
}
// rtrun
NumericVector rtrun(NumericVector const& mu, NumericVector const& sigma, NumericVector const& a, NumericVector const& b);
RcppExport SEXP _bayesm_rtrun(SEXP muSEXP, SEXP sigmaSEXP, SEXP aSEXP, SEXP bSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector const& >::type mu(muSEXP);
    Rcpp::traits::input_parameter< NumericVector const& >::type sigma(sigmaSEXP);
    Rcpp::traits::input_parameter< NumericVector const& >::type a(aSEXP);
    Rcpp::traits::input_parameter< NumericVector const& >::type b(bSEXP);
    rcpp_result_gen = Rcpp::wrap(rtrun(mu, sigma, a, b));
    return rcpp_result_gen;
END_RCPP
}
// runiregGibbs_rcpp_loop
List runiregGibbs_rcpp_loop(vec const& y, mat const& X, vec const& betabar, mat const& A, double nu, double ssq, double sigmasq, int R, int keep, int nprint);
RcppExport SEXP _bayesm_runiregGibbs_rcpp_loop(SEXP ySEXP, SEXP XSEXP, SEXP betabarSEXP, SEXP ASEXP, SEXP nuSEXP, SEXP ssqSEXP, SEXP sigmasqSEXP, SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< vec const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    Rcpp::traits::input_parameter< vec const& >::type betabar(betabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type A(ASEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< double >::type ssq(ssqSEXP);
    Rcpp::traits::input_parameter< double >::type sigmasq(sigmasqSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    rcpp_result_gen = Rcpp::wrap(runiregGibbs_rcpp_loop(y, X, betabar, A, nu, ssq, sigmasq, R, keep, nprint));
    return rcpp_result_gen;
END_RCPP
}
// runireg_rcpp_loop
List runireg_rcpp_loop(vec const& y, mat const& X, vec const& betabar, mat const& A, double nu, double ssq, int R, int keep, int nprint);
RcppExport SEXP _bayesm_runireg_rcpp_loop(SEXP ySEXP, SEXP XSEXP, SEXP betabarSEXP, SEXP ASEXP, SEXP nuSEXP, SEXP ssqSEXP, SEXP RSEXP, SEXP keepSEXP, SEXP nprintSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< vec const& >::type y(ySEXP);
    Rcpp::traits::input_parameter< mat const& >::type X(XSEXP);
    Rcpp::traits::input_parameter< vec const& >::type betabar(betabarSEXP);
    Rcpp::traits::input_parameter< mat const& >::type A(ASEXP);
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< double >::type ssq(ssqSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type keep(keepSEXP);
    Rcpp::traits::input_parameter< int >::type nprint(nprintSEXP);
    rcpp_result_gen = Rcpp::wrap(runireg_rcpp_loop(y, X, betabar, A, nu, ssq, R, keep, nprint));
    return rcpp_result_gen;
END_RCPP
}
// rwishart
List rwishart(double nu, mat const& V);
RcppExport SEXP _bayesm_rwishart(SEXP nuSEXP, SEXP VSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< mat const& >::type V(VSEXP);
    rcpp_result_gen = Rcpp::wrap(rwishart(nu, V));
    return rcpp_result_gen;
END_RCPP
}
// callroot
vec callroot(vec const& c1, vec const& c2, double tol, int iterlim);
RcppExport SEXP _bayesm_callroot(SEXP c1SEXP, SEXP c2SEXP, SEXP tolSEXP, SEXP iterlimSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< vec const& >::type c1(c1SEXP);
    Rcpp::traits::input_parameter< vec const& >::type c2(c2SEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< int >::type iterlim(iterlimSEXP);
    rcpp_result_gen = Rcpp::wrap(callroot(c1, c2, tol, iterlim));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_bayesm_bayesBLP_rcpp_loop", (DL_FUNC) &_bayesm_bayesBLP_rcpp_loop, 26},
    {"_bayesm_breg", (DL_FUNC) &_bayesm_breg, 4},
    {"_bayesm_cgetC", (DL_FUNC) &_bayesm_cgetC, 2},
    {"_bayesm_clusterMix_rcpp_loop", (DL_FUNC) &_bayesm_clusterMix_rcpp_loop, 4},
    {"_bayesm_ghkvec", (DL_FUNC) &_bayesm_ghkvec, 6},
    {"_bayesm_llmnl", (DL_FUNC) &_bayesm_llmnl, 3},
    {"_bayesm_lndIChisq", (DL_FUNC) &_bayesm_lndIChisq, 3},
    {"_bayesm_lndIWishart", (DL_FUNC) &_bayesm_lndIWishart, 3},
    {"_bayesm_lndMvn", (DL_FUNC) &_bayesm_lndMvn, 3},
    {"_bayesm_lndMvst", (DL_FUNC) &_bayesm_lndMvst, 5},
    {"_bayesm_rDPGibbs_rcpp_loop", (DL_FUNC) &_bayesm_rDPGibbs_rcpp_loop, 12},
    {"_bayesm_rbprobitGibbs_rcpp_loop", (DL_FUNC) &_bayesm_rbprobitGibbs_rcpp_loop, 11},
    {"_bayesm_rdirichlet", (DL_FUNC) &_bayesm_rdirichlet, 1},
    {"_bayesm_rhierLinearMixture_rcpp_loop", (DL_FUNC) &_bayesm_rhierLinearMixture_rcpp_loop, 19},
    {"_bayesm_rhierLinearModel_rcpp_loop", (DL_FUNC) &_bayesm_rhierLinearModel_rcpp_loop, 14},
    {"_bayesm_rhierMnlDP_rcpp_loop", (DL_FUNC) &_bayesm_rhierMnlDP_rcpp_loop, 18},
    {"_bayesm_llmnl_con", (DL_FUNC) &_bayesm_llmnl_con, 4},
    {"_bayesm_rhierMnlRwMixture_rcpp_loop", (DL_FUNC) &_bayesm_rhierMnlRwMixture_rcpp_loop, 19},
    {"_bayesm_rhierNegbinRw_rcpp_loop", (DL_FUNC) &_bayesm_rhierNegbinRw_rcpp_loop, 19},
    {"_bayesm_rivDP_rcpp_loop", (DL_FUNC) &_bayesm_rivDP_rcpp_loop, 23},
    {"_bayesm_rivGibbs_rcpp_loop", (DL_FUNC) &_bayesm_rivGibbs_rcpp_loop, 13},
    {"_bayesm_rmixGibbs", (DL_FUNC) &_bayesm_rmixGibbs, 8},
    {"_bayesm_rmixture", (DL_FUNC) &_bayesm_rmixture, 3},
    {"_bayesm_rmnlIndepMetrop_rcpp_loop", (DL_FUNC) &_bayesm_rmnlIndepMetrop_rcpp_loop, 13},
    {"_bayesm_rmnpGibbs_rcpp_loop", (DL_FUNC) &_bayesm_rmnpGibbs_rcpp_loop, 12},
    {"_bayesm_rmultireg", (DL_FUNC) &_bayesm_rmultireg, 6},
    {"_bayesm_rmvpGibbs_rcpp_loop", (DL_FUNC) &_bayesm_rmvpGibbs_rcpp_loop, 12},
    {"_bayesm_rmvst", (DL_FUNC) &_bayesm_rmvst, 3},
    {"_bayesm_rnegbinRw_rcpp_loop", (DL_FUNC) &_bayesm_rnegbinRw_rcpp_loop, 14},
    {"_bayesm_rnmixGibbs_rcpp_loop", (DL_FUNC) &_bayesm_rnmixGibbs_rcpp_loop, 11},
    {"_bayesm_rordprobitGibbs_rcpp_loop", (DL_FUNC) &_bayesm_rordprobitGibbs_rcpp_loop, 13},
    {"_bayesm_rscaleUsage_rcpp_loop", (DL_FUNC) &_bayesm_rscaleUsage_rcpp_loop, 32},
    {"_bayesm_rsurGibbs_rcpp_loop", (DL_FUNC) &_bayesm_rsurGibbs_rcpp_loop, 16},
    {"_bayesm_rtrun", (DL_FUNC) &_bayesm_rtrun, 4},
    {"_bayesm_runiregGibbs_rcpp_loop", (DL_FUNC) &_bayesm_runiregGibbs_rcpp_loop, 10},
    {"_bayesm_runireg_rcpp_loop", (DL_FUNC) &_bayesm_runireg_rcpp_loop, 9},
    {"_bayesm_rwishart", (DL_FUNC) &_bayesm_rwishart, 2},
    {"_bayesm_callroot", (DL_FUNC) &_bayesm_callroot, 4},
    {NULL, NULL, 0}
};

RcppExport void R_init_bayesm(DllInfo *dll) {
    R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
    R_useDynamicSymbols(dll, FALSE);
}
