#ifndef MODELS_HPP
#define MODELS_HPP
#define STAN__SERVICES__COMMAND_HPP
#include <rstan/rstaninc.hpp>
#ifndef USE_STANC3
#define USE_STANC3
#endif
// Code generated by stanc v2.32.2
#include <stan/model/model_header.hpp>
namespace model81214d872721__namespace {
using stan::model::model_base_crtp;
using namespace stan::math;
stan::math::profile_map profiles__;
static constexpr std::array<const char*, 165> locations_array__ =
  {" (found before start of program)",
  " (in 'anon_model', line 11, column 3 to column 38)",
  " (in 'anon_model', line 12, column 3 to column 36)",
  " (in 'anon_model', line 13, column 3 to column 47)",
  " (in 'anon_model', line 14, column 2 to column 50)",
  " (in 'anon_model', line 15, column 2 to column 48)",
  " (in 'anon_model', line 16, column 2 to column 54)",
  " (in 'anon_model', line 17, column 2 to column 36)",
  " (in 'anon_model', line 18, column 2 to column 34)",
  " (in 'anon_model', line 19, column 2 to column 36)",
  " (in 'anon_model', line 20, column 2 to column 34)",
  " (in 'anon_model', line 21, column 2 to column 36)",
  " (in 'anon_model', line 22, column 2 to column 34)",
  " (in 'anon_model', line 23, column 2 to column 36)",
  " (in 'anon_model', line 24, column 2 to column 34)",
  " (in 'anon_model', line 25, column 2 to column 36)",
  " (in 'anon_model', line 26, column 2 to column 34)",
  " (in 'anon_model', line 27, column 2 to column 36)",
  " (in 'anon_model', line 28, column 2 to column 34)",
  " (in 'anon_model', line 29, column 2 to column 36)",
  " (in 'anon_model', line 30, column 2 to column 34)",
  " (in 'anon_model', line 31, column 2 to column 36)",
  " (in 'anon_model', line 32, column 2 to column 34)",
  " (in 'anon_model', line 35, column 2 to column 34)",
  " (in 'anon_model', line 36, column 2 to column 42)",
  " (in 'anon_model', line 37, column 2 to column 34)",
  " (in 'anon_model', line 38, column 2 to column 42)",
  " (in 'anon_model', line 39, column 2 to column 47)",
  " (in 'anon_model', line 40, column 2 to column 50)",
  " (in 'anon_model', line 41, column 2 to column 45)",
  " (in 'anon_model', line 42, column 2 to column 48)",
  " (in 'anon_model', line 43, column 2 to column 47)",
  " (in 'anon_model', line 44, column 2 to column 50)",
  " (in 'anon_model', line 45, column 2 to column 45)",
  " (in 'anon_model', line 46, column 2 to column 48)",
  " (in 'anon_model', line 47, column 2 to column 47)",
  " (in 'anon_model', line 48, column 2 to column 50)",
  " (in 'anon_model', line 49, column 2 to column 45)",
  " (in 'anon_model', line 50, column 2 to column 48)",
  " (in 'anon_model', line 51, column 2 to column 47)",
  " (in 'anon_model', line 52, column 2 to column 50)",
  " (in 'anon_model', line 53, column 2 to column 45)",
  " (in 'anon_model', line 54, column 2 to column 48)",
  " (in 'anon_model', line 55, column 2 to column 47)",
  " (in 'anon_model', line 56, column 2 to column 50)",
  " (in 'anon_model', line 57, column 2 to column 45)",
  " (in 'anon_model', line 58, column 2 to column 48)",
  " (in 'anon_model', line 59, column 2 to column 47)",
  " (in 'anon_model', line 60, column 2 to column 50)",
  " (in 'anon_model', line 61, column 2 to column 45)",
  " (in 'anon_model', line 62, column 2 to column 48)",
  " (in 'anon_model', line 63, column 2 to column 47)",
  " (in 'anon_model', line 64, column 2 to column 50)",
  " (in 'anon_model', line 65, column 2 to column 45)",
  " (in 'anon_model', line 66, column 2 to column 48)",
  " (in 'anon_model', line 67, column 2 to column 47)",
  " (in 'anon_model', line 68, column 2 to column 50)",
  " (in 'anon_model', line 69, column 2 to column 45)",
  " (in 'anon_model', line 70, column 2 to column 48)",
  " (in 'anon_model', line 74, column 3 to column 48)",
  " (in 'anon_model', line 75, column 3 to column 46)",
  " (in 'anon_model', line 76, column 3 to column 51)",
  " (in 'anon_model', line 77, column 2 to column 47)",
  " (in 'anon_model', line 78, column 2 to column 45)",
  " (in 'anon_model', line 79, column 2 to column 45)",
  " (in 'anon_model', line 82, column 3 to column 107)",
  " (in 'anon_model', line 86, column 2 to column 94)",
  " (in 'anon_model', line 88, column 2 to column 44)",
  " (in 'anon_model', line 89, column 2 to column 42)",
  " (in 'anon_model', line 91, column 3 to column 103)",
  " (in 'anon_model', line 95, column 2 to column 90)",
  " (in 'anon_model', line 97, column 2 to column 44)",
  " (in 'anon_model', line 98, column 2 to column 42)",
  " (in 'anon_model', line 100, column 3 to column 107)",
  " (in 'anon_model', line 104, column 2 to column 94)",
  " (in 'anon_model', line 106, column 2 to column 44)",
  " (in 'anon_model', line 107, column 2 to column 42)",
  " (in 'anon_model', line 109, column 3 to column 103)",
  " (in 'anon_model', line 113, column 2 to column 90)",
  " (in 'anon_model', line 115, column 2 to column 44)",
  " (in 'anon_model', line 116, column 2 to column 42)",
  " (in 'anon_model', line 118, column 3 to column 107)",
  " (in 'anon_model', line 122, column 2 to column 94)",
  " (in 'anon_model', line 124, column 2 to column 44)",
  " (in 'anon_model', line 125, column 2 to column 42)",
  " (in 'anon_model', line 127, column 3 to column 103)",
  " (in 'anon_model', line 131, column 2 to column 90)",
  " (in 'anon_model', line 133, column 2 to column 44)",
  " (in 'anon_model', line 134, column 2 to column 42)",
  " (in 'anon_model', line 136, column 3 to column 107)",
  " (in 'anon_model', line 140, column 2 to column 94)",
  " (in 'anon_model', line 142, column 2 to column 44)",
  " (in 'anon_model', line 143, column 2 to column 42)",
  " (in 'anon_model', line 145, column 3 to column 103)",
  " (in 'anon_model', line 149, column 2 to column 90)",
  " (in 'anon_model', line 151, column 2 to column 44)",
  " (in 'anon_model', line 152, column 2 to column 42)",
  " (in 'anon_model', line 154, column 3 to column 107)",
  " (in 'anon_model', line 158, column 2 to column 94)",
  " (in 'anon_model', line 160, column 2 to column 44)",
  " (in 'anon_model', line 161, column 2 to column 42)",
  " (in 'anon_model', line 163, column 3 to column 103)",
  " (in 'anon_model', line 167, column 2 to column 90)",
  " (in 'anon_model', line 169, column 2 to column 44)",
  " (in 'anon_model', line 170, column 2 to column 42)",
  " (in 'anon_model', line 172, column 3 to column 107)",
  " (in 'anon_model', line 176, column 2 to column 94)",
  " (in 'anon_model', line 178, column 2 to column 44)",
  " (in 'anon_model', line 179, column 2 to column 42)",
  " (in 'anon_model', line 181, column 3 to column 103)",
  " (in 'anon_model', line 185, column 2 to column 90)",
  " (in 'anon_model', line 187, column 2 to column 44)",
  " (in 'anon_model', line 188, column 2 to column 42)",
  " (in 'anon_model', line 190, column 3 to column 107)",
  " (in 'anon_model', line 194, column 2 to column 94)",
  " (in 'anon_model', line 196, column 2 to column 44)",
  " (in 'anon_model', line 197, column 2 to column 42)",
  " (in 'anon_model', line 199, column 3 to column 103)",
  " (in 'anon_model', line 203, column 2 to column 90)",
  " (in 'anon_model', line 205, column 2 to column 44)",
  " (in 'anon_model', line 206, column 2 to column 42)",
  " (in 'anon_model', line 208, column 3 to column 107)",
  " (in 'anon_model', line 212, column 2 to column 94)",
  " (in 'anon_model', line 214, column 2 to column 44)",
  " (in 'anon_model', line 215, column 2 to column 42)",
  " (in 'anon_model', line 217, column 3 to column 103)",
  " (in 'anon_model', line 221, column 2 to column 90)",
  " (in 'anon_model', line 223, column 2 to column 44)",
  " (in 'anon_model', line 224, column 2 to column 42)",
  " (in 'anon_model', line 2, column 2 to column 25)",
  " (in 'anon_model', line 3, column 8 to column 17)",
  " (in 'anon_model', line 3, column 2 to column 35)",
  " (in 'anon_model', line 4, column 9 to column 18)",
  " (in 'anon_model', line 4, column 2 to column 26)",
  " (in 'anon_model', line 5, column 18 to column 27)",
  " (in 'anon_model', line 5, column 2 to column 34)",
  " (in 'anon_model', line 6, column 8 to column 17)",
  " (in 'anon_model', line 6, column 2 to column 35)",
  " (in 'anon_model', line 7, column 9 to column 18)",
  " (in 'anon_model', line 7, column 2 to column 26)",
  " (in 'anon_model', line 8, column 18 to column 27)",
  " (in 'anon_model', line 8, column 2 to column 34)",
  " (in 'anon_model', line 14, column 9 to column 18)",
  " (in 'anon_model', line 15, column 9 to column 18)",
  " (in 'anon_model', line 16, column 18 to column 27)",
  " (in 'anon_model', line 17, column 9 to column 14)",
  " (in 'anon_model', line 18, column 9 to column 14)",
  " (in 'anon_model', line 19, column 9 to column 14)",
  " (in 'anon_model', line 20, column 9 to column 14)",
  " (in 'anon_model', line 21, column 9 to column 14)",
  " (in 'anon_model', line 22, column 9 to column 14)",
  " (in 'anon_model', line 23, column 9 to column 14)",
  " (in 'anon_model', line 24, column 9 to column 14)",
  " (in 'anon_model', line 25, column 9 to column 14)",
  " (in 'anon_model', line 26, column 9 to column 14)",
  " (in 'anon_model', line 27, column 9 to column 14)",
  " (in 'anon_model', line 28, column 9 to column 14)",
  " (in 'anon_model', line 29, column 9 to column 14)",
  " (in 'anon_model', line 30, column 9 to column 14)",
  " (in 'anon_model', line 31, column 9 to column 14)",
  " (in 'anon_model', line 32, column 9 to column 14)",
  " (in 'anon_model', line 35, column 9 to column 18)",
  " (in 'anon_model', line 36, column 18 to column 27)",
  " (in 'anon_model', line 37, column 9 to column 18)",
  " (in 'anon_model', line 38, column 18 to column 27)"};
class model81214d872721_ final : public model_base_crtp<model81214d872721_> {
private:
  int n_studies;
  std::vector<int> nE;
  Eigen::Matrix<double,-1,1> meanE_data__;
  Eigen::Matrix<double,-1,1> varE_data__;
  std::vector<int> nC;
  Eigen::Matrix<double,-1,1> meanC_data__;
  Eigen::Matrix<double,-1,1> varC_data__;
  int treatment_subject_1_1dim__;
  int control_subject_1_1dim__;
  int treatment_subject_2_1dim__;
  int control_subject_2_1dim__;
  int treatment_subject_3_1dim__;
  int control_subject_3_1dim__;
  int treatment_subject_4_1dim__;
  int control_subject_4_1dim__;
  int treatment_subject_5_1dim__;
  int control_subject_5_1dim__;
  int treatment_subject_6_1dim__;
  int control_subject_6_1dim__;
  int treatment_subject_7_1dim__;
  int control_subject_7_1dim__;
  int treatment_subject_8_1dim__;
  int control_subject_8_1dim__;
  Eigen::Map<Eigen::Matrix<double,-1,1>> meanE{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> varE{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> meanC{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> varC{nullptr, 0};
public:
  ~model81214d872721_() {}
  model81214d872721_(stan::io::var_context& context__, unsigned int
                     random_seed__ = 0, std::ostream* pstream__ = nullptr)
      : model_base_crtp(0) {
    int current_statement__ = 0;
    using local_scalar_t__ = double;
    boost::ecuyer1988 base_rng__ =
      stan::services::util::create_rng(random_seed__, 0);
    // suppress unused var warning
    (void) base_rng__;
    static constexpr const char* function__ =
      "model81214d872721__namespace::model81214d872721_";
    // suppress unused var warning
    (void) function__;
    local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
    // suppress unused var warning
    (void) DUMMY_VAR__;
    try {
      int pos__ = std::numeric_limits<int>::min();
      pos__ = 1;
      current_statement__ = 129;
      context__.validate_dims("data initialization", "n_studies", "int",
        std::vector<size_t>{});
      n_studies = std::numeric_limits<int>::min();
      current_statement__ = 129;
      n_studies = context__.vals_i("n_studies")[(1 - 1)];
      current_statement__ = 129;
      stan::math::check_greater_or_equal(function__, "n_studies", n_studies,
        1);
      current_statement__ = 130;
      stan::math::validate_non_negative_index("nE", "n_studies", n_studies);
      current_statement__ = 131;
      context__.validate_dims("data initialization", "nE", "int",
        std::vector<size_t>{static_cast<size_t>(n_studies)});
      nE = std::vector<int>(n_studies, std::numeric_limits<int>::min());
      current_statement__ = 131;
      nE = context__.vals_i("nE");
      current_statement__ = 131;
      stan::math::check_greater_or_equal(function__, "nE", nE, 1);
      current_statement__ = 132;
      stan::math::validate_non_negative_index("meanE", "n_studies", n_studies);
      current_statement__ = 133;
      context__.validate_dims("data initialization", "meanE", "double",
        std::vector<size_t>{static_cast<size_t>(n_studies)});
      meanE_data__ = Eigen::Matrix<double,-1,1>::Constant(n_studies,
                       std::numeric_limits<double>::quiet_NaN());
      new (&meanE)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(meanE_data__.data(),
        n_studies);
      {
        std::vector<local_scalar_t__> meanE_flat__;
        current_statement__ = 133;
        meanE_flat__ = context__.vals_r("meanE");
        current_statement__ = 133;
        pos__ = 1;
        current_statement__ = 133;
        for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
          current_statement__ = 133;
          stan::model::assign(meanE, meanE_flat__[(pos__ - 1)],
            "assigning variable meanE", stan::model::index_uni(sym1__));
          current_statement__ = 133;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 134;
      stan::math::validate_non_negative_index("varE", "n_studies", n_studies);
      current_statement__ = 135;
      context__.validate_dims("data initialization", "varE", "double",
        std::vector<size_t>{static_cast<size_t>(n_studies)});
      varE_data__ = Eigen::Matrix<double,-1,1>::Constant(n_studies,
                      std::numeric_limits<double>::quiet_NaN());
      new (&varE) Eigen::Map<Eigen::Matrix<double,-1,1>>(varE_data__.data(),
        n_studies);
      {
        std::vector<local_scalar_t__> varE_flat__;
        current_statement__ = 135;
        varE_flat__ = context__.vals_r("varE");
        current_statement__ = 135;
        pos__ = 1;
        current_statement__ = 135;
        for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
          current_statement__ = 135;
          stan::model::assign(varE, varE_flat__[(pos__ - 1)],
            "assigning variable varE", stan::model::index_uni(sym1__));
          current_statement__ = 135;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 135;
      stan::math::check_greater_or_equal(function__, "varE", varE, 0);
      current_statement__ = 136;
      stan::math::validate_non_negative_index("nC", "n_studies", n_studies);
      current_statement__ = 137;
      context__.validate_dims("data initialization", "nC", "int",
        std::vector<size_t>{static_cast<size_t>(n_studies)});
      nC = std::vector<int>(n_studies, std::numeric_limits<int>::min());
      current_statement__ = 137;
      nC = context__.vals_i("nC");
      current_statement__ = 137;
      stan::math::check_greater_or_equal(function__, "nC", nC, 1);
      current_statement__ = 138;
      stan::math::validate_non_negative_index("meanC", "n_studies", n_studies);
      current_statement__ = 139;
      context__.validate_dims("data initialization", "meanC", "double",
        std::vector<size_t>{static_cast<size_t>(n_studies)});
      meanC_data__ = Eigen::Matrix<double,-1,1>::Constant(n_studies,
                       std::numeric_limits<double>::quiet_NaN());
      new (&meanC)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(meanC_data__.data(),
        n_studies);
      {
        std::vector<local_scalar_t__> meanC_flat__;
        current_statement__ = 139;
        meanC_flat__ = context__.vals_r("meanC");
        current_statement__ = 139;
        pos__ = 1;
        current_statement__ = 139;
        for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
          current_statement__ = 139;
          stan::model::assign(meanC, meanC_flat__[(pos__ - 1)],
            "assigning variable meanC", stan::model::index_uni(sym1__));
          current_statement__ = 139;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 140;
      stan::math::validate_non_negative_index("varC", "n_studies", n_studies);
      current_statement__ = 141;
      context__.validate_dims("data initialization", "varC", "double",
        std::vector<size_t>{static_cast<size_t>(n_studies)});
      varC_data__ = Eigen::Matrix<double,-1,1>::Constant(n_studies,
                      std::numeric_limits<double>::quiet_NaN());
      new (&varC) Eigen::Map<Eigen::Matrix<double,-1,1>>(varC_data__.data(),
        n_studies);
      {
        std::vector<local_scalar_t__> varC_flat__;
        current_statement__ = 141;
        varC_flat__ = context__.vals_r("varC");
        current_statement__ = 141;
        pos__ = 1;
        current_statement__ = 141;
        for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
          current_statement__ = 141;
          stan::model::assign(varC, varC_flat__[(pos__ - 1)],
            "assigning variable varC", stan::model::index_uni(sym1__));
          current_statement__ = 141;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 141;
      stan::math::check_greater_or_equal(function__, "varC", varC, 0);
      current_statement__ = 142;
      stan::math::validate_non_negative_index(
        "inferred_group_treatment_mean", "n_studies", n_studies);
      current_statement__ = 143;
      stan::math::validate_non_negative_index("inferred_group_control_mean",
        "n_studies", n_studies);
      current_statement__ = 144;
      stan::math::validate_non_negative_index("inferred_in_group_stddev",
        "n_studies", n_studies);
      current_statement__ = 145;
      treatment_subject_1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 145;
      treatment_subject_1_1dim__ = stan::model::rvalue(nE, "nE",
                                     stan::model::index_uni(1));
      current_statement__ = 145;
      stan::math::validate_non_negative_index("treatment_subject_1", "nE[1]",
        treatment_subject_1_1dim__);
      current_statement__ = 146;
      control_subject_1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 146;
      control_subject_1_1dim__ = stan::model::rvalue(nC, "nC",
                                   stan::model::index_uni(1));
      current_statement__ = 146;
      stan::math::validate_non_negative_index("control_subject_1", "nC[1]",
        control_subject_1_1dim__);
      current_statement__ = 147;
      treatment_subject_2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 147;
      treatment_subject_2_1dim__ = stan::model::rvalue(nE, "nE",
                                     stan::model::index_uni(2));
      current_statement__ = 147;
      stan::math::validate_non_negative_index("treatment_subject_2", "nE[2]",
        treatment_subject_2_1dim__);
      current_statement__ = 148;
      control_subject_2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 148;
      control_subject_2_1dim__ = stan::model::rvalue(nC, "nC",
                                   stan::model::index_uni(2));
      current_statement__ = 148;
      stan::math::validate_non_negative_index("control_subject_2", "nC[2]",
        control_subject_2_1dim__);
      current_statement__ = 149;
      treatment_subject_3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 149;
      treatment_subject_3_1dim__ = stan::model::rvalue(nE, "nE",
                                     stan::model::index_uni(3));
      current_statement__ = 149;
      stan::math::validate_non_negative_index("treatment_subject_3", "nE[3]",
        treatment_subject_3_1dim__);
      current_statement__ = 150;
      control_subject_3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 150;
      control_subject_3_1dim__ = stan::model::rvalue(nC, "nC",
                                   stan::model::index_uni(3));
      current_statement__ = 150;
      stan::math::validate_non_negative_index("control_subject_3", "nC[3]",
        control_subject_3_1dim__);
      current_statement__ = 151;
      treatment_subject_4_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 151;
      treatment_subject_4_1dim__ = stan::model::rvalue(nE, "nE",
                                     stan::model::index_uni(4));
      current_statement__ = 151;
      stan::math::validate_non_negative_index("treatment_subject_4", "nE[4]",
        treatment_subject_4_1dim__);
      current_statement__ = 152;
      control_subject_4_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 152;
      control_subject_4_1dim__ = stan::model::rvalue(nC, "nC",
                                   stan::model::index_uni(4));
      current_statement__ = 152;
      stan::math::validate_non_negative_index("control_subject_4", "nC[4]",
        control_subject_4_1dim__);
      current_statement__ = 153;
      treatment_subject_5_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 153;
      treatment_subject_5_1dim__ = stan::model::rvalue(nE, "nE",
                                     stan::model::index_uni(5));
      current_statement__ = 153;
      stan::math::validate_non_negative_index("treatment_subject_5", "nE[5]",
        treatment_subject_5_1dim__);
      current_statement__ = 154;
      control_subject_5_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 154;
      control_subject_5_1dim__ = stan::model::rvalue(nC, "nC",
                                   stan::model::index_uni(5));
      current_statement__ = 154;
      stan::math::validate_non_negative_index("control_subject_5", "nC[5]",
        control_subject_5_1dim__);
      current_statement__ = 155;
      treatment_subject_6_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 155;
      treatment_subject_6_1dim__ = stan::model::rvalue(nE, "nE",
                                     stan::model::index_uni(6));
      current_statement__ = 155;
      stan::math::validate_non_negative_index("treatment_subject_6", "nE[6]",
        treatment_subject_6_1dim__);
      current_statement__ = 156;
      control_subject_6_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 156;
      control_subject_6_1dim__ = stan::model::rvalue(nC, "nC",
                                   stan::model::index_uni(6));
      current_statement__ = 156;
      stan::math::validate_non_negative_index("control_subject_6", "nC[6]",
        control_subject_6_1dim__);
      current_statement__ = 157;
      treatment_subject_7_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 157;
      treatment_subject_7_1dim__ = stan::model::rvalue(nE, "nE",
                                     stan::model::index_uni(7));
      current_statement__ = 157;
      stan::math::validate_non_negative_index("treatment_subject_7", "nE[7]",
        treatment_subject_7_1dim__);
      current_statement__ = 158;
      control_subject_7_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 158;
      control_subject_7_1dim__ = stan::model::rvalue(nC, "nC",
                                   stan::model::index_uni(7));
      current_statement__ = 158;
      stan::math::validate_non_negative_index("control_subject_7", "nC[7]",
        control_subject_7_1dim__);
      current_statement__ = 159;
      treatment_subject_8_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 159;
      treatment_subject_8_1dim__ = stan::model::rvalue(nE, "nE",
                                     stan::model::index_uni(8));
      current_statement__ = 159;
      stan::math::validate_non_negative_index("treatment_subject_8", "nE[8]",
        treatment_subject_8_1dim__);
      current_statement__ = 160;
      control_subject_8_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 160;
      control_subject_8_1dim__ = stan::model::rvalue(nC, "nC",
                                   stan::model::index_uni(8));
      current_statement__ = 160;
      stan::math::validate_non_negative_index("control_subject_8", "nC[8]",
        control_subject_8_1dim__);
      current_statement__ = 161;
      stan::math::validate_non_negative_index("sampled_meanE", "n_studies",
        n_studies);
      current_statement__ = 162;
      stan::math::validate_non_negative_index("sampled_varE", "n_studies",
        n_studies);
      current_statement__ = 163;
      stan::math::validate_non_negative_index("sampled_meanC", "n_studies",
        n_studies);
      current_statement__ = 164;
      stan::math::validate_non_negative_index("sampled_varC", "n_studies",
        n_studies);
    } catch (const std::exception& e) {
      stan::lang::rethrow_located(e, locations_array__[current_statement__]);
    }
    num_params_r__ = 1 + 1 + 1 + n_studies + n_studies + n_studies +
      treatment_subject_1_1dim__ + control_subject_1_1dim__ +
      treatment_subject_2_1dim__ + control_subject_2_1dim__ +
      treatment_subject_3_1dim__ + control_subject_3_1dim__ +
      treatment_subject_4_1dim__ + control_subject_4_1dim__ +
      treatment_subject_5_1dim__ + control_subject_5_1dim__ +
      treatment_subject_6_1dim__ + control_subject_6_1dim__ +
      treatment_subject_7_1dim__ + control_subject_7_1dim__ +
      treatment_subject_8_1dim__ + control_subject_8_1dim__;
  }
  inline std::string model_name() const final {
    return "model81214d872721_";
  }
  inline std::vector<std::string> model_compile_info() const noexcept {
    return std::vector<std::string>{"stanc_version = stanc3 v2.32.2",
             "stancflags = --"};
  }
  template <bool propto__, bool jacobian__, typename VecR, typename VecI,
            stan::require_vector_like_t<VecR>* = nullptr,
            stan::require_vector_like_vt<std::is_integral, VecI>* = nullptr>
  inline stan::scalar_type_t<VecR>
  log_prob_impl(VecR& params_r__, VecI& params_i__, std::ostream*
                pstream__ = nullptr) const {
    using T__ = stan::scalar_type_t<VecR>;
    using local_scalar_t__ = T__;
    T__ lp__(0.0);
    stan::math::accumulator<T__> lp_accum__;
    stan::io::deserializer<local_scalar_t__> in__(params_r__, params_i__);
    int current_statement__ = 0;
    local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
    // suppress unused var warning
    (void) DUMMY_VAR__;
    static constexpr const char* function__ =
      "model81214d872721__namespace::log_prob";
    // suppress unused var warning
    (void) function__;
    try {
      local_scalar_t__ inferred_grand_treatment_mean = DUMMY_VAR__;
      current_statement__ = 1;
      inferred_grand_treatment_mean = in__.template read<local_scalar_t__>();
      local_scalar_t__ inferred_grand_control_mean = DUMMY_VAR__;
      current_statement__ = 2;
      inferred_grand_control_mean = in__.template read<local_scalar_t__>();
      local_scalar_t__ inferred_between_group_stddev = DUMMY_VAR__;
      current_statement__ = 3;
      inferred_between_group_stddev = in__.template read_constrain_lb<
                                        local_scalar_t__, jacobian__>(0,
                                        lp__);
      Eigen::Matrix<local_scalar_t__,-1,1> inferred_group_treatment_mean =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(n_studies,
          DUMMY_VAR__);
      current_statement__ = 4;
      inferred_group_treatment_mean = in__.template read<
                                        Eigen::Matrix<local_scalar_t__,-1,1>>(n_studies);
      Eigen::Matrix<local_scalar_t__,-1,1> inferred_group_control_mean =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(n_studies,
          DUMMY_VAR__);
      current_statement__ = 5;
      inferred_group_control_mean = in__.template read<
                                      Eigen::Matrix<local_scalar_t__,-1,1>>(n_studies);
      Eigen::Matrix<local_scalar_t__,-1,1> inferred_in_group_stddev =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(n_studies,
          DUMMY_VAR__);
      current_statement__ = 6;
      inferred_in_group_stddev = in__.template read_constrain_lb<
                                   Eigen::Matrix<local_scalar_t__,-1,1>,
                                   jacobian__>(0, lp__, n_studies);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_1_1dim__,
          DUMMY_VAR__);
      current_statement__ = 7;
      treatment_subject_1 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_1_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_1_1dim__,
          DUMMY_VAR__);
      current_statement__ = 8;
      control_subject_1 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_1_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_2_1dim__,
          DUMMY_VAR__);
      current_statement__ = 9;
      treatment_subject_2 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_2_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_2_1dim__,
          DUMMY_VAR__);
      current_statement__ = 10;
      control_subject_2 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_2_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_3_1dim__,
          DUMMY_VAR__);
      current_statement__ = 11;
      treatment_subject_3 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_3_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_3_1dim__,
          DUMMY_VAR__);
      current_statement__ = 12;
      control_subject_3 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_3_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_4 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_4_1dim__,
          DUMMY_VAR__);
      current_statement__ = 13;
      treatment_subject_4 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_4_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_4 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_4_1dim__,
          DUMMY_VAR__);
      current_statement__ = 14;
      control_subject_4 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_4_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_5 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_5_1dim__,
          DUMMY_VAR__);
      current_statement__ = 15;
      treatment_subject_5 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_5_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_5 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_5_1dim__,
          DUMMY_VAR__);
      current_statement__ = 16;
      control_subject_5 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_5_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_6 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_6_1dim__,
          DUMMY_VAR__);
      current_statement__ = 17;
      treatment_subject_6 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_6_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_6 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_6_1dim__,
          DUMMY_VAR__);
      current_statement__ = 18;
      control_subject_6 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_6_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_7 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_7_1dim__,
          DUMMY_VAR__);
      current_statement__ = 19;
      treatment_subject_7 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_7_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_7 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_7_1dim__,
          DUMMY_VAR__);
      current_statement__ = 20;
      control_subject_7 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_7_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_8 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_8_1dim__,
          DUMMY_VAR__);
      current_statement__ = 21;
      treatment_subject_8 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_8_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_8 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_8_1dim__,
          DUMMY_VAR__);
      current_statement__ = 22;
      control_subject_8 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_8_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> sampled_meanE =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(n_studies,
          DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> sampled_varE =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(n_studies,
          DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> sampled_meanC =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(n_studies,
          DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> sampled_varC =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(n_studies,
          DUMMY_VAR__);
      current_statement__ = 27;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_1),
        "assigning variable sampled_meanE", stan::model::index_uni(1));
      current_statement__ = 28;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_1),
        "assigning variable sampled_varE", stan::model::index_uni(1));
      current_statement__ = 29;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_1),
        "assigning variable sampled_meanC", stan::model::index_uni(1));
      current_statement__ = 30;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_1),
        "assigning variable sampled_varC", stan::model::index_uni(1));
      current_statement__ = 31;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_2),
        "assigning variable sampled_meanE", stan::model::index_uni(2));
      current_statement__ = 32;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_2),
        "assigning variable sampled_varE", stan::model::index_uni(2));
      current_statement__ = 33;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_2),
        "assigning variable sampled_meanC", stan::model::index_uni(2));
      current_statement__ = 34;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_2),
        "assigning variable sampled_varC", stan::model::index_uni(2));
      current_statement__ = 35;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_3),
        "assigning variable sampled_meanE", stan::model::index_uni(3));
      current_statement__ = 36;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_3),
        "assigning variable sampled_varE", stan::model::index_uni(3));
      current_statement__ = 37;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_3),
        "assigning variable sampled_meanC", stan::model::index_uni(3));
      current_statement__ = 38;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_3),
        "assigning variable sampled_varC", stan::model::index_uni(3));
      current_statement__ = 39;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_4),
        "assigning variable sampled_meanE", stan::model::index_uni(4));
      current_statement__ = 40;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_4),
        "assigning variable sampled_varE", stan::model::index_uni(4));
      current_statement__ = 41;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_4),
        "assigning variable sampled_meanC", stan::model::index_uni(4));
      current_statement__ = 42;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_4),
        "assigning variable sampled_varC", stan::model::index_uni(4));
      current_statement__ = 43;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_5),
        "assigning variable sampled_meanE", stan::model::index_uni(5));
      current_statement__ = 44;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_5),
        "assigning variable sampled_varE", stan::model::index_uni(5));
      current_statement__ = 45;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_5),
        "assigning variable sampled_meanC", stan::model::index_uni(5));
      current_statement__ = 46;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_5),
        "assigning variable sampled_varC", stan::model::index_uni(5));
      current_statement__ = 47;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_6),
        "assigning variable sampled_meanE", stan::model::index_uni(6));
      current_statement__ = 48;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_6),
        "assigning variable sampled_varE", stan::model::index_uni(6));
      current_statement__ = 49;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_6),
        "assigning variable sampled_meanC", stan::model::index_uni(6));
      current_statement__ = 50;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_6),
        "assigning variable sampled_varC", stan::model::index_uni(6));
      current_statement__ = 51;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_7),
        "assigning variable sampled_meanE", stan::model::index_uni(7));
      current_statement__ = 52;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_7),
        "assigning variable sampled_varE", stan::model::index_uni(7));
      current_statement__ = 53;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_7),
        "assigning variable sampled_meanC", stan::model::index_uni(7));
      current_statement__ = 54;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_7),
        "assigning variable sampled_varC", stan::model::index_uni(7));
      current_statement__ = 55;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_8),
        "assigning variable sampled_meanE", stan::model::index_uni(8));
      current_statement__ = 56;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_8),
        "assigning variable sampled_varE", stan::model::index_uni(8));
      current_statement__ = 57;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_8),
        "assigning variable sampled_meanC", stan::model::index_uni(8));
      current_statement__ = 58;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_8),
        "assigning variable sampled_varC", stan::model::index_uni(8));
      current_statement__ = 24;
      stan::math::check_greater_or_equal(function__, "sampled_varE",
        sampled_varE, 0);
      current_statement__ = 26;
      stan::math::check_greater_or_equal(function__, "sampled_varC",
        sampled_varC, 0);
      {
        current_statement__ = 59;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         inferred_grand_treatment_mean, 0, 1));
        current_statement__ = 60;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         inferred_grand_control_mean, 0, 1));
        current_statement__ = 61;
        lp_accum__.add(stan::math::lognormal_lpdf<propto__>(
                         inferred_between_group_stddev, 0, 1));
        current_statement__ = 62;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         inferred_group_treatment_mean, 0, 1));
        current_statement__ = 63;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         inferred_group_control_mean, 0, 1));
        current_statement__ = 64;
        lp_accum__.add(stan::math::lognormal_lpdf<propto__>(
                         inferred_in_group_stddev, 0, 1));
        current_statement__ = 65;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(1)),
                         inferred_grand_treatment_mean,
                         inferred_between_group_stddev));
        current_statement__ = 66;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(treatment_subject_1,
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(1)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(1))));
        current_statement__ = 67;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanE, "sampled_meanE",
                           stan::model::index_uni(1)),
                         stan::model::rvalue(meanE, "meanE",
                           stan::model::index_uni(1)), 0.01));
        current_statement__ = 68;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varE, "sampled_varE",
                           stan::model::index_uni(1)),
                         stan::model::rvalue(varE, "varE",
                           stan::model::index_uni(1)), 0.01));
        current_statement__ = 69;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(1)),
                         inferred_grand_control_mean,
                         inferred_between_group_stddev));
        current_statement__ = 70;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(control_subject_1,
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(1)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(1))));
        current_statement__ = 71;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanC, "sampled_meanC",
                           stan::model::index_uni(1)),
                         stan::model::rvalue(meanC, "meanC",
                           stan::model::index_uni(1)), 0.01));
        current_statement__ = 72;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varC, "sampled_varC",
                           stan::model::index_uni(1)),
                         stan::model::rvalue(varC, "varC",
                           stan::model::index_uni(1)), 0.01));
        current_statement__ = 73;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(2)),
                         inferred_grand_treatment_mean,
                         inferred_between_group_stddev));
        current_statement__ = 74;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(treatment_subject_2,
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(2)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(2))));
        current_statement__ = 75;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanE, "sampled_meanE",
                           stan::model::index_uni(2)),
                         stan::model::rvalue(meanE, "meanE",
                           stan::model::index_uni(2)), 0.01));
        current_statement__ = 76;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varE, "sampled_varE",
                           stan::model::index_uni(2)),
                         stan::model::rvalue(varE, "varE",
                           stan::model::index_uni(2)), 0.01));
        current_statement__ = 77;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(2)),
                         inferred_grand_control_mean,
                         inferred_between_group_stddev));
        current_statement__ = 78;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(control_subject_2,
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(2)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(2))));
        current_statement__ = 79;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanC, "sampled_meanC",
                           stan::model::index_uni(2)),
                         stan::model::rvalue(meanC, "meanC",
                           stan::model::index_uni(2)), 0.01));
        current_statement__ = 80;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varC, "sampled_varC",
                           stan::model::index_uni(2)),
                         stan::model::rvalue(varC, "varC",
                           stan::model::index_uni(2)), 0.01));
        current_statement__ = 81;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(3)),
                         inferred_grand_treatment_mean,
                         inferred_between_group_stddev));
        current_statement__ = 82;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(treatment_subject_3,
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(3)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(3))));
        current_statement__ = 83;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanE, "sampled_meanE",
                           stan::model::index_uni(3)),
                         stan::model::rvalue(meanE, "meanE",
                           stan::model::index_uni(3)), 0.01));
        current_statement__ = 84;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varE, "sampled_varE",
                           stan::model::index_uni(3)),
                         stan::model::rvalue(varE, "varE",
                           stan::model::index_uni(3)), 0.01));
        current_statement__ = 85;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(3)),
                         inferred_grand_control_mean,
                         inferred_between_group_stddev));
        current_statement__ = 86;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(control_subject_3,
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(3)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(3))));
        current_statement__ = 87;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanC, "sampled_meanC",
                           stan::model::index_uni(3)),
                         stan::model::rvalue(meanC, "meanC",
                           stan::model::index_uni(3)), 0.01));
        current_statement__ = 88;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varC, "sampled_varC",
                           stan::model::index_uni(3)),
                         stan::model::rvalue(varC, "varC",
                           stan::model::index_uni(3)), 0.01));
        current_statement__ = 89;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(4)),
                         inferred_grand_treatment_mean,
                         inferred_between_group_stddev));
        current_statement__ = 90;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(treatment_subject_4,
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(4)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(4))));
        current_statement__ = 91;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanE, "sampled_meanE",
                           stan::model::index_uni(4)),
                         stan::model::rvalue(meanE, "meanE",
                           stan::model::index_uni(4)), 0.01));
        current_statement__ = 92;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varE, "sampled_varE",
                           stan::model::index_uni(4)),
                         stan::model::rvalue(varE, "varE",
                           stan::model::index_uni(4)), 0.01));
        current_statement__ = 93;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(4)),
                         inferred_grand_control_mean,
                         inferred_between_group_stddev));
        current_statement__ = 94;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(control_subject_4,
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(4)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(4))));
        current_statement__ = 95;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanC, "sampled_meanC",
                           stan::model::index_uni(4)),
                         stan::model::rvalue(meanC, "meanC",
                           stan::model::index_uni(4)), 0.01));
        current_statement__ = 96;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varC, "sampled_varC",
                           stan::model::index_uni(4)),
                         stan::model::rvalue(varC, "varC",
                           stan::model::index_uni(4)), 0.01));
        current_statement__ = 97;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(5)),
                         inferred_grand_treatment_mean,
                         inferred_between_group_stddev));
        current_statement__ = 98;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(treatment_subject_5,
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(5)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(5))));
        current_statement__ = 99;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanE, "sampled_meanE",
                           stan::model::index_uni(5)),
                         stan::model::rvalue(meanE, "meanE",
                           stan::model::index_uni(5)), 0.01));
        current_statement__ = 100;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varE, "sampled_varE",
                           stan::model::index_uni(5)),
                         stan::model::rvalue(varE, "varE",
                           stan::model::index_uni(5)), 0.01));
        current_statement__ = 101;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(5)),
                         inferred_grand_control_mean,
                         inferred_between_group_stddev));
        current_statement__ = 102;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(control_subject_5,
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(5)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(5))));
        current_statement__ = 103;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanC, "sampled_meanC",
                           stan::model::index_uni(5)),
                         stan::model::rvalue(meanC, "meanC",
                           stan::model::index_uni(5)), 0.01));
        current_statement__ = 104;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varC, "sampled_varC",
                           stan::model::index_uni(5)),
                         stan::model::rvalue(varC, "varC",
                           stan::model::index_uni(5)), 0.01));
        current_statement__ = 105;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(6)),
                         inferred_grand_treatment_mean,
                         inferred_between_group_stddev));
        current_statement__ = 106;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(treatment_subject_6,
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(6)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(6))));
        current_statement__ = 107;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanE, "sampled_meanE",
                           stan::model::index_uni(6)),
                         stan::model::rvalue(meanE, "meanE",
                           stan::model::index_uni(6)), 0.01));
        current_statement__ = 108;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varE, "sampled_varE",
                           stan::model::index_uni(6)),
                         stan::model::rvalue(varE, "varE",
                           stan::model::index_uni(6)), 0.01));
        current_statement__ = 109;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(6)),
                         inferred_grand_control_mean,
                         inferred_between_group_stddev));
        current_statement__ = 110;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(control_subject_6,
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(6)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(6))));
        current_statement__ = 111;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanC, "sampled_meanC",
                           stan::model::index_uni(6)),
                         stan::model::rvalue(meanC, "meanC",
                           stan::model::index_uni(6)), 0.01));
        current_statement__ = 112;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varC, "sampled_varC",
                           stan::model::index_uni(6)),
                         stan::model::rvalue(varC, "varC",
                           stan::model::index_uni(6)), 0.01));
        current_statement__ = 113;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(7)),
                         inferred_grand_treatment_mean,
                         inferred_between_group_stddev));
        current_statement__ = 114;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(treatment_subject_7,
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(7)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(7))));
        current_statement__ = 115;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanE, "sampled_meanE",
                           stan::model::index_uni(7)),
                         stan::model::rvalue(meanE, "meanE",
                           stan::model::index_uni(7)), 0.01));
        current_statement__ = 116;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varE, "sampled_varE",
                           stan::model::index_uni(7)),
                         stan::model::rvalue(varE, "varE",
                           stan::model::index_uni(7)), 0.01));
        current_statement__ = 117;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(7)),
                         inferred_grand_control_mean,
                         inferred_between_group_stddev));
        current_statement__ = 118;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(control_subject_7,
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(7)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(7))));
        current_statement__ = 119;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanC, "sampled_meanC",
                           stan::model::index_uni(7)),
                         stan::model::rvalue(meanC, "meanC",
                           stan::model::index_uni(7)), 0.01));
        current_statement__ = 120;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varC, "sampled_varC",
                           stan::model::index_uni(7)),
                         stan::model::rvalue(varC, "varC",
                           stan::model::index_uni(7)), 0.01));
        current_statement__ = 121;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(8)),
                         inferred_grand_treatment_mean,
                         inferred_between_group_stddev));
        current_statement__ = 122;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(treatment_subject_8,
                         stan::model::rvalue(inferred_group_treatment_mean,
                           "inferred_group_treatment_mean",
                           stan::model::index_uni(8)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(8))));
        current_statement__ = 123;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanE, "sampled_meanE",
                           stan::model::index_uni(8)),
                         stan::model::rvalue(meanE, "meanE",
                           stan::model::index_uni(8)), 0.01));
        current_statement__ = 124;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varE, "sampled_varE",
                           stan::model::index_uni(8)),
                         stan::model::rvalue(varE, "varE",
                           stan::model::index_uni(8)), 0.01));
        current_statement__ = 125;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(8)),
                         inferred_grand_control_mean,
                         inferred_between_group_stddev));
        current_statement__ = 126;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(control_subject_8,
                         stan::model::rvalue(inferred_group_control_mean,
                           "inferred_group_control_mean",
                           stan::model::index_uni(8)),
                         stan::model::rvalue(inferred_in_group_stddev,
                           "inferred_in_group_stddev",
                           stan::model::index_uni(8))));
        current_statement__ = 127;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_meanC, "sampled_meanC",
                           stan::model::index_uni(8)),
                         stan::model::rvalue(meanC, "meanC",
                           stan::model::index_uni(8)), 0.01));
        current_statement__ = 128;
        lp_accum__.add(stan::math::normal_lpdf<propto__>(
                         stan::model::rvalue(sampled_varC, "sampled_varC",
                           stan::model::index_uni(8)),
                         stan::model::rvalue(varC, "varC",
                           stan::model::index_uni(8)), 0.01));
      }
    } catch (const std::exception& e) {
      stan::lang::rethrow_located(e, locations_array__[current_statement__]);
    }
    lp_accum__.add(lp__);
    return lp_accum__.sum();
  }
  template <typename RNG, typename VecR, typename VecI, typename VecVar,
            stan::require_vector_like_vt<std::is_floating_point,
            VecR>* = nullptr, stan::require_vector_like_vt<std::is_integral,
            VecI>* = nullptr, stan::require_vector_vt<std::is_floating_point,
            VecVar>* = nullptr>
  inline void
  write_array_impl(RNG& base_rng__, VecR& params_r__, VecI& params_i__,
                   VecVar& vars__, const bool
                   emit_transformed_parameters__ = true, const bool
                   emit_generated_quantities__ = true, std::ostream*
                   pstream__ = nullptr) const {
    using local_scalar_t__ = double;
    stan::io::deserializer<local_scalar_t__> in__(params_r__, params_i__);
    stan::io::serializer<local_scalar_t__> out__(vars__);
    static constexpr bool propto__ = true;
    // suppress unused var warning
    (void) propto__;
    double lp__ = 0.0;
    // suppress unused var warning
    (void) lp__;
    int current_statement__ = 0;
    stan::math::accumulator<double> lp_accum__;
    local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
    // suppress unused var warning
    (void) DUMMY_VAR__;
    constexpr bool jacobian__ = false;
    static constexpr const char* function__ =
      "model81214d872721__namespace::write_array";
    // suppress unused var warning
    (void) function__;
    try {
      double inferred_grand_treatment_mean =
        std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 1;
      inferred_grand_treatment_mean = in__.template read<local_scalar_t__>();
      double inferred_grand_control_mean =
        std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 2;
      inferred_grand_control_mean = in__.template read<local_scalar_t__>();
      double inferred_between_group_stddev =
        std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 3;
      inferred_between_group_stddev = in__.template read_constrain_lb<
                                        local_scalar_t__, jacobian__>(0,
                                        lp__);
      Eigen::Matrix<double,-1,1> inferred_group_treatment_mean =
        Eigen::Matrix<double,-1,1>::Constant(n_studies,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 4;
      inferred_group_treatment_mean = in__.template read<
                                        Eigen::Matrix<local_scalar_t__,-1,1>>(n_studies);
      Eigen::Matrix<double,-1,1> inferred_group_control_mean =
        Eigen::Matrix<double,-1,1>::Constant(n_studies,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 5;
      inferred_group_control_mean = in__.template read<
                                      Eigen::Matrix<local_scalar_t__,-1,1>>(n_studies);
      Eigen::Matrix<double,-1,1> inferred_in_group_stddev =
        Eigen::Matrix<double,-1,1>::Constant(n_studies,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 6;
      inferred_in_group_stddev = in__.template read_constrain_lb<
                                   Eigen::Matrix<local_scalar_t__,-1,1>,
                                   jacobian__>(0, lp__, n_studies);
      Eigen::Matrix<double,-1,1> treatment_subject_1 =
        Eigen::Matrix<double,-1,1>::Constant(treatment_subject_1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 7;
      treatment_subject_1 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_1_1dim__);
      Eigen::Matrix<double,-1,1> control_subject_1 =
        Eigen::Matrix<double,-1,1>::Constant(control_subject_1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 8;
      control_subject_1 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_1_1dim__);
      Eigen::Matrix<double,-1,1> treatment_subject_2 =
        Eigen::Matrix<double,-1,1>::Constant(treatment_subject_2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 9;
      treatment_subject_2 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_2_1dim__);
      Eigen::Matrix<double,-1,1> control_subject_2 =
        Eigen::Matrix<double,-1,1>::Constant(control_subject_2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 10;
      control_subject_2 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_2_1dim__);
      Eigen::Matrix<double,-1,1> treatment_subject_3 =
        Eigen::Matrix<double,-1,1>::Constant(treatment_subject_3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 11;
      treatment_subject_3 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_3_1dim__);
      Eigen::Matrix<double,-1,1> control_subject_3 =
        Eigen::Matrix<double,-1,1>::Constant(control_subject_3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 12;
      control_subject_3 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_3_1dim__);
      Eigen::Matrix<double,-1,1> treatment_subject_4 =
        Eigen::Matrix<double,-1,1>::Constant(treatment_subject_4_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 13;
      treatment_subject_4 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_4_1dim__);
      Eigen::Matrix<double,-1,1> control_subject_4 =
        Eigen::Matrix<double,-1,1>::Constant(control_subject_4_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 14;
      control_subject_4 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_4_1dim__);
      Eigen::Matrix<double,-1,1> treatment_subject_5 =
        Eigen::Matrix<double,-1,1>::Constant(treatment_subject_5_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 15;
      treatment_subject_5 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_5_1dim__);
      Eigen::Matrix<double,-1,1> control_subject_5 =
        Eigen::Matrix<double,-1,1>::Constant(control_subject_5_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 16;
      control_subject_5 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_5_1dim__);
      Eigen::Matrix<double,-1,1> treatment_subject_6 =
        Eigen::Matrix<double,-1,1>::Constant(treatment_subject_6_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 17;
      treatment_subject_6 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_6_1dim__);
      Eigen::Matrix<double,-1,1> control_subject_6 =
        Eigen::Matrix<double,-1,1>::Constant(control_subject_6_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 18;
      control_subject_6 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_6_1dim__);
      Eigen::Matrix<double,-1,1> treatment_subject_7 =
        Eigen::Matrix<double,-1,1>::Constant(treatment_subject_7_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 19;
      treatment_subject_7 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_7_1dim__);
      Eigen::Matrix<double,-1,1> control_subject_7 =
        Eigen::Matrix<double,-1,1>::Constant(control_subject_7_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 20;
      control_subject_7 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_7_1dim__);
      Eigen::Matrix<double,-1,1> treatment_subject_8 =
        Eigen::Matrix<double,-1,1>::Constant(treatment_subject_8_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 21;
      treatment_subject_8 = in__.template read<
                              Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_8_1dim__);
      Eigen::Matrix<double,-1,1> control_subject_8 =
        Eigen::Matrix<double,-1,1>::Constant(control_subject_8_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 22;
      control_subject_8 = in__.template read<
                            Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_8_1dim__);
      Eigen::Matrix<double,-1,1> sampled_meanE =
        Eigen::Matrix<double,-1,1>::Constant(n_studies,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> sampled_varE =
        Eigen::Matrix<double,-1,1>::Constant(n_studies,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> sampled_meanC =
        Eigen::Matrix<double,-1,1>::Constant(n_studies,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> sampled_varC =
        Eigen::Matrix<double,-1,1>::Constant(n_studies,
          std::numeric_limits<double>::quiet_NaN());
      out__.write(inferred_grand_treatment_mean);
      out__.write(inferred_grand_control_mean);
      out__.write(inferred_between_group_stddev);
      out__.write(inferred_group_treatment_mean);
      out__.write(inferred_group_control_mean);
      out__.write(inferred_in_group_stddev);
      out__.write(treatment_subject_1);
      out__.write(control_subject_1);
      out__.write(treatment_subject_2);
      out__.write(control_subject_2);
      out__.write(treatment_subject_3);
      out__.write(control_subject_3);
      out__.write(treatment_subject_4);
      out__.write(control_subject_4);
      out__.write(treatment_subject_5);
      out__.write(control_subject_5);
      out__.write(treatment_subject_6);
      out__.write(control_subject_6);
      out__.write(treatment_subject_7);
      out__.write(control_subject_7);
      out__.write(treatment_subject_8);
      out__.write(control_subject_8);
      if (stan::math::logical_negation(
            (stan::math::primitive_value(emit_transformed_parameters__) ||
            stan::math::primitive_value(emit_generated_quantities__)))) {
        return ;
      }
      current_statement__ = 27;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_1),
        "assigning variable sampled_meanE", stan::model::index_uni(1));
      current_statement__ = 28;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_1),
        "assigning variable sampled_varE", stan::model::index_uni(1));
      current_statement__ = 29;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_1),
        "assigning variable sampled_meanC", stan::model::index_uni(1));
      current_statement__ = 30;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_1),
        "assigning variable sampled_varC", stan::model::index_uni(1));
      current_statement__ = 31;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_2),
        "assigning variable sampled_meanE", stan::model::index_uni(2));
      current_statement__ = 32;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_2),
        "assigning variable sampled_varE", stan::model::index_uni(2));
      current_statement__ = 33;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_2),
        "assigning variable sampled_meanC", stan::model::index_uni(2));
      current_statement__ = 34;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_2),
        "assigning variable sampled_varC", stan::model::index_uni(2));
      current_statement__ = 35;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_3),
        "assigning variable sampled_meanE", stan::model::index_uni(3));
      current_statement__ = 36;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_3),
        "assigning variable sampled_varE", stan::model::index_uni(3));
      current_statement__ = 37;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_3),
        "assigning variable sampled_meanC", stan::model::index_uni(3));
      current_statement__ = 38;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_3),
        "assigning variable sampled_varC", stan::model::index_uni(3));
      current_statement__ = 39;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_4),
        "assigning variable sampled_meanE", stan::model::index_uni(4));
      current_statement__ = 40;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_4),
        "assigning variable sampled_varE", stan::model::index_uni(4));
      current_statement__ = 41;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_4),
        "assigning variable sampled_meanC", stan::model::index_uni(4));
      current_statement__ = 42;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_4),
        "assigning variable sampled_varC", stan::model::index_uni(4));
      current_statement__ = 43;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_5),
        "assigning variable sampled_meanE", stan::model::index_uni(5));
      current_statement__ = 44;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_5),
        "assigning variable sampled_varE", stan::model::index_uni(5));
      current_statement__ = 45;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_5),
        "assigning variable sampled_meanC", stan::model::index_uni(5));
      current_statement__ = 46;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_5),
        "assigning variable sampled_varC", stan::model::index_uni(5));
      current_statement__ = 47;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_6),
        "assigning variable sampled_meanE", stan::model::index_uni(6));
      current_statement__ = 48;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_6),
        "assigning variable sampled_varE", stan::model::index_uni(6));
      current_statement__ = 49;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_6),
        "assigning variable sampled_meanC", stan::model::index_uni(6));
      current_statement__ = 50;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_6),
        "assigning variable sampled_varC", stan::model::index_uni(6));
      current_statement__ = 51;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_7),
        "assigning variable sampled_meanE", stan::model::index_uni(7));
      current_statement__ = 52;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_7),
        "assigning variable sampled_varE", stan::model::index_uni(7));
      current_statement__ = 53;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_7),
        "assigning variable sampled_meanC", stan::model::index_uni(7));
      current_statement__ = 54;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_7),
        "assigning variable sampled_varC", stan::model::index_uni(7));
      current_statement__ = 55;
      stan::model::assign(sampled_meanE,
        stan::math::mean(treatment_subject_8),
        "assigning variable sampled_meanE", stan::model::index_uni(8));
      current_statement__ = 56;
      stan::model::assign(sampled_varE,
        stan::math::variance(treatment_subject_8),
        "assigning variable sampled_varE", stan::model::index_uni(8));
      current_statement__ = 57;
      stan::model::assign(sampled_meanC, stan::math::mean(control_subject_8),
        "assigning variable sampled_meanC", stan::model::index_uni(8));
      current_statement__ = 58;
      stan::model::assign(sampled_varC,
        stan::math::variance(control_subject_8),
        "assigning variable sampled_varC", stan::model::index_uni(8));
      current_statement__ = 24;
      stan::math::check_greater_or_equal(function__, "sampled_varE",
        sampled_varE, 0);
      current_statement__ = 26;
      stan::math::check_greater_or_equal(function__, "sampled_varC",
        sampled_varC, 0);
      if (emit_transformed_parameters__) {
        out__.write(sampled_meanE);
        out__.write(sampled_varE);
        out__.write(sampled_meanC);
        out__.write(sampled_varC);
      }
      if (stan::math::logical_negation(emit_generated_quantities__)) {
        return ;
      }
    } catch (const std::exception& e) {
      stan::lang::rethrow_located(e, locations_array__[current_statement__]);
    }
  }
  template <typename VecVar, typename VecI,
            stan::require_vector_t<VecVar>* = nullptr,
            stan::require_vector_like_vt<std::is_integral, VecI>* = nullptr>
  inline void
  unconstrain_array_impl(const VecVar& params_r__, const VecI& params_i__,
                         VecVar& vars__, std::ostream* pstream__ = nullptr) const {
    using local_scalar_t__ = double;
    stan::io::deserializer<local_scalar_t__> in__(params_r__, params_i__);
    stan::io::serializer<local_scalar_t__> out__(vars__);
    int current_statement__ = 0;
    local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
    // suppress unused var warning
    (void) DUMMY_VAR__;
    try {
      int pos__ = std::numeric_limits<int>::min();
      pos__ = 1;
      local_scalar_t__ inferred_grand_treatment_mean = DUMMY_VAR__;
      current_statement__ = 1;
      inferred_grand_treatment_mean = in__.read<local_scalar_t__>();
      out__.write(inferred_grand_treatment_mean);
      local_scalar_t__ inferred_grand_control_mean = DUMMY_VAR__;
      current_statement__ = 2;
      inferred_grand_control_mean = in__.read<local_scalar_t__>();
      out__.write(inferred_grand_control_mean);
      local_scalar_t__ inferred_between_group_stddev = DUMMY_VAR__;
      current_statement__ = 3;
      inferred_between_group_stddev = in__.read<local_scalar_t__>();
      out__.write_free_lb(0, inferred_between_group_stddev);
      Eigen::Matrix<local_scalar_t__,-1,1> inferred_group_treatment_mean =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(n_studies,
          DUMMY_VAR__);
      current_statement__ = 4;
      stan::model::assign(inferred_group_treatment_mean,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(n_studies),
        "assigning variable inferred_group_treatment_mean");
      out__.write(inferred_group_treatment_mean);
      Eigen::Matrix<local_scalar_t__,-1,1> inferred_group_control_mean =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(n_studies,
          DUMMY_VAR__);
      current_statement__ = 5;
      stan::model::assign(inferred_group_control_mean,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(n_studies),
        "assigning variable inferred_group_control_mean");
      out__.write(inferred_group_control_mean);
      Eigen::Matrix<local_scalar_t__,-1,1> inferred_in_group_stddev =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(n_studies,
          DUMMY_VAR__);
      current_statement__ = 6;
      stan::model::assign(inferred_in_group_stddev,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(n_studies),
        "assigning variable inferred_in_group_stddev");
      out__.write_free_lb(0, inferred_in_group_stddev);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_1_1dim__,
          DUMMY_VAR__);
      current_statement__ = 7;
      stan::model::assign(treatment_subject_1,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_1_1dim__),
        "assigning variable treatment_subject_1");
      out__.write(treatment_subject_1);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_1_1dim__,
          DUMMY_VAR__);
      current_statement__ = 8;
      stan::model::assign(control_subject_1,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_1_1dim__),
        "assigning variable control_subject_1");
      out__.write(control_subject_1);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_2_1dim__,
          DUMMY_VAR__);
      current_statement__ = 9;
      stan::model::assign(treatment_subject_2,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_2_1dim__),
        "assigning variable treatment_subject_2");
      out__.write(treatment_subject_2);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_2_1dim__,
          DUMMY_VAR__);
      current_statement__ = 10;
      stan::model::assign(control_subject_2,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_2_1dim__),
        "assigning variable control_subject_2");
      out__.write(control_subject_2);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_3_1dim__,
          DUMMY_VAR__);
      current_statement__ = 11;
      stan::model::assign(treatment_subject_3,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_3_1dim__),
        "assigning variable treatment_subject_3");
      out__.write(treatment_subject_3);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_3_1dim__,
          DUMMY_VAR__);
      current_statement__ = 12;
      stan::model::assign(control_subject_3,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_3_1dim__),
        "assigning variable control_subject_3");
      out__.write(control_subject_3);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_4 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_4_1dim__,
          DUMMY_VAR__);
      current_statement__ = 13;
      stan::model::assign(treatment_subject_4,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_4_1dim__),
        "assigning variable treatment_subject_4");
      out__.write(treatment_subject_4);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_4 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_4_1dim__,
          DUMMY_VAR__);
      current_statement__ = 14;
      stan::model::assign(control_subject_4,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_4_1dim__),
        "assigning variable control_subject_4");
      out__.write(control_subject_4);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_5 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_5_1dim__,
          DUMMY_VAR__);
      current_statement__ = 15;
      stan::model::assign(treatment_subject_5,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_5_1dim__),
        "assigning variable treatment_subject_5");
      out__.write(treatment_subject_5);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_5 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_5_1dim__,
          DUMMY_VAR__);
      current_statement__ = 16;
      stan::model::assign(control_subject_5,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_5_1dim__),
        "assigning variable control_subject_5");
      out__.write(control_subject_5);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_6 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_6_1dim__,
          DUMMY_VAR__);
      current_statement__ = 17;
      stan::model::assign(treatment_subject_6,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_6_1dim__),
        "assigning variable treatment_subject_6");
      out__.write(treatment_subject_6);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_6 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_6_1dim__,
          DUMMY_VAR__);
      current_statement__ = 18;
      stan::model::assign(control_subject_6,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_6_1dim__),
        "assigning variable control_subject_6");
      out__.write(control_subject_6);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_7 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_7_1dim__,
          DUMMY_VAR__);
      current_statement__ = 19;
      stan::model::assign(treatment_subject_7,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_7_1dim__),
        "assigning variable treatment_subject_7");
      out__.write(treatment_subject_7);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_7 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_7_1dim__,
          DUMMY_VAR__);
      current_statement__ = 20;
      stan::model::assign(control_subject_7,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_7_1dim__),
        "assigning variable control_subject_7");
      out__.write(control_subject_7);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_8 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_8_1dim__,
          DUMMY_VAR__);
      current_statement__ = 21;
      stan::model::assign(treatment_subject_8,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(treatment_subject_8_1dim__),
        "assigning variable treatment_subject_8");
      out__.write(treatment_subject_8);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_8 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_8_1dim__,
          DUMMY_VAR__);
      current_statement__ = 22;
      stan::model::assign(control_subject_8,
        in__.read<
          Eigen::Matrix<local_scalar_t__,-1,1>>(control_subject_8_1dim__),
        "assigning variable control_subject_8");
      out__.write(control_subject_8);
    } catch (const std::exception& e) {
      stan::lang::rethrow_located(e, locations_array__[current_statement__]);
    }
  }
  template <typename VecVar, stan::require_vector_t<VecVar>* = nullptr>
  inline void
  transform_inits_impl(const stan::io::var_context& context__, VecVar&
                       vars__, std::ostream* pstream__ = nullptr) const {
    using local_scalar_t__ = double;
    stan::io::serializer<local_scalar_t__> out__(vars__);
    int current_statement__ = 0;
    local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
    // suppress unused var warning
    (void) DUMMY_VAR__;
    try {
      current_statement__ = 1;
      context__.validate_dims("parameter initialization",
        "inferred_grand_treatment_mean", "double", std::vector<size_t>{});
      current_statement__ = 2;
      context__.validate_dims("parameter initialization",
        "inferred_grand_control_mean", "double", std::vector<size_t>{});
      current_statement__ = 3;
      context__.validate_dims("parameter initialization",
        "inferred_between_group_stddev", "double", std::vector<size_t>{});
      current_statement__ = 4;
      context__.validate_dims("parameter initialization",
        "inferred_group_treatment_mean", "double",
        std::vector<size_t>{static_cast<size_t>(n_studies)});
      current_statement__ = 5;
      context__.validate_dims("parameter initialization",
        "inferred_group_control_mean", "double",
        std::vector<size_t>{static_cast<size_t>(n_studies)});
      current_statement__ = 6;
      context__.validate_dims("parameter initialization",
        "inferred_in_group_stddev", "double",
        std::vector<size_t>{static_cast<size_t>(n_studies)});
      current_statement__ = 7;
      context__.validate_dims("parameter initialization",
        "treatment_subject_1", "double",
        std::vector<size_t>{static_cast<size_t>(treatment_subject_1_1dim__)});
      current_statement__ = 8;
      context__.validate_dims("parameter initialization",
        "control_subject_1", "double",
        std::vector<size_t>{static_cast<size_t>(control_subject_1_1dim__)});
      current_statement__ = 9;
      context__.validate_dims("parameter initialization",
        "treatment_subject_2", "double",
        std::vector<size_t>{static_cast<size_t>(treatment_subject_2_1dim__)});
      current_statement__ = 10;
      context__.validate_dims("parameter initialization",
        "control_subject_2", "double",
        std::vector<size_t>{static_cast<size_t>(control_subject_2_1dim__)});
      current_statement__ = 11;
      context__.validate_dims("parameter initialization",
        "treatment_subject_3", "double",
        std::vector<size_t>{static_cast<size_t>(treatment_subject_3_1dim__)});
      current_statement__ = 12;
      context__.validate_dims("parameter initialization",
        "control_subject_3", "double",
        std::vector<size_t>{static_cast<size_t>(control_subject_3_1dim__)});
      current_statement__ = 13;
      context__.validate_dims("parameter initialization",
        "treatment_subject_4", "double",
        std::vector<size_t>{static_cast<size_t>(treatment_subject_4_1dim__)});
      current_statement__ = 14;
      context__.validate_dims("parameter initialization",
        "control_subject_4", "double",
        std::vector<size_t>{static_cast<size_t>(control_subject_4_1dim__)});
      current_statement__ = 15;
      context__.validate_dims("parameter initialization",
        "treatment_subject_5", "double",
        std::vector<size_t>{static_cast<size_t>(treatment_subject_5_1dim__)});
      current_statement__ = 16;
      context__.validate_dims("parameter initialization",
        "control_subject_5", "double",
        std::vector<size_t>{static_cast<size_t>(control_subject_5_1dim__)});
      current_statement__ = 17;
      context__.validate_dims("parameter initialization",
        "treatment_subject_6", "double",
        std::vector<size_t>{static_cast<size_t>(treatment_subject_6_1dim__)});
      current_statement__ = 18;
      context__.validate_dims("parameter initialization",
        "control_subject_6", "double",
        std::vector<size_t>{static_cast<size_t>(control_subject_6_1dim__)});
      current_statement__ = 19;
      context__.validate_dims("parameter initialization",
        "treatment_subject_7", "double",
        std::vector<size_t>{static_cast<size_t>(treatment_subject_7_1dim__)});
      current_statement__ = 20;
      context__.validate_dims("parameter initialization",
        "control_subject_7", "double",
        std::vector<size_t>{static_cast<size_t>(control_subject_7_1dim__)});
      current_statement__ = 21;
      context__.validate_dims("parameter initialization",
        "treatment_subject_8", "double",
        std::vector<size_t>{static_cast<size_t>(treatment_subject_8_1dim__)});
      current_statement__ = 22;
      context__.validate_dims("parameter initialization",
        "control_subject_8", "double",
        std::vector<size_t>{static_cast<size_t>(control_subject_8_1dim__)});
      int pos__ = std::numeric_limits<int>::min();
      pos__ = 1;
      local_scalar_t__ inferred_grand_treatment_mean = DUMMY_VAR__;
      current_statement__ = 1;
      inferred_grand_treatment_mean = context__.vals_r("inferred_grand_treatment_mean")[(1
        - 1)];
      out__.write(inferred_grand_treatment_mean);
      local_scalar_t__ inferred_grand_control_mean = DUMMY_VAR__;
      current_statement__ = 2;
      inferred_grand_control_mean = context__.vals_r("inferred_grand_control_mean")[(1
        - 1)];
      out__.write(inferred_grand_control_mean);
      local_scalar_t__ inferred_between_group_stddev = DUMMY_VAR__;
      current_statement__ = 3;
      inferred_between_group_stddev = context__.vals_r("inferred_between_group_stddev")[(1
        - 1)];
      out__.write_free_lb(0, inferred_between_group_stddev);
      Eigen::Matrix<local_scalar_t__,-1,1> inferred_group_treatment_mean =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(n_studies,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> inferred_group_treatment_mean_flat__;
        current_statement__ = 4;
        inferred_group_treatment_mean_flat__ = context__.vals_r("inferred_group_treatment_mean");
        current_statement__ = 4;
        pos__ = 1;
        current_statement__ = 4;
        for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
          current_statement__ = 4;
          stan::model::assign(inferred_group_treatment_mean,
            inferred_group_treatment_mean_flat__[(pos__ - 1)],
            "assigning variable inferred_group_treatment_mean",
            stan::model::index_uni(sym1__));
          current_statement__ = 4;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(inferred_group_treatment_mean);
      Eigen::Matrix<local_scalar_t__,-1,1> inferred_group_control_mean =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(n_studies,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> inferred_group_control_mean_flat__;
        current_statement__ = 5;
        inferred_group_control_mean_flat__ = context__.vals_r("inferred_group_control_mean");
        current_statement__ = 5;
        pos__ = 1;
        current_statement__ = 5;
        for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
          current_statement__ = 5;
          stan::model::assign(inferred_group_control_mean,
            inferred_group_control_mean_flat__[(pos__ - 1)],
            "assigning variable inferred_group_control_mean",
            stan::model::index_uni(sym1__));
          current_statement__ = 5;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(inferred_group_control_mean);
      Eigen::Matrix<local_scalar_t__,-1,1> inferred_in_group_stddev =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(n_studies,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> inferred_in_group_stddev_flat__;
        current_statement__ = 6;
        inferred_in_group_stddev_flat__ = context__.vals_r("inferred_in_group_stddev");
        current_statement__ = 6;
        pos__ = 1;
        current_statement__ = 6;
        for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
          current_statement__ = 6;
          stan::model::assign(inferred_in_group_stddev,
            inferred_in_group_stddev_flat__[(pos__ - 1)],
            "assigning variable inferred_in_group_stddev",
            stan::model::index_uni(sym1__));
          current_statement__ = 6;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, inferred_in_group_stddev);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_1_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> treatment_subject_1_flat__;
        current_statement__ = 7;
        treatment_subject_1_flat__ = context__.vals_r("treatment_subject_1");
        current_statement__ = 7;
        pos__ = 1;
        current_statement__ = 7;
        for (int sym1__ = 1; sym1__ <= treatment_subject_1_1dim__; ++sym1__) {
          current_statement__ = 7;
          stan::model::assign(treatment_subject_1,
            treatment_subject_1_flat__[(pos__ - 1)],
            "assigning variable treatment_subject_1",
            stan::model::index_uni(sym1__));
          current_statement__ = 7;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(treatment_subject_1);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_1_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> control_subject_1_flat__;
        current_statement__ = 8;
        control_subject_1_flat__ = context__.vals_r("control_subject_1");
        current_statement__ = 8;
        pos__ = 1;
        current_statement__ = 8;
        for (int sym1__ = 1; sym1__ <= control_subject_1_1dim__; ++sym1__) {
          current_statement__ = 8;
          stan::model::assign(control_subject_1,
            control_subject_1_flat__[(pos__ - 1)],
            "assigning variable control_subject_1",
            stan::model::index_uni(sym1__));
          current_statement__ = 8;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(control_subject_1);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_2_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> treatment_subject_2_flat__;
        current_statement__ = 9;
        treatment_subject_2_flat__ = context__.vals_r("treatment_subject_2");
        current_statement__ = 9;
        pos__ = 1;
        current_statement__ = 9;
        for (int sym1__ = 1; sym1__ <= treatment_subject_2_1dim__; ++sym1__) {
          current_statement__ = 9;
          stan::model::assign(treatment_subject_2,
            treatment_subject_2_flat__[(pos__ - 1)],
            "assigning variable treatment_subject_2",
            stan::model::index_uni(sym1__));
          current_statement__ = 9;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(treatment_subject_2);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_2_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> control_subject_2_flat__;
        current_statement__ = 10;
        control_subject_2_flat__ = context__.vals_r("control_subject_2");
        current_statement__ = 10;
        pos__ = 1;
        current_statement__ = 10;
        for (int sym1__ = 1; sym1__ <= control_subject_2_1dim__; ++sym1__) {
          current_statement__ = 10;
          stan::model::assign(control_subject_2,
            control_subject_2_flat__[(pos__ - 1)],
            "assigning variable control_subject_2",
            stan::model::index_uni(sym1__));
          current_statement__ = 10;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(control_subject_2);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_3_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> treatment_subject_3_flat__;
        current_statement__ = 11;
        treatment_subject_3_flat__ = context__.vals_r("treatment_subject_3");
        current_statement__ = 11;
        pos__ = 1;
        current_statement__ = 11;
        for (int sym1__ = 1; sym1__ <= treatment_subject_3_1dim__; ++sym1__) {
          current_statement__ = 11;
          stan::model::assign(treatment_subject_3,
            treatment_subject_3_flat__[(pos__ - 1)],
            "assigning variable treatment_subject_3",
            stan::model::index_uni(sym1__));
          current_statement__ = 11;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(treatment_subject_3);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_3_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> control_subject_3_flat__;
        current_statement__ = 12;
        control_subject_3_flat__ = context__.vals_r("control_subject_3");
        current_statement__ = 12;
        pos__ = 1;
        current_statement__ = 12;
        for (int sym1__ = 1; sym1__ <= control_subject_3_1dim__; ++sym1__) {
          current_statement__ = 12;
          stan::model::assign(control_subject_3,
            control_subject_3_flat__[(pos__ - 1)],
            "assigning variable control_subject_3",
            stan::model::index_uni(sym1__));
          current_statement__ = 12;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(control_subject_3);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_4 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_4_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> treatment_subject_4_flat__;
        current_statement__ = 13;
        treatment_subject_4_flat__ = context__.vals_r("treatment_subject_4");
        current_statement__ = 13;
        pos__ = 1;
        current_statement__ = 13;
        for (int sym1__ = 1; sym1__ <= treatment_subject_4_1dim__; ++sym1__) {
          current_statement__ = 13;
          stan::model::assign(treatment_subject_4,
            treatment_subject_4_flat__[(pos__ - 1)],
            "assigning variable treatment_subject_4",
            stan::model::index_uni(sym1__));
          current_statement__ = 13;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(treatment_subject_4);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_4 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_4_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> control_subject_4_flat__;
        current_statement__ = 14;
        control_subject_4_flat__ = context__.vals_r("control_subject_4");
        current_statement__ = 14;
        pos__ = 1;
        current_statement__ = 14;
        for (int sym1__ = 1; sym1__ <= control_subject_4_1dim__; ++sym1__) {
          current_statement__ = 14;
          stan::model::assign(control_subject_4,
            control_subject_4_flat__[(pos__ - 1)],
            "assigning variable control_subject_4",
            stan::model::index_uni(sym1__));
          current_statement__ = 14;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(control_subject_4);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_5 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_5_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> treatment_subject_5_flat__;
        current_statement__ = 15;
        treatment_subject_5_flat__ = context__.vals_r("treatment_subject_5");
        current_statement__ = 15;
        pos__ = 1;
        current_statement__ = 15;
        for (int sym1__ = 1; sym1__ <= treatment_subject_5_1dim__; ++sym1__) {
          current_statement__ = 15;
          stan::model::assign(treatment_subject_5,
            treatment_subject_5_flat__[(pos__ - 1)],
            "assigning variable treatment_subject_5",
            stan::model::index_uni(sym1__));
          current_statement__ = 15;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(treatment_subject_5);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_5 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_5_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> control_subject_5_flat__;
        current_statement__ = 16;
        control_subject_5_flat__ = context__.vals_r("control_subject_5");
        current_statement__ = 16;
        pos__ = 1;
        current_statement__ = 16;
        for (int sym1__ = 1; sym1__ <= control_subject_5_1dim__; ++sym1__) {
          current_statement__ = 16;
          stan::model::assign(control_subject_5,
            control_subject_5_flat__[(pos__ - 1)],
            "assigning variable control_subject_5",
            stan::model::index_uni(sym1__));
          current_statement__ = 16;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(control_subject_5);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_6 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_6_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> treatment_subject_6_flat__;
        current_statement__ = 17;
        treatment_subject_6_flat__ = context__.vals_r("treatment_subject_6");
        current_statement__ = 17;
        pos__ = 1;
        current_statement__ = 17;
        for (int sym1__ = 1; sym1__ <= treatment_subject_6_1dim__; ++sym1__) {
          current_statement__ = 17;
          stan::model::assign(treatment_subject_6,
            treatment_subject_6_flat__[(pos__ - 1)],
            "assigning variable treatment_subject_6",
            stan::model::index_uni(sym1__));
          current_statement__ = 17;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(treatment_subject_6);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_6 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_6_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> control_subject_6_flat__;
        current_statement__ = 18;
        control_subject_6_flat__ = context__.vals_r("control_subject_6");
        current_statement__ = 18;
        pos__ = 1;
        current_statement__ = 18;
        for (int sym1__ = 1; sym1__ <= control_subject_6_1dim__; ++sym1__) {
          current_statement__ = 18;
          stan::model::assign(control_subject_6,
            control_subject_6_flat__[(pos__ - 1)],
            "assigning variable control_subject_6",
            stan::model::index_uni(sym1__));
          current_statement__ = 18;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(control_subject_6);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_7 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_7_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> treatment_subject_7_flat__;
        current_statement__ = 19;
        treatment_subject_7_flat__ = context__.vals_r("treatment_subject_7");
        current_statement__ = 19;
        pos__ = 1;
        current_statement__ = 19;
        for (int sym1__ = 1; sym1__ <= treatment_subject_7_1dim__; ++sym1__) {
          current_statement__ = 19;
          stan::model::assign(treatment_subject_7,
            treatment_subject_7_flat__[(pos__ - 1)],
            "assigning variable treatment_subject_7",
            stan::model::index_uni(sym1__));
          current_statement__ = 19;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(treatment_subject_7);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_7 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_7_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> control_subject_7_flat__;
        current_statement__ = 20;
        control_subject_7_flat__ = context__.vals_r("control_subject_7");
        current_statement__ = 20;
        pos__ = 1;
        current_statement__ = 20;
        for (int sym1__ = 1; sym1__ <= control_subject_7_1dim__; ++sym1__) {
          current_statement__ = 20;
          stan::model::assign(control_subject_7,
            control_subject_7_flat__[(pos__ - 1)],
            "assigning variable control_subject_7",
            stan::model::index_uni(sym1__));
          current_statement__ = 20;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(control_subject_7);
      Eigen::Matrix<local_scalar_t__,-1,1> treatment_subject_8 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(treatment_subject_8_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> treatment_subject_8_flat__;
        current_statement__ = 21;
        treatment_subject_8_flat__ = context__.vals_r("treatment_subject_8");
        current_statement__ = 21;
        pos__ = 1;
        current_statement__ = 21;
        for (int sym1__ = 1; sym1__ <= treatment_subject_8_1dim__; ++sym1__) {
          current_statement__ = 21;
          stan::model::assign(treatment_subject_8,
            treatment_subject_8_flat__[(pos__ - 1)],
            "assigning variable treatment_subject_8",
            stan::model::index_uni(sym1__));
          current_statement__ = 21;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(treatment_subject_8);
      Eigen::Matrix<local_scalar_t__,-1,1> control_subject_8 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(control_subject_8_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> control_subject_8_flat__;
        current_statement__ = 22;
        control_subject_8_flat__ = context__.vals_r("control_subject_8");
        current_statement__ = 22;
        pos__ = 1;
        current_statement__ = 22;
        for (int sym1__ = 1; sym1__ <= control_subject_8_1dim__; ++sym1__) {
          current_statement__ = 22;
          stan::model::assign(control_subject_8,
            control_subject_8_flat__[(pos__ - 1)],
            "assigning variable control_subject_8",
            stan::model::index_uni(sym1__));
          current_statement__ = 22;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(control_subject_8);
    } catch (const std::exception& e) {
      stan::lang::rethrow_located(e, locations_array__[current_statement__]);
    }
  }
  inline void
  get_param_names(std::vector<std::string>& names__, const bool
                  emit_transformed_parameters__ = true, const bool
                  emit_generated_quantities__ = true) const {
    names__ = std::vector<std::string>{"inferred_grand_treatment_mean",
                "inferred_grand_control_mean",
                "inferred_between_group_stddev",
                "inferred_group_treatment_mean",
                "inferred_group_control_mean", "inferred_in_group_stddev",
                "treatment_subject_1", "control_subject_1",
                "treatment_subject_2", "control_subject_2",
                "treatment_subject_3", "control_subject_3",
                "treatment_subject_4", "control_subject_4",
                "treatment_subject_5", "control_subject_5",
                "treatment_subject_6", "control_subject_6",
                "treatment_subject_7", "control_subject_7",
                "treatment_subject_8", "control_subject_8"};
    if (emit_transformed_parameters__) {
      std::vector<std::string>
        temp{"sampled_meanE", "sampled_varE", "sampled_meanC", "sampled_varC"};
      names__.reserve(names__.size() + temp.size());
      names__.insert(names__.end(), temp.begin(), temp.end());
    }
    if (emit_generated_quantities__) {}
  }
  inline void
  get_dims(std::vector<std::vector<size_t>>& dimss__, const bool
           emit_transformed_parameters__ = true, const bool
           emit_generated_quantities__ = true) const {
    dimss__ = std::vector<std::vector<size_t>>{std::vector<size_t>{},
                std::vector<size_t>{}, std::vector<size_t>{},
                std::vector<size_t>{static_cast<size_t>(n_studies)},
                std::vector<size_t>{static_cast<size_t>(n_studies)},
                std::vector<size_t>{static_cast<size_t>(n_studies)},
                std::vector<size_t>{static_cast<size_t>(
                                      treatment_subject_1_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      control_subject_1_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      treatment_subject_2_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      control_subject_2_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      treatment_subject_3_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      control_subject_3_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      treatment_subject_4_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      control_subject_4_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      treatment_subject_5_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      control_subject_5_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      treatment_subject_6_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      control_subject_6_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      treatment_subject_7_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      control_subject_7_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      treatment_subject_8_1dim__)},
                std::vector<size_t>{static_cast<size_t>(
                                      control_subject_8_1dim__)}};
    if (emit_transformed_parameters__) {
      std::vector<std::vector<size_t>>
        temp{std::vector<size_t>{static_cast<size_t>(n_studies)},
             std::vector<size_t>{static_cast<size_t>(n_studies)},
             std::vector<size_t>{static_cast<size_t>(n_studies)},
             std::vector<size_t>{static_cast<size_t>(n_studies)}};
      dimss__.reserve(dimss__.size() + temp.size());
      dimss__.insert(dimss__.end(), temp.begin(), temp.end());
    }
    if (emit_generated_quantities__) {}
  }
  inline void
  constrained_param_names(std::vector<std::string>& param_names__, bool
                          emit_transformed_parameters__ = true, bool
                          emit_generated_quantities__ = true) const final {
    param_names__.emplace_back(std::string() +
      "inferred_grand_treatment_mean");
    param_names__.emplace_back(std::string() + "inferred_grand_control_mean");
    param_names__.emplace_back(std::string() +
      "inferred_between_group_stddev");
    for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
      param_names__.emplace_back(std::string() +
        "inferred_group_treatment_mean" + '.' + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
      param_names__.emplace_back(std::string() +
        "inferred_group_control_mean" + '.' + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
      param_names__.emplace_back(std::string() + "inferred_in_group_stddev" +
        '.' + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_1" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_2" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_3" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_4_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_4" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_4_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_4" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_5_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_5" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_5_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_5" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_6_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_6" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_6_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_6" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_7_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_7" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_7_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_7" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_8_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_8" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_8_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_8" + '.' +
        std::to_string(sym1__));
    }
    if (emit_transformed_parameters__) {
      for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
        param_names__.emplace_back(std::string() + "sampled_meanE" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
        param_names__.emplace_back(std::string() + "sampled_varE" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
        param_names__.emplace_back(std::string() + "sampled_meanC" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
        param_names__.emplace_back(std::string() + "sampled_varC" + '.' +
          std::to_string(sym1__));
      }
    }
    if (emit_generated_quantities__) {}
  }
  inline void
  unconstrained_param_names(std::vector<std::string>& param_names__, bool
                            emit_transformed_parameters__ = true, bool
                            emit_generated_quantities__ = true) const final {
    param_names__.emplace_back(std::string() +
      "inferred_grand_treatment_mean");
    param_names__.emplace_back(std::string() + "inferred_grand_control_mean");
    param_names__.emplace_back(std::string() +
      "inferred_between_group_stddev");
    for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
      param_names__.emplace_back(std::string() +
        "inferred_group_treatment_mean" + '.' + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
      param_names__.emplace_back(std::string() +
        "inferred_group_control_mean" + '.' + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
      param_names__.emplace_back(std::string() + "inferred_in_group_stddev" +
        '.' + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_1" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_2" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_3" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_4_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_4" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_4_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_4" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_5_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_5" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_5_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_5" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_6_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_6" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_6_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_6" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_7_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_7" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_7_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_7" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= treatment_subject_8_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "treatment_subject_8" + '.'
        + std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= control_subject_8_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "control_subject_8" + '.' +
        std::to_string(sym1__));
    }
    if (emit_transformed_parameters__) {
      for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
        param_names__.emplace_back(std::string() + "sampled_meanE" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
        param_names__.emplace_back(std::string() + "sampled_varE" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
        param_names__.emplace_back(std::string() + "sampled_meanC" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= n_studies; ++sym1__) {
        param_names__.emplace_back(std::string() + "sampled_varC" + '.' +
          std::to_string(sym1__));
      }
    }
    if (emit_generated_quantities__) {}
  }
  inline std::string get_constrained_sizedtypes() const {
    return std::string("[{\"name\":\"inferred_grand_treatment_mean\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"inferred_grand_control_mean\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"inferred_between_group_stddev\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"inferred_group_treatment_mean\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"parameters\"},{\"name\":\"inferred_group_control_mean\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"parameters\"},{\"name\":\"inferred_in_group_stddev\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_1_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_1_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_2_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_2_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_3_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_3_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_4\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_4_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_4\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_4_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_5\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_5_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_5\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_5_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_6\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_6_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_6\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_6_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_7\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_7_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_7\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_7_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_8\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_8_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_8\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_8_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"sampled_meanE\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"transformed_parameters\"},{\"name\":\"sampled_varE\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"transformed_parameters\"},{\"name\":\"sampled_meanC\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"transformed_parameters\"},{\"name\":\"sampled_varC\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"transformed_parameters\"}]");
  }
  inline std::string get_unconstrained_sizedtypes() const {
    return std::string("[{\"name\":\"inferred_grand_treatment_mean\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"inferred_grand_control_mean\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"inferred_between_group_stddev\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"inferred_group_treatment_mean\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"parameters\"},{\"name\":\"inferred_group_control_mean\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"parameters\"},{\"name\":\"inferred_in_group_stddev\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_1_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_1_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_2_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_2_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_3_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_3_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_4\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_4_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_4\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_4_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_5\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_5_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_5\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_5_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_6\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_6_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_6\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_6_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_7\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_7_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_7\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_7_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"treatment_subject_8\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(treatment_subject_8_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"control_subject_8\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(control_subject_8_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"sampled_meanE\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"transformed_parameters\"},{\"name\":\"sampled_varE\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"transformed_parameters\"},{\"name\":\"sampled_meanC\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"transformed_parameters\"},{\"name\":\"sampled_varC\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(n_studies) + "},\"block\":\"transformed_parameters\"}]");
  }
  // Begin method overload boilerplate
  template <typename RNG> inline void
  write_array(RNG& base_rng, Eigen::Matrix<double,-1,1>& params_r,
              Eigen::Matrix<double,-1,1>& vars, const bool
              emit_transformed_parameters = true, const bool
              emit_generated_quantities = true, std::ostream*
              pstream = nullptr) const {
    const size_t num_params__ = (((((((((((((((((((((1 + 1) + 1) + n_studies)
      + n_studies) + n_studies) + treatment_subject_1_1dim__) +
      control_subject_1_1dim__) + treatment_subject_2_1dim__) +
      control_subject_2_1dim__) + treatment_subject_3_1dim__) +
      control_subject_3_1dim__) + treatment_subject_4_1dim__) +
      control_subject_4_1dim__) + treatment_subject_5_1dim__) +
      control_subject_5_1dim__) + treatment_subject_6_1dim__) +
      control_subject_6_1dim__) + treatment_subject_7_1dim__) +
      control_subject_7_1dim__) + treatment_subject_8_1dim__) +
      control_subject_8_1dim__);
    const size_t num_transformed = emit_transformed_parameters *
      ((((n_studies + n_studies) + n_studies) + n_studies));
    const size_t num_gen_quantities = emit_generated_quantities * (0);
    const size_t num_to_write = num_params__ + num_transformed +
      num_gen_quantities;
    std::vector<int> params_i;
    vars = Eigen::Matrix<double,-1,1>::Constant(num_to_write,
             std::numeric_limits<double>::quiet_NaN());
    write_array_impl(base_rng, params_r, params_i, vars,
      emit_transformed_parameters, emit_generated_quantities, pstream);
  }
  template <typename RNG> inline void
  write_array(RNG& base_rng, std::vector<double>& params_r, std::vector<int>&
              params_i, std::vector<double>& vars, bool
              emit_transformed_parameters = true, bool
              emit_generated_quantities = true, std::ostream*
              pstream = nullptr) const {
    const size_t num_params__ = (((((((((((((((((((((1 + 1) + 1) + n_studies)
      + n_studies) + n_studies) + treatment_subject_1_1dim__) +
      control_subject_1_1dim__) + treatment_subject_2_1dim__) +
      control_subject_2_1dim__) + treatment_subject_3_1dim__) +
      control_subject_3_1dim__) + treatment_subject_4_1dim__) +
      control_subject_4_1dim__) + treatment_subject_5_1dim__) +
      control_subject_5_1dim__) + treatment_subject_6_1dim__) +
      control_subject_6_1dim__) + treatment_subject_7_1dim__) +
      control_subject_7_1dim__) + treatment_subject_8_1dim__) +
      control_subject_8_1dim__);
    const size_t num_transformed = emit_transformed_parameters *
      ((((n_studies + n_studies) + n_studies) + n_studies));
    const size_t num_gen_quantities = emit_generated_quantities * (0);
    const size_t num_to_write = num_params__ + num_transformed +
      num_gen_quantities;
    vars = std::vector<double>(num_to_write,
             std::numeric_limits<double>::quiet_NaN());
    write_array_impl(base_rng, params_r, params_i, vars,
      emit_transformed_parameters, emit_generated_quantities, pstream);
  }
  template <bool propto__, bool jacobian__, typename T_> inline T_
  log_prob(Eigen::Matrix<T_,-1,1>& params_r, std::ostream* pstream = nullptr) const {
    Eigen::Matrix<int,-1,1> params_i;
    return log_prob_impl<propto__, jacobian__>(params_r, params_i, pstream);
  }
  template <bool propto__, bool jacobian__, typename T_> inline T_
  log_prob(std::vector<T_>& params_r, std::vector<int>& params_i,
           std::ostream* pstream = nullptr) const {
    return log_prob_impl<propto__, jacobian__>(params_r, params_i, pstream);
  }
  inline void
  transform_inits(const stan::io::var_context& context,
                  Eigen::Matrix<double,-1,1>& params_r, std::ostream*
                  pstream = nullptr) const final {
    std::vector<double> params_r_vec(params_r.size());
    std::vector<int> params_i;
    transform_inits(context, params_i, params_r_vec, pstream);
    params_r = Eigen::Map<Eigen::Matrix<double,-1,1>>(params_r_vec.data(),
                 params_r_vec.size());
  }
  inline void
  transform_inits(const stan::io::var_context& context, std::vector<int>&
                  params_i, std::vector<double>& vars, std::ostream*
                  pstream__ = nullptr) const {
    vars.resize(num_params_r__);
    transform_inits_impl(context, vars, pstream__);
  }
  inline void
  unconstrain_array(const std::vector<double>& params_constrained,
                    std::vector<double>& params_unconstrained, std::ostream*
                    pstream = nullptr) const {
    const std::vector<int> params_i;
    params_unconstrained = std::vector<double>(num_params_r__,
                             std::numeric_limits<double>::quiet_NaN());
    unconstrain_array_impl(params_constrained, params_i,
      params_unconstrained, pstream);
  }
  inline void
  unconstrain_array(const Eigen::Matrix<double,-1,1>& params_constrained,
                    Eigen::Matrix<double,-1,1>& params_unconstrained,
                    std::ostream* pstream = nullptr) const {
    const std::vector<int> params_i;
    params_unconstrained = Eigen::Matrix<double,-1,1>::Constant(num_params_r__,
                             std::numeric_limits<double>::quiet_NaN());
    unconstrain_array_impl(params_constrained, params_i,
      params_unconstrained, pstream);
  }
};
}
using stan_model = model81214d872721__namespace::model81214d872721_;
#ifndef USING_R
// Boilerplate
stan::model::model_base&
new_model(stan::io::var_context& data_context, unsigned int seed,
          std::ostream* msg_stream) {
  stan_model* m = new stan_model(data_context, seed, msg_stream);
  return *m;
}
stan::math::profile_map& get_stan_profile_data() {
  return model81214d872721__namespace::profiles__;
}
#endif
#endif