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

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

using namespace Rcpp;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>&  Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// remDerivatives
Rcpp::List remDerivatives(const arma::vec& pars, const arma::cube& stats, const arma::field<arma::uvec>& actor1, const arma::field<arma::uvec>& actor2, const arma::field<arma::uvec>& dyad, const Rcpp::List& omit_dyad, const arma::vec& interevent_time, std::string model, bool ordinal, int ncores, bool gradient, bool hessian, bool senderRate, Rcpp::Nullable<int> N, Rcpp::Nullable<Rcpp::IntegerVector> sender_riskset, Rcpp::Nullable<Rcpp::List> receiver_riskset);
RcppExport SEXP _remstimate_remDerivatives(SEXP parsSEXP, SEXP statsSEXP, SEXP actor1SEXP, SEXP actor2SEXP, SEXP dyadSEXP, SEXP omit_dyadSEXP, SEXP interevent_timeSEXP, SEXP modelSEXP, SEXP ordinalSEXP, SEXP ncoresSEXP, SEXP gradientSEXP, SEXP hessianSEXP, SEXP senderRateSEXP, SEXP NSEXP, SEXP sender_risksetSEXP, SEXP receiver_risksetSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::vec& >::type pars(parsSEXP);
    Rcpp::traits::input_parameter< const arma::cube& >::type stats(statsSEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type actor1(actor1SEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type actor2(actor2SEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type dyad(dyadSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type omit_dyad(omit_dyadSEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type interevent_time(interevent_timeSEXP);
    Rcpp::traits::input_parameter< std::string >::type model(modelSEXP);
    Rcpp::traits::input_parameter< bool >::type ordinal(ordinalSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    Rcpp::traits::input_parameter< bool >::type gradient(gradientSEXP);
    Rcpp::traits::input_parameter< bool >::type hessian(hessianSEXP);
    Rcpp::traits::input_parameter< bool >::type senderRate(senderRateSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<int> >::type N(NSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::IntegerVector> >::type sender_riskset(sender_risksetSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::List> >::type receiver_riskset(receiver_risksetSEXP);
    rcpp_result_gen = Rcpp::wrap(remDerivatives(pars, stats, actor1, actor2, dyad, omit_dyad, interevent_time, model, ordinal, ncores, gradient, hessian, senderRate, N, sender_riskset, receiver_riskset));
    return rcpp_result_gen;
END_RCPP
}
// GDADAMAX
Rcpp::List GDADAMAX(const arma::vec& pars, const arma::cube& stats, const arma::field<arma::uvec>& actor1, const arma::field<arma::uvec>& actor2, const arma::field<arma::uvec>& dyad, const Rcpp::List& omit_dyad, const arma::vec& interevent_time, std::string model, bool ordinal, bool senderRate, bool gradient, bool hessian, Rcpp::Nullable<int> N, int ncores, int epochs, double learning_rate, double beta1, double beta2, double epsilon);
RcppExport SEXP _remstimate_GDADAMAX(SEXP parsSEXP, SEXP statsSEXP, SEXP actor1SEXP, SEXP actor2SEXP, SEXP dyadSEXP, SEXP omit_dyadSEXP, SEXP interevent_timeSEXP, SEXP modelSEXP, SEXP ordinalSEXP, SEXP senderRateSEXP, SEXP gradientSEXP, SEXP hessianSEXP, SEXP NSEXP, SEXP ncoresSEXP, SEXP epochsSEXP, SEXP learning_rateSEXP, SEXP beta1SEXP, SEXP beta2SEXP, SEXP epsilonSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::vec& >::type pars(parsSEXP);
    Rcpp::traits::input_parameter< const arma::cube& >::type stats(statsSEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type actor1(actor1SEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type actor2(actor2SEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type dyad(dyadSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type omit_dyad(omit_dyadSEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type interevent_time(interevent_timeSEXP);
    Rcpp::traits::input_parameter< std::string >::type model(modelSEXP);
    Rcpp::traits::input_parameter< bool >::type ordinal(ordinalSEXP);
    Rcpp::traits::input_parameter< bool >::type senderRate(senderRateSEXP);
    Rcpp::traits::input_parameter< bool >::type gradient(gradientSEXP);
    Rcpp::traits::input_parameter< bool >::type hessian(hessianSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<int> >::type N(NSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    Rcpp::traits::input_parameter< int >::type epochs(epochsSEXP);
    Rcpp::traits::input_parameter< double >::type learning_rate(learning_rateSEXP);
    Rcpp::traits::input_parameter< double >::type beta1(beta1SEXP);
    Rcpp::traits::input_parameter< double >::type beta2(beta2SEXP);
    Rcpp::traits::input_parameter< double >::type epsilon(epsilonSEXP);
    rcpp_result_gen = Rcpp::wrap(GDADAMAX(pars, stats, actor1, actor2, dyad, omit_dyad, interevent_time, model, ordinal, senderRate, gradient, hessian, N, ncores, epochs, learning_rate, beta1, beta2, epsilon));
    return rcpp_result_gen;
END_RCPP
}
// HMC
Rcpp::List HMC(arma::mat pars_init, arma::uword nsim, arma::uword nchains, arma::uword burnin, const arma::vec& meanPrior, const arma::mat& sigmaPrior, const arma::cube& stats, const arma::field<arma::uvec>& actor1, const arma::field<arma::uvec>& actor2, const arma::field<arma::uvec>& dyad, const Rcpp::List& omit_dyad, const arma::vec& interevent_time, std::string model, bool ordinal, int ncores, bool senderRate, Rcpp::Nullable<int> N, arma::uword thin, arma::uword L, double epsilon, Rcpp::Nullable<Rcpp::IntegerVector> sender_riskset, Rcpp::Nullable<Rcpp::List> receiver_riskset);
RcppExport SEXP _remstimate_HMC(SEXP pars_initSEXP, SEXP nsimSEXP, SEXP nchainsSEXP, SEXP burninSEXP, SEXP meanPriorSEXP, SEXP sigmaPriorSEXP, SEXP statsSEXP, SEXP actor1SEXP, SEXP actor2SEXP, SEXP dyadSEXP, SEXP omit_dyadSEXP, SEXP interevent_timeSEXP, SEXP modelSEXP, SEXP ordinalSEXP, SEXP ncoresSEXP, SEXP senderRateSEXP, SEXP NSEXP, SEXP thinSEXP, SEXP LSEXP, SEXP epsilonSEXP, SEXP sender_risksetSEXP, SEXP receiver_risksetSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type pars_init(pars_initSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type nsim(nsimSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type nchains(nchainsSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type burnin(burninSEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type meanPrior(meanPriorSEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type sigmaPrior(sigmaPriorSEXP);
    Rcpp::traits::input_parameter< const arma::cube& >::type stats(statsSEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type actor1(actor1SEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type actor2(actor2SEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type dyad(dyadSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type omit_dyad(omit_dyadSEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type interevent_time(interevent_timeSEXP);
    Rcpp::traits::input_parameter< std::string >::type model(modelSEXP);
    Rcpp::traits::input_parameter< bool >::type ordinal(ordinalSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    Rcpp::traits::input_parameter< bool >::type senderRate(senderRateSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<int> >::type N(NSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type thin(thinSEXP);
    Rcpp::traits::input_parameter< arma::uword >::type L(LSEXP);
    Rcpp::traits::input_parameter< double >::type epsilon(epsilonSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::IntegerVector> >::type sender_riskset(sender_risksetSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::List> >::type receiver_riskset(receiver_risksetSEXP);
    rcpp_result_gen = Rcpp::wrap(HMC(pars_init, nsim, nchains, burnin, meanPrior, sigmaPrior, stats, actor1, actor2, dyad, omit_dyad, interevent_time, model, ordinal, ncores, senderRate, N, thin, L, epsilon, sender_riskset, receiver_riskset));
    return rcpp_result_gen;
END_RCPP
}
// getWAIC
double getWAIC(arma::vec mu, arma::mat vcov, arma::mat pars, const arma::cube& stats, const arma::field<arma::uvec>& actor1, const arma::field<arma::uvec>& actor2, const arma::field<arma::uvec>& dyad, const arma::vec& interevent_time, const Rcpp::List& omit_dyad, std::string model, std::string approach, bool ordinal, int ncores, bool senderRate, int nsim, Rcpp::Nullable<Rcpp::IntegerVector> sender_riskset, Rcpp::Nullable<Rcpp::List> receiver_riskset);
RcppExport SEXP _remstimate_getWAIC(SEXP muSEXP, SEXP vcovSEXP, SEXP parsSEXP, SEXP statsSEXP, SEXP actor1SEXP, SEXP actor2SEXP, SEXP dyadSEXP, SEXP interevent_timeSEXP, SEXP omit_dyadSEXP, SEXP modelSEXP, SEXP approachSEXP, SEXP ordinalSEXP, SEXP ncoresSEXP, SEXP senderRateSEXP, SEXP nsimSEXP, SEXP sender_risksetSEXP, SEXP receiver_risksetSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::vec >::type mu(muSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type vcov(vcovSEXP);
    Rcpp::traits::input_parameter< arma::mat >::type pars(parsSEXP);
    Rcpp::traits::input_parameter< const arma::cube& >::type stats(statsSEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type actor1(actor1SEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type actor2(actor2SEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type dyad(dyadSEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type interevent_time(interevent_timeSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type omit_dyad(omit_dyadSEXP);
    Rcpp::traits::input_parameter< std::string >::type model(modelSEXP);
    Rcpp::traits::input_parameter< std::string >::type approach(approachSEXP);
    Rcpp::traits::input_parameter< bool >::type ordinal(ordinalSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    Rcpp::traits::input_parameter< bool >::type senderRate(senderRateSEXP);
    Rcpp::traits::input_parameter< int >::type nsim(nsimSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::IntegerVector> >::type sender_riskset(sender_risksetSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::List> >::type receiver_riskset(receiver_risksetSEXP);
    rcpp_result_gen = Rcpp::wrap(getWAIC(mu, vcov, pars, stats, actor1, actor2, dyad, interevent_time, omit_dyad, model, approach, ordinal, ncores, senderRate, nsim, sender_riskset, receiver_riskset));
    return rcpp_result_gen;
END_RCPP
}
// computeDiagnostics
Rcpp::List computeDiagnostics(const arma::vec& pars, const arma::cube& stats, const arma::field<arma::uvec>& actor1, const arma::field<arma::uvec>& actor2, const arma::field<arma::uvec>& dyad, const Rcpp::List& omit_dyad, std::string model, int N, bool senderRate, int ncores, double baseline);
RcppExport SEXP _remstimate_computeDiagnostics(SEXP parsSEXP, SEXP statsSEXP, SEXP actor1SEXP, SEXP actor2SEXP, SEXP dyadSEXP, SEXP omit_dyadSEXP, SEXP modelSEXP, SEXP NSEXP, SEXP senderRateSEXP, SEXP ncoresSEXP, SEXP baselineSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::vec& >::type pars(parsSEXP);
    Rcpp::traits::input_parameter< const arma::cube& >::type stats(statsSEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type actor1(actor1SEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type actor2(actor2SEXP);
    Rcpp::traits::input_parameter< const arma::field<arma::uvec>& >::type dyad(dyadSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type omit_dyad(omit_dyadSEXP);
    Rcpp::traits::input_parameter< std::string >::type model(modelSEXP);
    Rcpp::traits::input_parameter< int >::type N(NSEXP);
    Rcpp::traits::input_parameter< bool >::type senderRate(senderRateSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    Rcpp::traits::input_parameter< double >::type baseline(baselineSEXP);
    rcpp_result_gen = Rcpp::wrap(computeDiagnostics(pars, stats, actor1, actor2, dyad, omit_dyad, model, N, senderRate, ncores, baseline));
    return rcpp_result_gen;
END_RCPP
}
// remDerivativesSampled
Rcpp::List remDerivativesSampled(const arma::vec& pars, const arma::cube& stats, const Rcpp::List& case_pos, const arma::mat& samp_prob, const arma::vec& interevent_time, bool ordinal, bool gradient, bool hessian, int ncores);
RcppExport SEXP _remstimate_remDerivativesSampled(SEXP parsSEXP, SEXP statsSEXP, SEXP case_posSEXP, SEXP samp_probSEXP, SEXP interevent_timeSEXP, SEXP ordinalSEXP, SEXP gradientSEXP, SEXP hessianSEXP, SEXP ncoresSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::vec& >::type pars(parsSEXP);
    Rcpp::traits::input_parameter< const arma::cube& >::type stats(statsSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type case_pos(case_posSEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type samp_prob(samp_probSEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type interevent_time(interevent_timeSEXP);
    Rcpp::traits::input_parameter< bool >::type ordinal(ordinalSEXP);
    Rcpp::traits::input_parameter< bool >::type gradient(gradientSEXP);
    Rcpp::traits::input_parameter< bool >::type hessian(hessianSEXP);
    Rcpp::traits::input_parameter< int >::type ncores(ncoresSEXP);
    rcpp_result_gen = Rcpp::wrap(remDerivativesSampled(pars, stats, case_pos, samp_prob, interevent_time, ordinal, gradient, hessian, ncores));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_remstimate_remDerivatives", (DL_FUNC) &_remstimate_remDerivatives, 16},
    {"_remstimate_GDADAMAX", (DL_FUNC) &_remstimate_GDADAMAX, 19},
    {"_remstimate_HMC", (DL_FUNC) &_remstimate_HMC, 22},
    {"_remstimate_getWAIC", (DL_FUNC) &_remstimate_getWAIC, 17},
    {"_remstimate_computeDiagnostics", (DL_FUNC) &_remstimate_computeDiagnostics, 11},
    {"_remstimate_remDerivativesSampled", (DL_FUNC) &_remstimate_remDerivativesSampled, 9},
    {NULL, NULL, 0}
};

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