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

#ifndef RCPP_bpvars_RCPPEXPORTS_H_GEN_
#define RCPP_bpvars_RCPPEXPORTS_H_GEN_

#include <RcppArmadillo.h>
#include <Rcpp.h>

namespace bpvars {

    using namespace Rcpp;

    namespace {
        void validateSignature(const char* sig) {
            Rcpp::Function require = Rcpp::Environment::base_env()["require"];
            require("bpvars", Rcpp::Named("quietly") = true);
            typedef int(*Ptr_validate)(const char*);
            static Ptr_validate p_validate = (Ptr_validate)
                R_GetCCallable("bpvars", "_bpvars_RcppExport_validate");
            if (!p_validate(sig)) {
                throw Rcpp::function_not_exported(
                    "C++ function with signature '" + std::string(sig) + "' not found in bpvars");
            }
        }
    }

    inline Rcpp::List bvarGroupPANEL(const int& S, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, const Rcpp::List& prior, const Rcpp::List& starting_values, const int thin, const bool show_progress, const arma::vec& adptive_alpha_gamma, const bool estimate_groups, const int p) {
        typedef SEXP(*Ptr_bvarGroupPANEL)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_bvarGroupPANEL p_bvarGroupPANEL = NULL;
        if (p_bvarGroupPANEL == NULL) {
            validateSignature("Rcpp::List(*bvarGroupPANEL)(const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const int,const bool,const arma::vec&,const bool,const int)");
            p_bvarGroupPANEL = (Ptr_bvarGroupPANEL)R_GetCCallable("bpvars", "_bpvars_bvarGroupPANEL");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bvarGroupPANEL(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(thin)), Shield<SEXP>(Rcpp::wrap(show_progress)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(estimate_groups)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List bvarGroupPriorPANEL(const int& S, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, const Rcpp::List& prior, const Rcpp::List& starting_values, const int thin, const bool show_progress, const arma::vec& adptive_alpha_gamma, const bool estimate_groups, const int p) {
        typedef SEXP(*Ptr_bvarGroupPriorPANEL)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_bvarGroupPriorPANEL p_bvarGroupPriorPANEL = NULL;
        if (p_bvarGroupPriorPANEL == NULL) {
            validateSignature("Rcpp::List(*bvarGroupPriorPANEL)(const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const int,const bool,const arma::vec&,const bool,const int)");
            p_bvarGroupPriorPANEL = (Ptr_bvarGroupPriorPANEL)R_GetCCallable("bpvars", "_bpvars_bvarGroupPriorPANEL");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bvarGroupPriorPANEL(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(thin)), Shield<SEXP>(Rcpp::wrap(show_progress)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(estimate_groups)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List bvarPANEL(const int& S, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, const Rcpp::List& prior, const Rcpp::List& starting_values, const int thin, const bool show_progress, const arma::vec& adptive_alpha_gamma, const bool type_wozniak, const int p) {
        typedef SEXP(*Ptr_bvarPANEL)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_bvarPANEL p_bvarPANEL = NULL;
        if (p_bvarPANEL == NULL) {
            validateSignature("Rcpp::List(*bvarPANEL)(const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const int,const bool,const arma::vec&,const bool,const int)");
            p_bvarPANEL = (Ptr_bvarPANEL)R_GetCCallable("bpvars", "_bpvars_bvarPANEL");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bvarPANEL(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(thin)), Shield<SEXP>(Rcpp::wrap(show_progress)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(type_wozniak)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List bvars_cpp(const int& S, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, const Rcpp::List& prior, const Rcpp::List& starting_values, const int thin, const bool show_progress, const arma::vec& adptive_alpha_gamma, const bool type_objective, const int p) {
        typedef SEXP(*Ptr_bvars_cpp)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_bvars_cpp p_bvars_cpp = NULL;
        if (p_bvars_cpp == NULL) {
            validateSignature("Rcpp::List(*bvars_cpp)(const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const int,const bool,const arma::vec&,const bool,const int)");
            p_bvars_cpp = (Ptr_bvars_cpp)R_GetCCallable("bpvars", "_bpvars_bvars_cpp");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bvars_cpp(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(thin)), Shield<SEXP>(Rcpp::wrap(show_progress)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(type_objective)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline arma::vec mvnrnd_truncated(arma::vec mu, arma::mat Sigma, arma::vec LB, arma::vec UB) {
        typedef SEXP(*Ptr_mvnrnd_truncated)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_mvnrnd_truncated p_mvnrnd_truncated = NULL;
        if (p_mvnrnd_truncated == NULL) {
            validateSignature("arma::vec(*mvnrnd_truncated)(arma::vec,arma::mat,arma::vec,arma::vec)");
            p_mvnrnd_truncated = (Ptr_mvnrnd_truncated)R_GetCCallable("bpvars", "_bpvars_mvnrnd_truncated");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_mvnrnd_truncated(Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(Sigma)), Shield<SEXP>(Rcpp::wrap(LB)), Shield<SEXP>(Rcpp::wrap(UB)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::vec >(rcpp_result_gen);
    }

    inline arma::vec mvnrnd_cond_truncated(arma::vec x, arma::vec mu, arma::mat Sigma, arma::vec LB, arma::vec UB) {
        typedef SEXP(*Ptr_mvnrnd_cond_truncated)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_mvnrnd_cond_truncated p_mvnrnd_cond_truncated = NULL;
        if (p_mvnrnd_cond_truncated == NULL) {
            validateSignature("arma::vec(*mvnrnd_cond_truncated)(arma::vec,arma::vec,arma::mat,arma::vec,arma::vec)");
            p_mvnrnd_cond_truncated = (Ptr_mvnrnd_cond_truncated)R_GetCCallable("bpvars", "_bpvars_mvnrnd_cond_truncated");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_mvnrnd_cond_truncated(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(Sigma)), Shield<SEXP>(Rcpp::wrap(LB)), Shield<SEXP>(Rcpp::wrap(UB)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::vec >(rcpp_result_gen);
    }

    inline Rcpp::List forecast_bvarPANEL(arma::field<arma::cube>& posterior_A_c_cpp, arma::field<arma::cube>& posterior_Sigma_c_cpp, arma::field<arma::cube>& posterior_Y, Rcpp::List& cond_forecasts, Rcpp::List& exog_forecasts, const int horizon, arma::vec LB, arma::vec UB, const bool show_progress, const int p) {
        typedef SEXP(*Ptr_forecast_bvarPANEL)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_forecast_bvarPANEL p_forecast_bvarPANEL = NULL;
        if (p_forecast_bvarPANEL == NULL) {
            validateSignature("Rcpp::List(*forecast_bvarPANEL)(arma::field<arma::cube>&,arma::field<arma::cube>&,arma::field<arma::cube>&,Rcpp::List&,Rcpp::List&,const int,arma::vec,arma::vec,const bool,const int)");
            p_forecast_bvarPANEL = (Ptr_forecast_bvarPANEL)R_GetCCallable("bpvars", "_bpvars_forecast_bvarPANEL");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_forecast_bvarPANEL(Shield<SEXP>(Rcpp::wrap(posterior_A_c_cpp)), Shield<SEXP>(Rcpp::wrap(posterior_Sigma_c_cpp)), Shield<SEXP>(Rcpp::wrap(posterior_Y)), Shield<SEXP>(Rcpp::wrap(cond_forecasts)), Shield<SEXP>(Rcpp::wrap(exog_forecasts)), Shield<SEXP>(Rcpp::wrap(horizon)), Shield<SEXP>(Rcpp::wrap(LB)), Shield<SEXP>(Rcpp::wrap(UB)), Shield<SEXP>(Rcpp::wrap(show_progress)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List bvarPANEL_noprog(const int& S, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, const Rcpp::List& prior, const Rcpp::List& starting_values, const arma::vec& adptive_alpha_gamma, const bool type_wozniak, const int p) {
        typedef SEXP(*Ptr_bvarPANEL_noprog)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_bvarPANEL_noprog p_bvarPANEL_noprog = NULL;
        if (p_bvarPANEL_noprog == NULL) {
            validateSignature("Rcpp::List(*bvarPANEL_noprog)(const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const arma::vec&,const bool,const int)");
            p_bvarPANEL_noprog = (Ptr_bvarPANEL_noprog)R_GetCCallable("bpvars", "_bpvars_bvarPANEL_noprog");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bvarPANEL_noprog(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(type_wozniak)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List bvarPANEL_just_sv_out(const int& S, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, const Rcpp::List& prior, const Rcpp::List& starting_values, const arma::vec& adptive_alpha_gamma, const bool type_wozniak, const int p) {
        typedef SEXP(*Ptr_bvarPANEL_just_sv_out)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_bvarPANEL_just_sv_out p_bvarPANEL_just_sv_out = NULL;
        if (p_bvarPANEL_just_sv_out == NULL) {
            validateSignature("Rcpp::List(*bvarPANEL_just_sv_out)(const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const arma::vec&,const bool,const int)");
            p_bvarPANEL_just_sv_out = (Ptr_bvarPANEL_just_sv_out)R_GetCCallable("bpvars", "_bpvars_bvarPANEL_just_sv_out");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bvarPANEL_just_sv_out(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(type_wozniak)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List bvarGroupPANEL_noprog(const int& S, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, const Rcpp::List& prior, const Rcpp::List& starting_values, const arma::vec& adptive_alpha_gamma, const bool estimate_groups, const int p) {
        typedef SEXP(*Ptr_bvarGroupPANEL_noprog)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_bvarGroupPANEL_noprog p_bvarGroupPANEL_noprog = NULL;
        if (p_bvarGroupPANEL_noprog == NULL) {
            validateSignature("Rcpp::List(*bvarGroupPANEL_noprog)(const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const arma::vec&,const bool,const int)");
            p_bvarGroupPANEL_noprog = (Ptr_bvarGroupPANEL_noprog)R_GetCCallable("bpvars", "_bpvars_bvarGroupPANEL_noprog");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bvarGroupPANEL_noprog(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(estimate_groups)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List bvarGroupPANEL_just_sv_out(const int& S, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, const Rcpp::List& prior, const Rcpp::List& starting_values, const arma::vec& adptive_alpha_gamma, const bool estimate_groups, const int p) {
        typedef SEXP(*Ptr_bvarGroupPANEL_just_sv_out)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_bvarGroupPANEL_just_sv_out p_bvarGroupPANEL_just_sv_out = NULL;
        if (p_bvarGroupPANEL_just_sv_out == NULL) {
            validateSignature("Rcpp::List(*bvarGroupPANEL_just_sv_out)(const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const arma::vec&,const bool,const int)");
            p_bvarGroupPANEL_just_sv_out = (Ptr_bvarGroupPANEL_just_sv_out)R_GetCCallable("bpvars", "_bpvars_bvarGroupPANEL_just_sv_out");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bvarGroupPANEL_just_sv_out(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(estimate_groups)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List bvars_cpp_noprog(const int& S, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, const Rcpp::List& prior, const Rcpp::List& starting_values, const arma::vec& adptive_alpha_gamma, const bool type_objective, const int p) {
        typedef SEXP(*Ptr_bvars_cpp_noprog)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_bvars_cpp_noprog p_bvars_cpp_noprog = NULL;
        if (p_bvars_cpp_noprog == NULL) {
            validateSignature("Rcpp::List(*bvars_cpp_noprog)(const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const arma::vec&,const bool,const int)");
            p_bvars_cpp_noprog = (Ptr_bvars_cpp_noprog)R_GetCCallable("bpvars", "_bpvars_bvars_cpp_noprog");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bvars_cpp_noprog(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(type_objective)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List bvars_just_sv_out(const int& S, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, const Rcpp::List& prior, const Rcpp::List& starting_values, const arma::vec& adptive_alpha_gamma, const bool type_objective, const int p) {
        typedef SEXP(*Ptr_bvars_just_sv_out)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_bvars_just_sv_out p_bvars_just_sv_out = NULL;
        if (p_bvars_just_sv_out == NULL) {
            validateSignature("Rcpp::List(*bvars_just_sv_out)(const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const arma::vec&,const bool,const int)");
            p_bvars_just_sv_out = (Ptr_bvars_just_sv_out)R_GetCCallable("bpvars", "_bpvars_bvars_just_sv_out");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bvars_just_sv_out(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(type_objective)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List bvarGroupPriorPANEL_noprog(const int& S, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, const Rcpp::List& prior, const Rcpp::List& starting_values, const arma::vec& adptive_alpha_gamma, const bool estimate_groups, const int p) {
        typedef SEXP(*Ptr_bvarGroupPriorPANEL_noprog)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_bvarGroupPriorPANEL_noprog p_bvarGroupPriorPANEL_noprog = NULL;
        if (p_bvarGroupPriorPANEL_noprog == NULL) {
            validateSignature("Rcpp::List(*bvarGroupPriorPANEL_noprog)(const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const arma::vec&,const bool,const int)");
            p_bvarGroupPriorPANEL_noprog = (Ptr_bvarGroupPriorPANEL_noprog)R_GetCCallable("bpvars", "_bpvars_bvarGroupPriorPANEL_noprog");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bvarGroupPriorPANEL_noprog(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(estimate_groups)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List bvarGroupPriorPANEL_just_sv_out(const int& S, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, const Rcpp::List& prior, const Rcpp::List& starting_values, const arma::vec& adptive_alpha_gamma, const bool estimate_groups, const int p) {
        typedef SEXP(*Ptr_bvarGroupPriorPANEL_just_sv_out)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_bvarGroupPriorPANEL_just_sv_out p_bvarGroupPriorPANEL_just_sv_out = NULL;
        if (p_bvarGroupPriorPANEL_just_sv_out == NULL) {
            validateSignature("Rcpp::List(*bvarGroupPriorPANEL_just_sv_out)(const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const arma::vec&,const bool,const int)");
            p_bvarGroupPriorPANEL_just_sv_out = (Ptr_bvarGroupPriorPANEL_just_sv_out)R_GetCCallable("bpvars", "_bpvars_bvarGroupPriorPANEL_just_sv_out");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_bvarGroupPriorPANEL_just_sv_out(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(estimate_groups)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List YX_subset_TT_head_rows(const Rcpp::List Y, const int TT, const int beginning = 0) {
        typedef SEXP(*Ptr_YX_subset_TT_head_rows)(SEXP,SEXP,SEXP);
        static Ptr_YX_subset_TT_head_rows p_YX_subset_TT_head_rows = NULL;
        if (p_YX_subset_TT_head_rows == NULL) {
            validateSignature("Rcpp::List(*YX_subset_TT_head_rows)(const Rcpp::List,const int,const int)");
            p_YX_subset_TT_head_rows = (Ptr_YX_subset_TT_head_rows)R_GetCCallable("bpvars", "_bpvars_YX_subset_TT_head_rows");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_YX_subset_TT_head_rows(Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(TT)), Shield<SEXP>(Rcpp::wrap(beginning)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List forecast_bvarPANEL_noprog(arma::field<arma::cube>& posterior_A_c_cpp, arma::field<arma::cube>& posterior_Sigma_c_cpp, arma::field<arma::cube>& posterior_Y, Rcpp::List& cond_forecasts, Rcpp::List& exog_forecasts, const int horizon, arma::vec LB, arma::vec UB, const int p) {
        typedef SEXP(*Ptr_forecast_bvarPANEL_noprog)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_forecast_bvarPANEL_noprog p_forecast_bvarPANEL_noprog = NULL;
        if (p_forecast_bvarPANEL_noprog == NULL) {
            validateSignature("Rcpp::List(*forecast_bvarPANEL_noprog)(arma::field<arma::cube>&,arma::field<arma::cube>&,arma::field<arma::cube>&,Rcpp::List&,Rcpp::List&,const int,arma::vec,arma::vec,const int)");
            p_forecast_bvarPANEL_noprog = (Ptr_forecast_bvarPANEL_noprog)R_GetCCallable("bpvars", "_bpvars_forecast_bvarPANEL_noprog");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_forecast_bvarPANEL_noprog(Shield<SEXP>(Rcpp::wrap(posterior_A_c_cpp)), Shield<SEXP>(Rcpp::wrap(posterior_Sigma_c_cpp)), Shield<SEXP>(Rcpp::wrap(posterior_Y)), Shield<SEXP>(Rcpp::wrap(cond_forecasts)), Shield<SEXP>(Rcpp::wrap(exog_forecasts)), Shield<SEXP>(Rcpp::wrap(horizon)), Shield<SEXP>(Rcpp::wrap(LB)), Shield<SEXP>(Rcpp::wrap(UB)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List forecast_pseudo_out_of_sample_bvarPANEL(const int& S, const int& S_burn, const arma::ivec horizons, const int& training_sample, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, Rcpp::List& cond_forecasts, Rcpp::List& exog_forecasts, const Rcpp::List& prior, const Rcpp::List& starting_values, const arma::vec LB, const arma::vec UB, const bool show_progress, const arma::vec& adptive_alpha_gamma, const bool type_wozniak, const int p) {
        typedef SEXP(*Ptr_forecast_pseudo_out_of_sample_bvarPANEL)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_forecast_pseudo_out_of_sample_bvarPANEL p_forecast_pseudo_out_of_sample_bvarPANEL = NULL;
        if (p_forecast_pseudo_out_of_sample_bvarPANEL == NULL) {
            validateSignature("Rcpp::List(*forecast_pseudo_out_of_sample_bvarPANEL)(const int&,const int&,const arma::ivec,const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,Rcpp::List&,Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const arma::vec,const arma::vec,const bool,const arma::vec&,const bool,const int)");
            p_forecast_pseudo_out_of_sample_bvarPANEL = (Ptr_forecast_pseudo_out_of_sample_bvarPANEL)R_GetCCallable("bpvars", "_bpvars_forecast_pseudo_out_of_sample_bvarPANEL");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_forecast_pseudo_out_of_sample_bvarPANEL(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(S_burn)), Shield<SEXP>(Rcpp::wrap(horizons)), Shield<SEXP>(Rcpp::wrap(training_sample)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(cond_forecasts)), Shield<SEXP>(Rcpp::wrap(exog_forecasts)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(LB)), Shield<SEXP>(Rcpp::wrap(UB)), Shield<SEXP>(Rcpp::wrap(show_progress)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(type_wozniak)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List forecast_pseudo_out_of_sample_bvarGroupPANEL(const int& S, const int& S_burn, const arma::ivec horizons, const int& training_sample, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, Rcpp::List& cond_forecasts, Rcpp::List& exog_forecasts, const Rcpp::List& prior, const Rcpp::List& starting_values, const arma::vec LB, const arma::vec UB, const bool show_progress, const arma::vec& adptive_alpha_gamma, const bool estimate_groups, const int p) {
        typedef SEXP(*Ptr_forecast_pseudo_out_of_sample_bvarGroupPANEL)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_forecast_pseudo_out_of_sample_bvarGroupPANEL p_forecast_pseudo_out_of_sample_bvarGroupPANEL = NULL;
        if (p_forecast_pseudo_out_of_sample_bvarGroupPANEL == NULL) {
            validateSignature("Rcpp::List(*forecast_pseudo_out_of_sample_bvarGroupPANEL)(const int&,const int&,const arma::ivec,const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,Rcpp::List&,Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const arma::vec,const arma::vec,const bool,const arma::vec&,const bool,const int)");
            p_forecast_pseudo_out_of_sample_bvarGroupPANEL = (Ptr_forecast_pseudo_out_of_sample_bvarGroupPANEL)R_GetCCallable("bpvars", "_bpvars_forecast_pseudo_out_of_sample_bvarGroupPANEL");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_forecast_pseudo_out_of_sample_bvarGroupPANEL(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(S_burn)), Shield<SEXP>(Rcpp::wrap(horizons)), Shield<SEXP>(Rcpp::wrap(training_sample)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(cond_forecasts)), Shield<SEXP>(Rcpp::wrap(exog_forecasts)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(LB)), Shield<SEXP>(Rcpp::wrap(UB)), Shield<SEXP>(Rcpp::wrap(show_progress)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(estimate_groups)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List forecast_pseudo_out_of_sample_bvars(const int& S, const int& S_burn, const arma::ivec horizons, const int& training_sample, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, Rcpp::List& cond_forecasts, Rcpp::List& exog_forecasts, const Rcpp::List& prior, const Rcpp::List& starting_values, const arma::vec LB, const arma::vec UB, const bool show_progress, const arma::vec& adptive_alpha_gamma, const bool type_objective, const int p) {
        typedef SEXP(*Ptr_forecast_pseudo_out_of_sample_bvars)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_forecast_pseudo_out_of_sample_bvars p_forecast_pseudo_out_of_sample_bvars = NULL;
        if (p_forecast_pseudo_out_of_sample_bvars == NULL) {
            validateSignature("Rcpp::List(*forecast_pseudo_out_of_sample_bvars)(const int&,const int&,const arma::ivec,const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,Rcpp::List&,Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const arma::vec,const arma::vec,const bool,const arma::vec&,const bool,const int)");
            p_forecast_pseudo_out_of_sample_bvars = (Ptr_forecast_pseudo_out_of_sample_bvars)R_GetCCallable("bpvars", "_bpvars_forecast_pseudo_out_of_sample_bvars");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_forecast_pseudo_out_of_sample_bvars(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(S_burn)), Shield<SEXP>(Rcpp::wrap(horizons)), Shield<SEXP>(Rcpp::wrap(training_sample)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(cond_forecasts)), Shield<SEXP>(Rcpp::wrap(exog_forecasts)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(LB)), Shield<SEXP>(Rcpp::wrap(UB)), Shield<SEXP>(Rcpp::wrap(show_progress)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(type_objective)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline Rcpp::List forecast_pseudo_out_of_sample_bvarGroupPriorPANEL(const int& S, const int& S_burn, const arma::ivec horizons, const int& training_sample, const Rcpp::List& Y, const Rcpp::List& missing, const Rcpp::List& exogenous, Rcpp::List& cond_forecasts, Rcpp::List& exog_forecasts, const Rcpp::List& prior, const Rcpp::List& starting_values, const arma::vec LB, const arma::vec UB, const bool show_progress, const arma::vec& adptive_alpha_gamma, const bool estimate_groups, const int p) {
        typedef SEXP(*Ptr_forecast_pseudo_out_of_sample_bvarGroupPriorPANEL)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_forecast_pseudo_out_of_sample_bvarGroupPriorPANEL p_forecast_pseudo_out_of_sample_bvarGroupPriorPANEL = NULL;
        if (p_forecast_pseudo_out_of_sample_bvarGroupPriorPANEL == NULL) {
            validateSignature("Rcpp::List(*forecast_pseudo_out_of_sample_bvarGroupPriorPANEL)(const int&,const int&,const arma::ivec,const int&,const Rcpp::List&,const Rcpp::List&,const Rcpp::List&,Rcpp::List&,Rcpp::List&,const Rcpp::List&,const Rcpp::List&,const arma::vec,const arma::vec,const bool,const arma::vec&,const bool,const int)");
            p_forecast_pseudo_out_of_sample_bvarGroupPriorPANEL = (Ptr_forecast_pseudo_out_of_sample_bvarGroupPriorPANEL)R_GetCCallable("bpvars", "_bpvars_forecast_pseudo_out_of_sample_bvarGroupPriorPANEL");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_forecast_pseudo_out_of_sample_bvarGroupPriorPANEL(Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(S_burn)), Shield<SEXP>(Rcpp::wrap(horizons)), Shield<SEXP>(Rcpp::wrap(training_sample)), Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(cond_forecasts)), Shield<SEXP>(Rcpp::wrap(exog_forecasts)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(starting_values)), Shield<SEXP>(Rcpp::wrap(LB)), Shield<SEXP>(Rcpp::wrap(UB)), Shield<SEXP>(Rcpp::wrap(show_progress)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)), Shield<SEXP>(Rcpp::wrap(estimate_groups)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline arma::field<arma::cube> fourDarray_to_field_cube(Rcpp::NumericVector arr) {
        typedef SEXP(*Ptr_fourDarray_to_field_cube)(SEXP);
        static Ptr_fourDarray_to_field_cube p_fourDarray_to_field_cube = NULL;
        if (p_fourDarray_to_field_cube == NULL) {
            validateSignature("arma::field<arma::cube>(*fourDarray_to_field_cube)(Rcpp::NumericVector)");
            p_fourDarray_to_field_cube = (Ptr_fourDarray_to_field_cube)R_GetCCallable("bpvars", "_bpvars_fourDarray_to_field_cube");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_fourDarray_to_field_cube(Shield<SEXP>(Rcpp::wrap(arr)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::field<arma::cube> >(rcpp_result_gen);
    }

    inline double log_dnormm_joint_s(arma::vec& x, arma::vec& mu, arma::mat& sigma) {
        typedef SEXP(*Ptr_log_dnormm_joint_s)(SEXP,SEXP,SEXP);
        static Ptr_log_dnormm_joint_s p_log_dnormm_joint_s = NULL;
        if (p_log_dnormm_joint_s == NULL) {
            validateSignature("double(*log_dnormm_joint_s)(arma::vec&,arma::vec&,arma::mat&)");
            p_log_dnormm_joint_s = (Ptr_log_dnormm_joint_s)R_GetCCallable("bpvars", "_bpvars_log_dnormm_joint_s");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_log_dnormm_joint_s(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(sigma)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline arma::cube log_dnormm_marginal(arma::mat& x, arma::cube& mu, arma::field<arma::cube>& sigma) {
        typedef SEXP(*Ptr_log_dnormm_marginal)(SEXP,SEXP,SEXP);
        static Ptr_log_dnormm_marginal p_log_dnormm_marginal = NULL;
        if (p_log_dnormm_marginal == NULL) {
            validateSignature("arma::cube(*log_dnormm_marginal)(arma::mat&,arma::cube&,arma::field<arma::cube>&)");
            p_log_dnormm_marginal = (Ptr_log_dnormm_marginal)R_GetCCallable("bpvars", "_bpvars_log_dnormm_marginal");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_log_dnormm_marginal(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(sigma)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::cube >(rcpp_result_gen);
    }

    inline arma::mat log_dnormm_joint(arma::mat& x, arma::cube& mu, arma::field<arma::cube>& sigma) {
        typedef SEXP(*Ptr_log_dnormm_joint)(SEXP,SEXP,SEXP);
        static Ptr_log_dnormm_joint p_log_dnormm_joint = NULL;
        if (p_log_dnormm_joint == NULL) {
            validateSignature("arma::mat(*log_dnormm_joint)(arma::mat&,arma::cube&,arma::field<arma::cube>&)");
            p_log_dnormm_joint = (Ptr_log_dnormm_joint)R_GetCCallable("bpvars", "_bpvars_log_dnormm_joint");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_log_dnormm_joint(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(sigma)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline double log_mean(arma::vec log_density) {
        typedef SEXP(*Ptr_log_mean)(SEXP);
        static Ptr_log_mean p_log_mean = NULL;
        if (p_log_mean == NULL) {
            validateSignature("double(*log_mean)(arma::vec)");
            p_log_mean = (Ptr_log_mean)R_GetCCallable("bpvars", "_bpvars_log_mean");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_log_mean(Shield<SEXP>(Rcpp::wrap(log_density)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline Rcpp::List mean_field(arma::field<arma::cube> postY) {
        typedef SEXP(*Ptr_mean_field)(SEXP);
        static Ptr_mean_field p_mean_field = NULL;
        if (p_mean_field == NULL) {
            validateSignature("Rcpp::List(*mean_field)(arma::field<arma::cube>)");
            p_mean_field = (Ptr_mean_field)R_GetCCallable("bpvars", "_bpvars_mean_field");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_mean_field(Shield<SEXP>(Rcpp::wrap(postY)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline arma::mat create_bigA(arma::cube A, int T) {
        typedef SEXP(*Ptr_create_bigA)(SEXP,SEXP);
        static Ptr_create_bigA p_create_bigA = NULL;
        if (p_create_bigA == NULL) {
            validateSignature("arma::mat(*create_bigA)(arma::cube,int)");
            p_create_bigA = (Ptr_create_bigA)R_GetCCallable("bpvars", "_bpvars_create_bigA");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_create_bigA(Shield<SEXP>(Rcpp::wrap(A)), Shield<SEXP>(Rcpp::wrap(T)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline arma::mat mvnrnd_cond(arma::vec x, arma::vec mu, arma::mat Sigma, arma::vec missing) {
        typedef SEXP(*Ptr_mvnrnd_cond)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_mvnrnd_cond p_mvnrnd_cond = NULL;
        if (p_mvnrnd_cond == NULL) {
            validateSignature("arma::mat(*mvnrnd_cond)(arma::vec,arma::vec,arma::mat,arma::vec)");
            p_mvnrnd_cond = (Ptr_mvnrnd_cond)R_GetCCallable("bpvars", "_bpvars_mvnrnd_cond");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_mvnrnd_cond(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(Sigma)), Shield<SEXP>(Rcpp::wrap(missing)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline arma::mat sample_missing(arma::mat& aux_Y, arma::mat& missing, arma::mat& exogenous, arma::mat& A_c, arma::mat& Sigma_c, arma::mat& A_c_prior_mean, arma::mat& Sigma_c_prior) {
        typedef SEXP(*Ptr_sample_missing)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_missing p_sample_missing = NULL;
        if (p_sample_missing == NULL) {
            validateSignature("arma::mat(*sample_missing)(arma::mat&,arma::mat&,arma::mat&,arma::mat&,arma::mat&,arma::mat&,arma::mat&)");
            p_sample_missing = (Ptr_sample_missing)R_GetCCallable("bpvars", "_bpvars_sample_missing");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_missing(Shield<SEXP>(Rcpp::wrap(aux_Y)), Shield<SEXP>(Rcpp::wrap(missing)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(A_c)), Shield<SEXP>(Rcpp::wrap(Sigma_c)), Shield<SEXP>(Rcpp::wrap(A_c_prior_mean)), Shield<SEXP>(Rcpp::wrap(Sigma_c_prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline arma::field<arma::mat> Y_c_and_X_c(arma::mat& aux_Y, arma::mat& exogenous, const int p) {
        typedef SEXP(*Ptr_Y_c_and_X_c)(SEXP,SEXP,SEXP);
        static Ptr_Y_c_and_X_c p_Y_c_and_X_c = NULL;
        if (p_Y_c_and_X_c == NULL) {
            validateSignature("arma::field<arma::mat>(*Y_c_and_X_c)(arma::mat&,arma::mat&,const int)");
            p_Y_c_and_X_c = (Ptr_Y_c_and_X_c)R_GetCCallable("bpvars", "_bpvars_Y_c_and_X_c");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_Y_c_and_X_c(Shield<SEXP>(Rcpp::wrap(aux_Y)), Shield<SEXP>(Rcpp::wrap(exogenous)), Shield<SEXP>(Rcpp::wrap(p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::field<arma::mat> >(rcpp_result_gen);
    }

    inline arma::cube Sigma2B_c(arma::cube& posterior_Sigma_c, const bool lower = true) {
        typedef SEXP(*Ptr_Sigma2B_c)(SEXP,SEXP);
        static Ptr_Sigma2B_c p_Sigma2B_c = NULL;
        if (p_Sigma2B_c == NULL) {
            validateSignature("arma::cube(*Sigma2B_c)(arma::cube&,const bool)");
            p_Sigma2B_c = (Ptr_Sigma2B_c)R_GetCCallable("bpvars", "_bpvars_Sigma2B_c");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_Sigma2B_c(Shield<SEXP>(Rcpp::wrap(posterior_Sigma_c)), Shield<SEXP>(Rcpp::wrap(lower)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::cube >(rcpp_result_gen);
    }

    inline arma::field<arma::cube> panel_variance_decompositions(arma::field<arma::cube>& posterior_Sigma, arma::field<arma::cube>& posterior_A, const int horizon, const int p, const bool lower = true) {
        typedef SEXP(*Ptr_panel_variance_decompositions)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_panel_variance_decompositions p_panel_variance_decompositions = NULL;
        if (p_panel_variance_decompositions == NULL) {
            validateSignature("arma::field<arma::cube>(*panel_variance_decompositions)(arma::field<arma::cube>&,arma::field<arma::cube>&,const int,const int,const bool)");
            p_panel_variance_decompositions = (Ptr_panel_variance_decompositions)R_GetCCallable("bpvars", "_bpvars_panel_variance_decompositions");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_panel_variance_decompositions(Shield<SEXP>(Rcpp::wrap(posterior_Sigma)), Shield<SEXP>(Rcpp::wrap(posterior_A)), Shield<SEXP>(Rcpp::wrap(horizon)), Shield<SEXP>(Rcpp::wrap(p)), Shield<SEXP>(Rcpp::wrap(lower)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::field<arma::cube> >(rcpp_result_gen);
    }

    inline arma::field<arma::mat> rmniw1(const arma::mat& A, const arma::mat& V, const arma::mat& S, const double& nu) {
        typedef SEXP(*Ptr_rmniw1)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_rmniw1 p_rmniw1 = NULL;
        if (p_rmniw1 == NULL) {
            validateSignature("arma::field<arma::mat>(*rmniw1)(const arma::mat&,const arma::mat&,const arma::mat&,const double&)");
            p_rmniw1 = (Ptr_rmniw1)R_GetCCallable("bpvars", "_bpvars_rmniw1");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_rmniw1(Shield<SEXP>(Rcpp::wrap(A)), Shield<SEXP>(Rcpp::wrap(V)), Shield<SEXP>(Rcpp::wrap(S)), Shield<SEXP>(Rcpp::wrap(nu)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::field<arma::mat> >(rcpp_result_gen);
    }

    inline arma::mat rmn1(const arma::mat& A, const arma::mat& V, const arma::mat& S) {
        typedef SEXP(*Ptr_rmn1)(SEXP,SEXP,SEXP);
        static Ptr_rmn1 p_rmn1 = NULL;
        if (p_rmn1 == NULL) {
            validateSignature("arma::mat(*rmn1)(const arma::mat&,const arma::mat&,const arma::mat&)");
            p_rmn1 = (Ptr_rmn1)R_GetCCallable("bpvars", "_bpvars_rmn1");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_rmn1(Shield<SEXP>(Rcpp::wrap(A)), Shield<SEXP>(Rcpp::wrap(V)), Shield<SEXP>(Rcpp::wrap(S)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline double sample_m(const arma::mat& aux_A, const arma::mat& aux_V, const double& aux_s, const double& aux_w, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_sample_m)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_m p_sample_m = NULL;
        if (p_sample_m == NULL) {
            validateSignature("double(*sample_m)(const arma::mat&,const arma::mat&,const double&,const double&,const Rcpp::List&)");
            p_sample_m = (Ptr_sample_m)R_GetCCallable("bpvars", "_bpvars_sample_m");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_m(Shield<SEXP>(Rcpp::wrap(aux_A)), Shield<SEXP>(Rcpp::wrap(aux_V)), Shield<SEXP>(Rcpp::wrap(aux_s)), Shield<SEXP>(Rcpp::wrap(aux_w)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline arma::vec sample_m_bvars(const arma::cube& aux_A_c, const arma::cube& aux_Sigma_c_inv, const arma::vec& aux_w, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_sample_m_bvars)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_m_bvars p_sample_m_bvars = NULL;
        if (p_sample_m_bvars == NULL) {
            validateSignature("arma::vec(*sample_m_bvars)(const arma::cube&,const arma::cube&,const arma::vec&,const Rcpp::List&)");
            p_sample_m_bvars = (Ptr_sample_m_bvars)R_GetCCallable("bpvars", "_bpvars_sample_m_bvars");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_m_bvars(Shield<SEXP>(Rcpp::wrap(aux_A_c)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_w)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::vec >(rcpp_result_gen);
    }

    inline double sample_m_gg(const arma::cube& aux_A_g, const arma::mat& aux_V_inv, const double& aux_s, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_sample_m_gg)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_m_gg p_sample_m_gg = NULL;
        if (p_sample_m_gg == NULL) {
            validateSignature("double(*sample_m_gg)(const arma::cube&,const arma::mat&,const double&,const Rcpp::List&)");
            p_sample_m_gg = (Ptr_sample_m_gg)R_GetCCallable("bpvars", "_bpvars_sample_m_gg");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_m_gg(Shield<SEXP>(Rcpp::wrap(aux_A_g)), Shield<SEXP>(Rcpp::wrap(aux_V_inv)), Shield<SEXP>(Rcpp::wrap(aux_s)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double sample_w(const arma::mat& aux_V, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_sample_w)(SEXP,SEXP);
        static Ptr_sample_w p_sample_w = NULL;
        if (p_sample_w == NULL) {
            validateSignature("double(*sample_w)(const arma::mat&,const Rcpp::List&)");
            p_sample_w = (Ptr_sample_w)R_GetCCallable("bpvars", "_bpvars_sample_w");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_w(Shield<SEXP>(Rcpp::wrap(aux_V)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline arma::vec sample_w_bvars(const arma::cube& aux_A_c, const arma::cube& aux_Sigma_c_inv, const arma::vec& aux_m, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_sample_w_bvars)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_w_bvars p_sample_w_bvars = NULL;
        if (p_sample_w_bvars == NULL) {
            validateSignature("arma::vec(*sample_w_bvars)(const arma::cube&,const arma::cube&,const arma::vec&,const Rcpp::List&)");
            p_sample_w_bvars = (Ptr_sample_w_bvars)R_GetCCallable("bpvars", "_bpvars_sample_w_bvars");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_w_bvars(Shield<SEXP>(Rcpp::wrap(aux_A_c)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_m)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::vec >(rcpp_result_gen);
    }

    inline double sample_s(const arma::mat& aux_A, const arma::mat& aux_V, const arma::mat& aux_Sigma, const double& aux_m, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_sample_s)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_s p_sample_s = NULL;
        if (p_sample_s == NULL) {
            validateSignature("double(*sample_s)(const arma::mat&,const arma::mat&,const arma::mat&,const double&,const Rcpp::List&)");
            p_sample_s = (Ptr_sample_s)R_GetCCallable("bpvars", "_bpvars_sample_s");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_s(Shield<SEXP>(Rcpp::wrap(aux_A)), Shield<SEXP>(Rcpp::wrap(aux_V)), Shield<SEXP>(Rcpp::wrap(aux_Sigma)), Shield<SEXP>(Rcpp::wrap(aux_m)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline arma::vec sample_s_bvars(const arma::cube& aux_Sigma_c_inv, const arma::vec& aux_nu, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_sample_s_bvars)(SEXP,SEXP,SEXP);
        static Ptr_sample_s_bvars p_sample_s_bvars = NULL;
        if (p_sample_s_bvars == NULL) {
            validateSignature("arma::vec(*sample_s_bvars)(const arma::cube&,const arma::vec&,const Rcpp::List&)");
            p_sample_s_bvars = (Ptr_sample_s_bvars)R_GetCCallable("bpvars", "_bpvars_sample_s_bvars");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_s_bvars(Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_nu)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::vec >(rcpp_result_gen);
    }

    inline double sample_s_gg(const arma::cube& aux_A_g, const arma::cube& aux_Sigma_g, const arma::mat& aux_V_inv, const double& aux_m, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_sample_s_gg)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_s_gg p_sample_s_gg = NULL;
        if (p_sample_s_gg == NULL) {
            validateSignature("double(*sample_s_gg)(const arma::cube&,const arma::cube&,const arma::mat&,const double&,const Rcpp::List&)");
            p_sample_s_gg = (Ptr_sample_s_gg)R_GetCCallable("bpvars", "_bpvars_sample_s_gg");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_s_gg(Shield<SEXP>(Rcpp::wrap(aux_A_g)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_g)), Shield<SEXP>(Rcpp::wrap(aux_V_inv)), Shield<SEXP>(Rcpp::wrap(aux_m)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double log_kernel_nu(const double& aux_nu, const arma::cube& aux_Sigma_c_cpp, const arma::cube& aux_Sigma_c_inv, const arma::mat& aux_Sigma, const double& prior_lambda, const int& C, const int& N, const int& K) {
        typedef SEXP(*Ptr_log_kernel_nu)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_log_kernel_nu p_log_kernel_nu = NULL;
        if (p_log_kernel_nu == NULL) {
            validateSignature("double(*log_kernel_nu)(const double&,const arma::cube&,const arma::cube&,const arma::mat&,const double&,const int&,const int&,const int&)");
            p_log_kernel_nu = (Ptr_log_kernel_nu)R_GetCCallable("bpvars", "_bpvars_log_kernel_nu");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_log_kernel_nu(Shield<SEXP>(Rcpp::wrap(aux_nu)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_cpp)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_Sigma)), Shield<SEXP>(Rcpp::wrap(prior_lambda)), Shield<SEXP>(Rcpp::wrap(C)), Shield<SEXP>(Rcpp::wrap(N)), Shield<SEXP>(Rcpp::wrap(K)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double log_kernel_nu_bvars(const double& aux_nu, const double& aux_s, const arma::mat& aux_Sigma_c_cpp, const arma::mat& prior_S, const double& prior_lambda, const int& N, const int& K) {
        typedef SEXP(*Ptr_log_kernel_nu_bvars)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_log_kernel_nu_bvars p_log_kernel_nu_bvars = NULL;
        if (p_log_kernel_nu_bvars == NULL) {
            validateSignature("double(*log_kernel_nu_bvars)(const double&,const double&,const arma::mat&,const arma::mat&,const double&,const int&,const int&)");
            p_log_kernel_nu_bvars = (Ptr_log_kernel_nu_bvars)R_GetCCallable("bpvars", "_bpvars_log_kernel_nu_bvars");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_log_kernel_nu_bvars(Shield<SEXP>(Rcpp::wrap(aux_nu)), Shield<SEXP>(Rcpp::wrap(aux_s)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_cpp)), Shield<SEXP>(Rcpp::wrap(prior_S)), Shield<SEXP>(Rcpp::wrap(prior_lambda)), Shield<SEXP>(Rcpp::wrap(N)), Shield<SEXP>(Rcpp::wrap(K)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double log_kernel_nu_gg(const double& aux_nu, const arma::cube& aux_Sigma_c_cpp, const arma::cube& aux_Sigma_c_inv, const arma::cube& aux_Sigma_g, const double& prior_lambda, const arma::vec& group_allocation, const int& C, const int& N, const int& K) {
        typedef SEXP(*Ptr_log_kernel_nu_gg)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_log_kernel_nu_gg p_log_kernel_nu_gg = NULL;
        if (p_log_kernel_nu_gg == NULL) {
            validateSignature("double(*log_kernel_nu_gg)(const double&,const arma::cube&,const arma::cube&,const arma::cube&,const double&,const arma::vec&,const int&,const int&,const int&)");
            p_log_kernel_nu_gg = (Ptr_log_kernel_nu_gg)R_GetCCallable("bpvars", "_bpvars_log_kernel_nu_gg");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_log_kernel_nu_gg(Shield<SEXP>(Rcpp::wrap(aux_nu)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_cpp)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_g)), Shield<SEXP>(Rcpp::wrap(prior_lambda)), Shield<SEXP>(Rcpp::wrap(group_allocation)), Shield<SEXP>(Rcpp::wrap(C)), Shield<SEXP>(Rcpp::wrap(N)), Shield<SEXP>(Rcpp::wrap(K)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double cov_nu(const double& aux_nu, const int& C, const int& N) {
        typedef SEXP(*Ptr_cov_nu)(SEXP,SEXP,SEXP);
        static Ptr_cov_nu p_cov_nu = NULL;
        if (p_cov_nu == NULL) {
            validateSignature("double(*cov_nu)(const double&,const int&,const int&)");
            p_cov_nu = (Ptr_cov_nu)R_GetCCallable("bpvars", "_bpvars_cov_nu");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cov_nu(Shield<SEXP>(Rcpp::wrap(aux_nu)), Shield<SEXP>(Rcpp::wrap(C)), Shield<SEXP>(Rcpp::wrap(N)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double cov_nu_bvars(const double& aux_nu, const int& N) {
        typedef SEXP(*Ptr_cov_nu_bvars)(SEXP,SEXP);
        static Ptr_cov_nu_bvars p_cov_nu_bvars = NULL;
        if (p_cov_nu_bvars == NULL) {
            validateSignature("double(*cov_nu_bvars)(const double&,const int&)");
            p_cov_nu_bvars = (Ptr_cov_nu_bvars)R_GetCCallable("bpvars", "_bpvars_cov_nu_bvars");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_cov_nu_bvars(Shield<SEXP>(Rcpp::wrap(aux_nu)), Shield<SEXP>(Rcpp::wrap(N)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline arma::vec sample_nu(double& aux_nu, double& adaptive_scale, const arma::cube& aux_Sigma_c_cpp, const arma::cube& aux_Sigma_c_inv, const arma::mat& aux_Sigma, const Rcpp::List& prior, const int& iteration, const arma::vec& adptive_alpha_gamma) {
        typedef SEXP(*Ptr_sample_nu)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_nu p_sample_nu = NULL;
        if (p_sample_nu == NULL) {
            validateSignature("arma::vec(*sample_nu)(double&,double&,const arma::cube&,const arma::cube&,const arma::mat&,const Rcpp::List&,const int&,const arma::vec&)");
            p_sample_nu = (Ptr_sample_nu)R_GetCCallable("bpvars", "_bpvars_sample_nu");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_nu(Shield<SEXP>(Rcpp::wrap(aux_nu)), Shield<SEXP>(Rcpp::wrap(adaptive_scale)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_cpp)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_Sigma)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(iteration)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::vec >(rcpp_result_gen);
    }

    inline Rcpp::List sample_nu_bvars(arma::vec& aux_nu, arma::vec& adaptive_scale, arma::vec& aux_s, const arma::cube& aux_Sigma_c_cpp, const arma::cube& aux_Sigma_c_inv, const Rcpp::List& prior, const int& iteration, const arma::vec& adptive_alpha_gamma) {
        typedef SEXP(*Ptr_sample_nu_bvars)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_nu_bvars p_sample_nu_bvars = NULL;
        if (p_sample_nu_bvars == NULL) {
            validateSignature("Rcpp::List(*sample_nu_bvars)(arma::vec&,arma::vec&,arma::vec&,const arma::cube&,const arma::cube&,const Rcpp::List&,const int&,const arma::vec&)");
            p_sample_nu_bvars = (Ptr_sample_nu_bvars)R_GetCCallable("bpvars", "_bpvars_sample_nu_bvars");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_nu_bvars(Shield<SEXP>(Rcpp::wrap(aux_nu)), Shield<SEXP>(Rcpp::wrap(adaptive_scale)), Shield<SEXP>(Rcpp::wrap(aux_s)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_cpp)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(iteration)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<Rcpp::List >(rcpp_result_gen);
    }

    inline arma::vec sample_nu_gg(double& aux_nu, double& adaptive_scale, const arma::cube& aux_Sigma_c_cpp, const arma::cube& aux_Sigma_c_inv, const arma::cube& aux_Sigma_g, const arma::vec& group_allocation, const Rcpp::List& prior, const int& iteration, const arma::vec& adptive_alpha_gamma) {
        typedef SEXP(*Ptr_sample_nu_gg)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_nu_gg p_sample_nu_gg = NULL;
        if (p_sample_nu_gg == NULL) {
            validateSignature("arma::vec(*sample_nu_gg)(double&,double&,const arma::cube&,const arma::cube&,const arma::cube&,const arma::vec&,const Rcpp::List&,const int&,const arma::vec&)");
            p_sample_nu_gg = (Ptr_sample_nu_gg)R_GetCCallable("bpvars", "_bpvars_sample_nu_gg");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_nu_gg(Shield<SEXP>(Rcpp::wrap(aux_nu)), Shield<SEXP>(Rcpp::wrap(adaptive_scale)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_cpp)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_g)), Shield<SEXP>(Rcpp::wrap(group_allocation)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(iteration)), Shield<SEXP>(Rcpp::wrap(adptive_alpha_gamma)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::vec >(rcpp_result_gen);
    }

    inline arma::mat sample_Sigma(const arma::cube& aux_Sigma_c_inv, const double& aux_s, const double& aux_nu, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_sample_Sigma)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_Sigma p_sample_Sigma = NULL;
        if (p_sample_Sigma == NULL) {
            validateSignature("arma::mat(*sample_Sigma)(const arma::cube&,const double&,const double&,const Rcpp::List&)");
            p_sample_Sigma = (Ptr_sample_Sigma)R_GetCCallable("bpvars", "_bpvars_sample_Sigma");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_Sigma(Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_s)), Shield<SEXP>(Rcpp::wrap(aux_nu)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline arma::cube sample_Sigma_g(const arma::cube& aux_Sigma_c_inv, const arma::vec& group_allocation, const double& aux_s, const double& aux_nu, const Rcpp::List& prior, const int& G) {
        typedef SEXP(*Ptr_sample_Sigma_g)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_Sigma_g p_sample_Sigma_g = NULL;
        if (p_sample_Sigma_g == NULL) {
            validateSignature("arma::cube(*sample_Sigma_g)(const arma::cube&,const arma::vec&,const double&,const double&,const Rcpp::List&,const int&)");
            p_sample_Sigma_g = (Ptr_sample_Sigma_g)R_GetCCallable("bpvars", "_bpvars_sample_Sigma_g");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_Sigma_g(Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(group_allocation)), Shield<SEXP>(Rcpp::wrap(aux_s)), Shield<SEXP>(Rcpp::wrap(aux_nu)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(G)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::cube >(rcpp_result_gen);
    }

    inline arma::field<arma::mat> sample_AV(const arma::cube& aux_A_c_cpp, const arma::cube& aux_Sigma_c_inv, const double& aux_s, const double& aux_m, const double& aux_w, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_sample_AV)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_AV p_sample_AV = NULL;
        if (p_sample_AV == NULL) {
            validateSignature("arma::field<arma::mat>(*sample_AV)(const arma::cube&,const arma::cube&,const double&,const double&,const double&,const Rcpp::List&)");
            p_sample_AV = (Ptr_sample_AV)R_GetCCallable("bpvars", "_bpvars_sample_AV");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_AV(Shield<SEXP>(Rcpp::wrap(aux_A_c_cpp)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_s)), Shield<SEXP>(Rcpp::wrap(aux_m)), Shield<SEXP>(Rcpp::wrap(aux_w)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::field<arma::mat> >(rcpp_result_gen);
    }

    inline arma::field<arma::mat> sample_AV_jaro(const arma::cube& aux_A_c_cpp, const arma::cube& aux_Sigma_c_inv, arma::mat& aux_A, double& aux_s, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_sample_AV_jaro)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_AV_jaro p_sample_AV_jaro = NULL;
        if (p_sample_AV_jaro == NULL) {
            validateSignature("arma::field<arma::mat>(*sample_AV_jaro)(const arma::cube&,const arma::cube&,arma::mat&,double&,const Rcpp::List&)");
            p_sample_AV_jaro = (Ptr_sample_AV_jaro)R_GetCCallable("bpvars", "_bpvars_sample_AV_jaro");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_AV_jaro(Shield<SEXP>(Rcpp::wrap(aux_A_c_cpp)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_A)), Shield<SEXP>(Rcpp::wrap(aux_s)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::field<arma::mat> >(rcpp_result_gen);
    }

    inline arma::cube sample_A_g(const arma::cube& aux_A_c_cpp, const arma::cube& aux_Sigma_c_inv, const arma::mat& aux_V, const arma::vec& group_allocation, const double& aux_s, const double& aux_m, const Rcpp::List& prior, const int& G) {
        typedef SEXP(*Ptr_sample_A_g)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_A_g p_sample_A_g = NULL;
        if (p_sample_A_g == NULL) {
            validateSignature("arma::cube(*sample_A_g)(const arma::cube&,const arma::cube&,const arma::mat&,const arma::vec&,const double&,const double&,const Rcpp::List&,const int&)");
            p_sample_A_g = (Ptr_sample_A_g)R_GetCCallable("bpvars", "_bpvars_sample_A_g");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_A_g(Shield<SEXP>(Rcpp::wrap(aux_A_c_cpp)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_V)), Shield<SEXP>(Rcpp::wrap(group_allocation)), Shield<SEXP>(Rcpp::wrap(aux_s)), Shield<SEXP>(Rcpp::wrap(aux_m)), Shield<SEXP>(Rcpp::wrap(prior)), Shield<SEXP>(Rcpp::wrap(G)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::cube >(rcpp_result_gen);
    }

    inline arma::mat sample_V_gg(const arma::cube& aux_A_c_cpp, const arma::cube& aux_Sigma_c_inv, const arma::cube& aux_A_g, const arma::vec& group_allocation, const double& aux_s, const double& aux_m, const double& aux_w, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_sample_V_gg)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_V_gg p_sample_V_gg = NULL;
        if (p_sample_V_gg == NULL) {
            validateSignature("arma::mat(*sample_V_gg)(const arma::cube&,const arma::cube&,const arma::cube&,const arma::vec&,const double&,const double&,const double&,const Rcpp::List&)");
            p_sample_V_gg = (Ptr_sample_V_gg)R_GetCCallable("bpvars", "_bpvars_sample_V_gg");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_V_gg(Shield<SEXP>(Rcpp::wrap(aux_A_c_cpp)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_A_g)), Shield<SEXP>(Rcpp::wrap(group_allocation)), Shield<SEXP>(Rcpp::wrap(aux_s)), Shield<SEXP>(Rcpp::wrap(aux_m)), Shield<SEXP>(Rcpp::wrap(aux_w)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline arma::field<arma::mat> sample_A_c_Sigma_c(const arma::mat& Y_c, const arma::mat& X_c, const arma::mat& aux_A, const arma::mat& aux_V, const arma::mat& aux_Sigma, const double& aux_nu) {
        typedef SEXP(*Ptr_sample_A_c_Sigma_c)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_A_c_Sigma_c p_sample_A_c_Sigma_c = NULL;
        if (p_sample_A_c_Sigma_c == NULL) {
            validateSignature("arma::field<arma::mat>(*sample_A_c_Sigma_c)(const arma::mat&,const arma::mat&,const arma::mat&,const arma::mat&,const arma::mat&,const double&)");
            p_sample_A_c_Sigma_c = (Ptr_sample_A_c_Sigma_c)R_GetCCallable("bpvars", "_bpvars_sample_A_c_Sigma_c");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_A_c_Sigma_c(Shield<SEXP>(Rcpp::wrap(Y_c)), Shield<SEXP>(Rcpp::wrap(X_c)), Shield<SEXP>(Rcpp::wrap(aux_A)), Shield<SEXP>(Rcpp::wrap(aux_V)), Shield<SEXP>(Rcpp::wrap(aux_Sigma)), Shield<SEXP>(Rcpp::wrap(aux_nu)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::field<arma::mat> >(rcpp_result_gen);
    }

    inline arma::field<arma::mat> sample_A_c_Sigma_c_bvars(const arma::mat& Y_c, const arma::mat& X_c, const arma::mat& aux_A, const arma::mat& aux_V_inv, const arma::mat& aux_Sigma, const double& aux_nu) {
        typedef SEXP(*Ptr_sample_A_c_Sigma_c_bvars)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_A_c_Sigma_c_bvars p_sample_A_c_Sigma_c_bvars = NULL;
        if (p_sample_A_c_Sigma_c_bvars == NULL) {
            validateSignature("arma::field<arma::mat>(*sample_A_c_Sigma_c_bvars)(const arma::mat&,const arma::mat&,const arma::mat&,const arma::mat&,const arma::mat&,const double&)");
            p_sample_A_c_Sigma_c_bvars = (Ptr_sample_A_c_Sigma_c_bvars)R_GetCCallable("bpvars", "_bpvars_sample_A_c_Sigma_c_bvars");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_A_c_Sigma_c_bvars(Shield<SEXP>(Rcpp::wrap(Y_c)), Shield<SEXP>(Rcpp::wrap(X_c)), Shield<SEXP>(Rcpp::wrap(aux_A)), Shield<SEXP>(Rcpp::wrap(aux_V_inv)), Shield<SEXP>(Rcpp::wrap(aux_Sigma)), Shield<SEXP>(Rcpp::wrap(aux_nu)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::field<arma::mat> >(rcpp_result_gen);
    }

    inline double log_kernel_ga(const arma::mat& YG, const arma::mat& XG, const arma::mat A_g, const arma::mat Sigma_g, const arma::mat& aux_A, const arma::mat& aux_V_inv, const arma::mat& aux_Sigma, const arma::mat& aux_Sigma_inv, const double& aux_nu) {
        typedef SEXP(*Ptr_log_kernel_ga)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_log_kernel_ga p_log_kernel_ga = NULL;
        if (p_log_kernel_ga == NULL) {
            validateSignature("double(*log_kernel_ga)(const arma::mat&,const arma::mat&,const arma::mat,const arma::mat,const arma::mat&,const arma::mat&,const arma::mat&,const arma::mat&,const double&)");
            p_log_kernel_ga = (Ptr_log_kernel_ga)R_GetCCallable("bpvars", "_bpvars_log_kernel_ga");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_log_kernel_ga(Shield<SEXP>(Rcpp::wrap(YG)), Shield<SEXP>(Rcpp::wrap(XG)), Shield<SEXP>(Rcpp::wrap(A_g)), Shield<SEXP>(Rcpp::wrap(Sigma_g)), Shield<SEXP>(Rcpp::wrap(aux_A)), Shield<SEXP>(Rcpp::wrap(aux_V_inv)), Shield<SEXP>(Rcpp::wrap(aux_Sigma)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_inv)), Shield<SEXP>(Rcpp::wrap(aux_nu)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double log_kernel_ga_gg(const arma::cube& aux_A_g, const arma::cube& aux_Sigma_g, const arma::cube& aux_A_c, const arma::cube& aux_Sigma_c_inv, const arma::mat& aux_V_inv, const arma::vec& aux_ga, const double& aux_nu, const double& aux_m, const double& aux_s, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_log_kernel_ga_gg)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_log_kernel_ga_gg p_log_kernel_ga_gg = NULL;
        if (p_log_kernel_ga_gg == NULL) {
            validateSignature("double(*log_kernel_ga_gg)(const arma::cube&,const arma::cube&,const arma::cube&,const arma::cube&,const arma::mat&,const arma::vec&,const double&,const double&,const double&,const Rcpp::List&)");
            p_log_kernel_ga_gg = (Ptr_log_kernel_ga_gg)R_GetCCallable("bpvars", "_bpvars_log_kernel_ga_gg");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_log_kernel_ga_gg(Shield<SEXP>(Rcpp::wrap(aux_A_g)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_g)), Shield<SEXP>(Rcpp::wrap(aux_A_c)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_V_inv)), Shield<SEXP>(Rcpp::wrap(aux_ga)), Shield<SEXP>(Rcpp::wrap(aux_nu)), Shield<SEXP>(Rcpp::wrap(aux_m)), Shield<SEXP>(Rcpp::wrap(aux_s)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline arma::vec sample_group_allocation(arma::vec& aux_ga, const arma::field<arma::mat>& y, const arma::field<arma::mat>& x, const arma::cube aux_A_g, const arma::cube aux_Sigma_g, const arma::mat& aux_A, const arma::mat& aux_V_inv, const arma::mat& aux_Sigma, const arma::mat& aux_Sigma_inv, const double& aux_nu) {
        typedef SEXP(*Ptr_sample_group_allocation)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_group_allocation p_sample_group_allocation = NULL;
        if (p_sample_group_allocation == NULL) {
            validateSignature("arma::vec(*sample_group_allocation)(arma::vec&,const arma::field<arma::mat>&,const arma::field<arma::mat>&,const arma::cube,const arma::cube,const arma::mat&,const arma::mat&,const arma::mat&,const arma::mat&,const double&)");
            p_sample_group_allocation = (Ptr_sample_group_allocation)R_GetCCallable("bpvars", "_bpvars_sample_group_allocation");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_group_allocation(Shield<SEXP>(Rcpp::wrap(aux_ga)), Shield<SEXP>(Rcpp::wrap(y)), Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(aux_A_g)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_g)), Shield<SEXP>(Rcpp::wrap(aux_A)), Shield<SEXP>(Rcpp::wrap(aux_V_inv)), Shield<SEXP>(Rcpp::wrap(aux_Sigma)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_inv)), Shield<SEXP>(Rcpp::wrap(aux_nu)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::vec >(rcpp_result_gen);
    }

    inline arma::vec sample_group_allocation_gg(arma::vec& aux_ga, const arma::cube& aux_A_g, const arma::cube& aux_Sigma_g, const arma::cube& aux_A_c, const arma::cube& aux_Sigma_c_inv, const arma::mat& aux_V_inv, const double& aux_nu, const double& aux_m, const double& aux_s, const Rcpp::List& prior) {
        typedef SEXP(*Ptr_sample_group_allocation_gg)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_sample_group_allocation_gg p_sample_group_allocation_gg = NULL;
        if (p_sample_group_allocation_gg == NULL) {
            validateSignature("arma::vec(*sample_group_allocation_gg)(arma::vec&,const arma::cube&,const arma::cube&,const arma::cube&,const arma::cube&,const arma::mat&,const double&,const double&,const double&,const Rcpp::List&)");
            p_sample_group_allocation_gg = (Ptr_sample_group_allocation_gg)R_GetCCallable("bpvars", "_bpvars_sample_group_allocation_gg");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_group_allocation_gg(Shield<SEXP>(Rcpp::wrap(aux_ga)), Shield<SEXP>(Rcpp::wrap(aux_A_g)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_g)), Shield<SEXP>(Rcpp::wrap(aux_A_c)), Shield<SEXP>(Rcpp::wrap(aux_Sigma_c_inv)), Shield<SEXP>(Rcpp::wrap(aux_V_inv)), Shield<SEXP>(Rcpp::wrap(aux_nu)), Shield<SEXP>(Rcpp::wrap(aux_m)), Shield<SEXP>(Rcpp::wrap(aux_s)), Shield<SEXP>(Rcpp::wrap(prior)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::vec >(rcpp_result_gen);
    }

    inline arma::mat tcube_to_mat_by_slices(arma::cube Y) {
        typedef SEXP(*Ptr_tcube_to_mat_by_slices)(SEXP);
        static Ptr_tcube_to_mat_by_slices p_tcube_to_mat_by_slices = NULL;
        if (p_tcube_to_mat_by_slices == NULL) {
            validateSignature("arma::mat(*tcube_to_mat_by_slices)(arma::cube)");
            p_tcube_to_mat_by_slices = (Ptr_tcube_to_mat_by_slices)R_GetCCallable("bpvars", "_bpvars_tcube_to_mat_by_slices");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_tcube_to_mat_by_slices(Shield<SEXP>(Rcpp::wrap(Y)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline arma::mat field_to_mat(const arma::field<arma::mat>& Y, const arma::uvec& which) {
        typedef SEXP(*Ptr_field_to_mat)(SEXP,SEXP);
        static Ptr_field_to_mat p_field_to_mat = NULL;
        if (p_field_to_mat == NULL) {
            validateSignature("arma::mat(*field_to_mat)(const arma::field<arma::mat>&,const arma::uvec&)");
            p_field_to_mat = (Ptr_field_to_mat)R_GetCCallable("bpvars", "_bpvars_field_to_mat");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_field_to_mat(Shield<SEXP>(Rcpp::wrap(Y)), Shield<SEXP>(Rcpp::wrap(which)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<arma::mat >(rcpp_result_gen);
    }

    inline int sample_arma(arma::vec y, arma::vec probabilities) {
        typedef SEXP(*Ptr_sample_arma)(SEXP,SEXP);
        static Ptr_sample_arma p_sample_arma = NULL;
        if (p_sample_arma == NULL) {
            validateSignature("int(*sample_arma)(arma::vec,arma::vec)");
            p_sample_arma = (Ptr_sample_arma)R_GetCCallable("bpvars", "_bpvars_sample_arma");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_sample_arma(Shield<SEXP>(Rcpp::wrap(y)), Shield<SEXP>(Rcpp::wrap(probabilities)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<int >(rcpp_result_gen);
    }

}

#endif // RCPP_bpvars_RCPPEXPORTS_H_GEN_
