#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 model13c946e8d0e60__namespace {
using stan::model::model_base_crtp;
using namespace stan::math;
stan::math::profile_map profiles__;
static constexpr std::array<const char*, 88> locations_array__ =
  {" (found before start of program)",
  " (in 'anon_model', line 40, column 2 to column 15)",
  " (in 'anon_model', line 41, column 2 to column 17)",
  " (in 'anon_model', line 42, column 2 to column 22)",
  " (in 'anon_model', line 43, column 2 to column 28)",
  " (in 'anon_model', line 44, column 2 to column 29)",
  " (in 'anon_model', line 45, column 2 to column 28)",
  " (in 'anon_model', line 46, column 2 to column 29)",
  " (in 'anon_model', line 47, column 2 to column 28)",
  " (in 'anon_model', line 48, column 2 to column 29)",
  " (in 'anon_model', line 51, column 2 to column 20)",
  " (in 'anon_model', line 52, column 2 to column 20)",
  " (in 'anon_model', line 53, column 2 to column 20)",
  " (in 'anon_model', line 54, column 2 to column 18)",
  " (in 'anon_model', line 88, column 2 to column 57)",
  " (in 'anon_model', line 55, column 2 to column 40)",
  " (in 'anon_model', line 56, column 2 to column 31)",
  " (in 'anon_model', line 57, column 2 to column 31)",
  " (in 'anon_model', line 58, column 2 to column 52)",
  " (in 'anon_model', line 59, column 2 to line 60, column 41)",
  " (in 'anon_model', line 61, column 2 to line 62, column 41)",
  " (in 'anon_model', line 63, column 2 to line 64, column 41)",
  " (in 'anon_model', line 65, column 2 to line 66, column 41)",
  " (in 'anon_model', line 72, column 11 to column 12)",
  " (in 'anon_model', line 72, column 4 to column 38)",
  " (in 'anon_model', line 73, column 4 to column 20)",
  " (in 'anon_model', line 76, column 6 to column 94)",
  " (in 'anon_model', line 74, column 19 to line 77, column 5)",
  " (in 'anon_model', line 74, column 4 to line 77, column 5)",
  " (in 'anon_model', line 78, column 4 to column 55)",
  " (in 'anon_model', line 70, column 19 to line 79, column 3)",
  " (in 'anon_model', line 70, column 2 to line 79, column 3)",
  " (in 'anon_model', line 81, column 2 to column 19)",
  " (in 'anon_model', line 82, column 2 to column 36)",
  " (in 'anon_model', line 83, column 2 to column 36)",
  " (in 'anon_model', line 84, column 2 to column 36)",
  " (in 'anon_model', line 5, column 2 to column 17)",
  " (in 'anon_model', line 6, column 9 to column 10)",
  " (in 'anon_model', line 6, column 2 to column 14)",
  " (in 'anon_model', line 7, column 2 to column 17)",
  " (in 'anon_model', line 8, column 9 to column 10)",
  " (in 'anon_model', line 8, column 12 to column 13)",
  " (in 'anon_model', line 8, column 2 to column 17)",
  " (in 'anon_model', line 9, column 2 to column 18)",
  " (in 'anon_model', line 11, column 2 to column 19)",
  " (in 'anon_model', line 12, column 2 to column 19)",
  " (in 'anon_model', line 13, column 8 to column 9)",
  " (in 'anon_model', line 13, column 2 to column 28)",
  " (in 'anon_model', line 14, column 9 to column 12)",
  " (in 'anon_model', line 14, column 14 to column 17)",
  " (in 'anon_model', line 14, column 2 to column 26)",
  " (in 'anon_model', line 16, column 9 to column 10)",
  " (in 'anon_model', line 16, column 2 to column 18)",
  " (in 'anon_model', line 18, column 2 to column 19)",
  " (in 'anon_model', line 19, column 2 to column 19)",
  " (in 'anon_model', line 20, column 8 to column 9)",
  " (in 'anon_model', line 20, column 2 to column 28)",
  " (in 'anon_model', line 22, column 9 to column 10)",
  " (in 'anon_model', line 22, column 2 to column 18)",
  " (in 'anon_model', line 24, column 2 to column 19)",
  " (in 'anon_model', line 25, column 2 to column 19)",
  " (in 'anon_model', line 26, column 8 to column 9)",
  " (in 'anon_model', line 26, column 2 to column 28)",
  " (in 'anon_model', line 28, column 9 to column 10)",
  " (in 'anon_model', line 28, column 2 to column 18)",
  " (in 'anon_model', line 29, column 2 to column 17)",
  " (in 'anon_model', line 32, column 9 to column 10)",
  " (in 'anon_model', line 32, column 12 to column 14)",
  " (in 'anon_model', line 32, column 2 to column 19)",
  " (in 'anon_model', line 33, column 9 to column 11)",
  " (in 'anon_model', line 33, column 2 to column 21)",
  " (in 'anon_model', line 35, column 4 to column 34)",
  " (in 'anon_model', line 36, column 4 to column 42)",
  " (in 'anon_model', line 34, column 17 to line 37, column 3)",
  " (in 'anon_model', line 34, column 2 to line 37, column 3)",
  " (in 'anon_model', line 40, column 9 to column 11)",
  " (in 'anon_model', line 43, column 18 to column 21)",
  " (in 'anon_model', line 44, column 8 to column 11)",
  " (in 'anon_model', line 44, column 20 to column 23)",
  " (in 'anon_model', line 45, column 18 to column 21)",
  " (in 'anon_model', line 46, column 8 to column 11)",
  " (in 'anon_model', line 46, column 20 to column 23)",
  " (in 'anon_model', line 47, column 18 to column 21)",
  " (in 'anon_model', line 48, column 8 to column 11)",
  " (in 'anon_model', line 48, column 20 to column 23)",
  " (in 'anon_model', line 51, column 9 to column 12)",
  " (in 'anon_model', line 52, column 9 to column 12)",
  " (in 'anon_model', line 53, column 9 to column 12)"};
class model13c946e8d0e60_ final : public model_base_crtp<model13c946e8d0e60_> {
private:
  int N;
  Eigen::Matrix<double,-1,1> Y_data__;
  int K;
  Eigen::Matrix<double,-1,-1> X_data__;
  int Kc;
  int N_1;
  int M_1;
  std::vector<int> J_1;
  Eigen::Matrix<double,-1,-1> Lcov_1_data__;
  Eigen::Matrix<double,-1,1> Z_1_1_data__;
  int N_2;
  int M_2;
  std::vector<int> J_2;
  Eigen::Matrix<double,-1,1> Z_2_1_data__;
  int N_3;
  int M_3;
  std::vector<int> J_3;
  Eigen::Matrix<double,-1,1> Z_3_1_data__;
  int prior_only;
  Eigen::Matrix<double,-1,-1> Xc_data__;
  Eigen::Matrix<double,-1,1> means_X_data__;
  Eigen::Map<Eigen::Matrix<double,-1,1>> Y{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> X{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> Lcov_1{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> Z_1_1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> Z_2_1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> Z_3_1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> Xc{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> means_X{nullptr, 0};
public:
  ~model13c946e8d0e60_() {}
  model13c946e8d0e60_(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__ =
      "model13c946e8d0e60__namespace::model13c946e8d0e60_";
    // 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__ = 36;
      context__.validate_dims("data initialization", "N", "int",
        std::vector<size_t>{});
      N = std::numeric_limits<int>::min();
      current_statement__ = 36;
      N = context__.vals_i("N")[(1 - 1)];
      current_statement__ = 36;
      stan::math::check_greater_or_equal(function__, "N", N, 1);
      current_statement__ = 37;
      stan::math::validate_non_negative_index("Y", "N", N);
      current_statement__ = 38;
      context__.validate_dims("data initialization", "Y", "double",
        std::vector<size_t>{static_cast<size_t>(N)});
      Y_data__ = Eigen::Matrix<double,-1,1>::Constant(N,
                   std::numeric_limits<double>::quiet_NaN());
      new (&Y) Eigen::Map<Eigen::Matrix<double,-1,1>>(Y_data__.data(), N);
      {
        std::vector<local_scalar_t__> Y_flat__;
        current_statement__ = 38;
        Y_flat__ = context__.vals_r("Y");
        current_statement__ = 38;
        pos__ = 1;
        current_statement__ = 38;
        for (int sym1__ = 1; sym1__ <= N; ++sym1__) {
          current_statement__ = 38;
          stan::model::assign(Y, Y_flat__[(pos__ - 1)],
            "assigning variable Y", stan::model::index_uni(sym1__));
          current_statement__ = 38;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 39;
      context__.validate_dims("data initialization", "K", "int",
        std::vector<size_t>{});
      K = std::numeric_limits<int>::min();
      current_statement__ = 39;
      K = context__.vals_i("K")[(1 - 1)];
      current_statement__ = 39;
      stan::math::check_greater_or_equal(function__, "K", K, 1);
      current_statement__ = 40;
      stan::math::validate_non_negative_index("X", "N", N);
      current_statement__ = 41;
      stan::math::validate_non_negative_index("X", "K", K);
      current_statement__ = 42;
      context__.validate_dims("data initialization", "X", "double",
        std::vector<size_t>{static_cast<size_t>(N), static_cast<size_t>(K)});
      X_data__ = Eigen::Matrix<double,-1,-1>::Constant(N, K,
                   std::numeric_limits<double>::quiet_NaN());
      new (&X) Eigen::Map<Eigen::Matrix<double,-1,-1>>(X_data__.data(), N, K);
      {
        std::vector<local_scalar_t__> X_flat__;
        current_statement__ = 42;
        X_flat__ = context__.vals_r("X");
        current_statement__ = 42;
        pos__ = 1;
        current_statement__ = 42;
        for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
          current_statement__ = 42;
          for (int sym2__ = 1; sym2__ <= N; ++sym2__) {
            current_statement__ = 42;
            stan::model::assign(X, X_flat__[(pos__ - 1)],
              "assigning variable X", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 42;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 43;
      context__.validate_dims("data initialization", "Kc", "int",
        std::vector<size_t>{});
      Kc = std::numeric_limits<int>::min();
      current_statement__ = 43;
      Kc = context__.vals_i("Kc")[(1 - 1)];
      current_statement__ = 43;
      stan::math::check_greater_or_equal(function__, "Kc", Kc, 1);
      current_statement__ = 44;
      context__.validate_dims("data initialization", "N_1", "int",
        std::vector<size_t>{});
      N_1 = std::numeric_limits<int>::min();
      current_statement__ = 44;
      N_1 = context__.vals_i("N_1")[(1 - 1)];
      current_statement__ = 44;
      stan::math::check_greater_or_equal(function__, "N_1", N_1, 1);
      current_statement__ = 45;
      context__.validate_dims("data initialization", "M_1", "int",
        std::vector<size_t>{});
      M_1 = std::numeric_limits<int>::min();
      current_statement__ = 45;
      M_1 = context__.vals_i("M_1")[(1 - 1)];
      current_statement__ = 45;
      stan::math::check_greater_or_equal(function__, "M_1", M_1, 1);
      current_statement__ = 46;
      stan::math::validate_non_negative_index("J_1", "N", N);
      current_statement__ = 47;
      context__.validate_dims("data initialization", "J_1", "int",
        std::vector<size_t>{static_cast<size_t>(N)});
      J_1 = std::vector<int>(N, std::numeric_limits<int>::min());
      current_statement__ = 47;
      J_1 = context__.vals_i("J_1");
      current_statement__ = 47;
      stan::math::check_greater_or_equal(function__, "J_1", J_1, 1);
      current_statement__ = 48;
      stan::math::validate_non_negative_index("Lcov_1", "N_1", N_1);
      current_statement__ = 49;
      stan::math::validate_non_negative_index("Lcov_1", "N_1", N_1);
      current_statement__ = 50;
      context__.validate_dims("data initialization", "Lcov_1", "double",
        std::vector<size_t>{static_cast<size_t>(N_1),
          static_cast<size_t>(N_1)});
      Lcov_1_data__ = Eigen::Matrix<double,-1,-1>::Constant(N_1, N_1,
                        std::numeric_limits<double>::quiet_NaN());
      new (&Lcov_1)
        Eigen::Map<Eigen::Matrix<double,-1,-1>>(Lcov_1_data__.data(), N_1,
        N_1);
      {
        std::vector<local_scalar_t__> Lcov_1_flat__;
        current_statement__ = 50;
        Lcov_1_flat__ = context__.vals_r("Lcov_1");
        current_statement__ = 50;
        pos__ = 1;
        current_statement__ = 50;
        for (int sym1__ = 1; sym1__ <= N_1; ++sym1__) {
          current_statement__ = 50;
          for (int sym2__ = 1; sym2__ <= N_1; ++sym2__) {
            current_statement__ = 50;
            stan::model::assign(Lcov_1, Lcov_1_flat__[(pos__ - 1)],
              "assigning variable Lcov_1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 50;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 51;
      stan::math::validate_non_negative_index("Z_1_1", "N", N);
      current_statement__ = 52;
      context__.validate_dims("data initialization", "Z_1_1", "double",
        std::vector<size_t>{static_cast<size_t>(N)});
      Z_1_1_data__ = Eigen::Matrix<double,-1,1>::Constant(N,
                       std::numeric_limits<double>::quiet_NaN());
      new (&Z_1_1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(Z_1_1_data__.data(), N);
      {
        std::vector<local_scalar_t__> Z_1_1_flat__;
        current_statement__ = 52;
        Z_1_1_flat__ = context__.vals_r("Z_1_1");
        current_statement__ = 52;
        pos__ = 1;
        current_statement__ = 52;
        for (int sym1__ = 1; sym1__ <= N; ++sym1__) {
          current_statement__ = 52;
          stan::model::assign(Z_1_1, Z_1_1_flat__[(pos__ - 1)],
            "assigning variable Z_1_1", stan::model::index_uni(sym1__));
          current_statement__ = 52;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 53;
      context__.validate_dims("data initialization", "N_2", "int",
        std::vector<size_t>{});
      N_2 = std::numeric_limits<int>::min();
      current_statement__ = 53;
      N_2 = context__.vals_i("N_2")[(1 - 1)];
      current_statement__ = 53;
      stan::math::check_greater_or_equal(function__, "N_2", N_2, 1);
      current_statement__ = 54;
      context__.validate_dims("data initialization", "M_2", "int",
        std::vector<size_t>{});
      M_2 = std::numeric_limits<int>::min();
      current_statement__ = 54;
      M_2 = context__.vals_i("M_2")[(1 - 1)];
      current_statement__ = 54;
      stan::math::check_greater_or_equal(function__, "M_2", M_2, 1);
      current_statement__ = 55;
      stan::math::validate_non_negative_index("J_2", "N", N);
      current_statement__ = 56;
      context__.validate_dims("data initialization", "J_2", "int",
        std::vector<size_t>{static_cast<size_t>(N)});
      J_2 = std::vector<int>(N, std::numeric_limits<int>::min());
      current_statement__ = 56;
      J_2 = context__.vals_i("J_2");
      current_statement__ = 56;
      stan::math::check_greater_or_equal(function__, "J_2", J_2, 1);
      current_statement__ = 57;
      stan::math::validate_non_negative_index("Z_2_1", "N", N);
      current_statement__ = 58;
      context__.validate_dims("data initialization", "Z_2_1", "double",
        std::vector<size_t>{static_cast<size_t>(N)});
      Z_2_1_data__ = Eigen::Matrix<double,-1,1>::Constant(N,
                       std::numeric_limits<double>::quiet_NaN());
      new (&Z_2_1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(Z_2_1_data__.data(), N);
      {
        std::vector<local_scalar_t__> Z_2_1_flat__;
        current_statement__ = 58;
        Z_2_1_flat__ = context__.vals_r("Z_2_1");
        current_statement__ = 58;
        pos__ = 1;
        current_statement__ = 58;
        for (int sym1__ = 1; sym1__ <= N; ++sym1__) {
          current_statement__ = 58;
          stan::model::assign(Z_2_1, Z_2_1_flat__[(pos__ - 1)],
            "assigning variable Z_2_1", stan::model::index_uni(sym1__));
          current_statement__ = 58;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 59;
      context__.validate_dims("data initialization", "N_3", "int",
        std::vector<size_t>{});
      N_3 = std::numeric_limits<int>::min();
      current_statement__ = 59;
      N_3 = context__.vals_i("N_3")[(1 - 1)];
      current_statement__ = 59;
      stan::math::check_greater_or_equal(function__, "N_3", N_3, 1);
      current_statement__ = 60;
      context__.validate_dims("data initialization", "M_3", "int",
        std::vector<size_t>{});
      M_3 = std::numeric_limits<int>::min();
      current_statement__ = 60;
      M_3 = context__.vals_i("M_3")[(1 - 1)];
      current_statement__ = 60;
      stan::math::check_greater_or_equal(function__, "M_3", M_3, 1);
      current_statement__ = 61;
      stan::math::validate_non_negative_index("J_3", "N", N);
      current_statement__ = 62;
      context__.validate_dims("data initialization", "J_3", "int",
        std::vector<size_t>{static_cast<size_t>(N)});
      J_3 = std::vector<int>(N, std::numeric_limits<int>::min());
      current_statement__ = 62;
      J_3 = context__.vals_i("J_3");
      current_statement__ = 62;
      stan::math::check_greater_or_equal(function__, "J_3", J_3, 1);
      current_statement__ = 63;
      stan::math::validate_non_negative_index("Z_3_1", "N", N);
      current_statement__ = 64;
      context__.validate_dims("data initialization", "Z_3_1", "double",
        std::vector<size_t>{static_cast<size_t>(N)});
      Z_3_1_data__ = Eigen::Matrix<double,-1,1>::Constant(N,
                       std::numeric_limits<double>::quiet_NaN());
      new (&Z_3_1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(Z_3_1_data__.data(), N);
      {
        std::vector<local_scalar_t__> Z_3_1_flat__;
        current_statement__ = 64;
        Z_3_1_flat__ = context__.vals_r("Z_3_1");
        current_statement__ = 64;
        pos__ = 1;
        current_statement__ = 64;
        for (int sym1__ = 1; sym1__ <= N; ++sym1__) {
          current_statement__ = 64;
          stan::model::assign(Z_3_1, Z_3_1_flat__[(pos__ - 1)],
            "assigning variable Z_3_1", stan::model::index_uni(sym1__));
          current_statement__ = 64;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 65;
      context__.validate_dims("data initialization", "prior_only", "int",
        std::vector<size_t>{});
      prior_only = std::numeric_limits<int>::min();
      current_statement__ = 65;
      prior_only = context__.vals_i("prior_only")[(1 - 1)];
      current_statement__ = 66;
      stan::math::validate_non_negative_index("Xc", "N", N);
      current_statement__ = 67;
      stan::math::validate_non_negative_index("Xc", "Kc", Kc);
      current_statement__ = 68;
      Xc_data__ = Eigen::Matrix<double,-1,-1>::Constant(N, Kc,
                    std::numeric_limits<double>::quiet_NaN());
      new (&Xc) Eigen::Map<Eigen::Matrix<double,-1,-1>>(Xc_data__.data(), N,
        Kc);
      current_statement__ = 69;
      stan::math::validate_non_negative_index("means_X", "Kc", Kc);
      current_statement__ = 70;
      means_X_data__ = Eigen::Matrix<double,-1,1>::Constant(Kc,
                         std::numeric_limits<double>::quiet_NaN());
      new (&means_X)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(means_X_data__.data(), Kc);
      current_statement__ = 74;
      for (int i = 2; i <= K; ++i) {
        current_statement__ = 71;
        stan::model::assign(means_X,
          stan::math::mean(
            stan::model::rvalue(X, "X", stan::model::index_omni(),
              stan::model::index_uni(i))), "assigning variable means_X",
          stan::model::index_uni((i - 1)));
        current_statement__ = 72;
        stan::model::assign(Xc,
          stan::math::subtract(
            stan::model::rvalue(X, "X", stan::model::index_omni(),
              stan::model::index_uni(i)),
            stan::model::rvalue(means_X, "means_X",
              stan::model::index_uni((i - 1)))), "assigning variable Xc",
          stan::model::index_omni(), stan::model::index_uni((i - 1)));
      }
      current_statement__ = 75;
      stan::math::validate_non_negative_index("b", "Kc", Kc);
      current_statement__ = 76;
      stan::math::validate_non_negative_index("sd_1", "M_1", M_1);
      current_statement__ = 77;
      stan::math::validate_non_negative_index("z_1", "M_1", M_1);
      current_statement__ = 78;
      stan::math::validate_non_negative_index("z_1", "N_1", N_1);
      current_statement__ = 79;
      stan::math::validate_non_negative_index("sd_2", "M_2", M_2);
      current_statement__ = 80;
      stan::math::validate_non_negative_index("z_2", "M_2", M_2);
      current_statement__ = 81;
      stan::math::validate_non_negative_index("z_2", "N_2", N_2);
      current_statement__ = 82;
      stan::math::validate_non_negative_index("sd_3", "M_3", M_3);
      current_statement__ = 83;
      stan::math::validate_non_negative_index("z_3", "M_3", M_3);
      current_statement__ = 84;
      stan::math::validate_non_negative_index("z_3", "N_3", N_3);
      current_statement__ = 85;
      stan::math::validate_non_negative_index("r_1_1", "N_1", N_1);
      current_statement__ = 86;
      stan::math::validate_non_negative_index("r_2_1", "N_2", N_2);
      current_statement__ = 87;
      stan::math::validate_non_negative_index("r_3_1", "N_3", N_3);
    } catch (const std::exception& e) {
      stan::lang::rethrow_located(e, locations_array__[current_statement__]);
    }
    num_params_r__ = Kc + 1 + 1 + M_1 + (M_1 * N_1) + M_2 + (M_2 * N_2) + M_3
      + (M_3 * N_3);
  }
  inline std::string model_name() const final {
    return "model13c946e8d0e60_";
  }
  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__ =
      "model13c946e8d0e60__namespace::log_prob";
    // suppress unused var warning
    (void) function__;
    try {
      Eigen::Matrix<local_scalar_t__,-1,1> b =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(Kc, DUMMY_VAR__);
      current_statement__ = 1;
      b = in__.template read<Eigen::Matrix<local_scalar_t__,-1,1>>(Kc);
      local_scalar_t__ Intercept = DUMMY_VAR__;
      current_statement__ = 2;
      Intercept = in__.template read<local_scalar_t__>();
      local_scalar_t__ sigma = DUMMY_VAR__;
      current_statement__ = 3;
      sigma = in__.template read_constrain_lb<local_scalar_t__,
                jacobian__>(0, lp__);
      Eigen::Matrix<local_scalar_t__,-1,1> sd_1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(M_1, DUMMY_VAR__);
      current_statement__ = 4;
      sd_1 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               M_1);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> z_1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(M_1,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_1, DUMMY_VAR__));
      current_statement__ = 5;
      z_1 = in__.template read<
              std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>>(M_1, N_1);
      Eigen::Matrix<local_scalar_t__,-1,1> sd_2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(M_2, DUMMY_VAR__);
      current_statement__ = 6;
      sd_2 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               M_2);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> z_2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(M_2,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_2, DUMMY_VAR__));
      current_statement__ = 7;
      z_2 = in__.template read<
              std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>>(M_2, N_2);
      Eigen::Matrix<local_scalar_t__,-1,1> sd_3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(M_3, DUMMY_VAR__);
      current_statement__ = 8;
      sd_3 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               M_3);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> z_3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(M_3,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_3, DUMMY_VAR__));
      current_statement__ = 9;
      z_3 = in__.template read<
              std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>>(M_3, N_3);
      Eigen::Matrix<local_scalar_t__,-1,1> r_1_1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_1, DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> r_2_1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_2, DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> r_3_1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_3, DUMMY_VAR__);
      local_scalar_t__ lprior = DUMMY_VAR__;
      current_statement__ = 13;
      lprior = 0;
      current_statement__ = 15;
      stan::model::assign(r_1_1,
        stan::math::multiply(
          stan::model::rvalue(sd_1, "sd_1", stan::model::index_uni(1)),
          stan::math::multiply(Lcov_1,
            stan::model::rvalue(z_1, "z_1", stan::model::index_uni(1)))),
        "assigning variable r_1_1");
      current_statement__ = 16;
      stan::model::assign(r_2_1,
        stan::math::multiply(
          stan::model::rvalue(sd_2, "sd_2", stan::model::index_uni(1)),
          stan::model::rvalue(z_2, "z_2", stan::model::index_uni(1))),
        "assigning variable r_2_1");
      current_statement__ = 17;
      stan::model::assign(r_3_1,
        stan::math::multiply(
          stan::model::rvalue(sd_3, "sd_3", stan::model::index_uni(1)),
          stan::model::rvalue(z_3, "z_3", stan::model::index_uni(1))),
        "assigning variable r_3_1");
      current_statement__ = 18;
      lprior = (lprior +
        stan::math::student_t_lpdf<false>(Intercept, 3, 7.4, 2.8));
      current_statement__ = 19;
      lprior = (lprior + (stan::math::student_t_lpdf<false>(sigma, 3, 0, 2.8)
        - (1 * stan::math::student_t_lccdf(0, 3, 0, 2.8))));
      current_statement__ = 20;
      lprior = (lprior + (stan::math::student_t_lpdf<false>(sd_1, 3, 0, 2.8)
        - (1 * stan::math::student_t_lccdf(0, 3, 0, 2.8))));
      current_statement__ = 21;
      lprior = (lprior + (stan::math::student_t_lpdf<false>(sd_2, 3, 0, 2.8)
        - (1 * stan::math::student_t_lccdf(0, 3, 0, 2.8))));
      current_statement__ = 22;
      lprior = (lprior + (stan::math::student_t_lpdf<false>(sd_3, 3, 0, 2.8)
        - (1 * stan::math::student_t_lccdf(0, 3, 0, 2.8))));
      {
        current_statement__ = 31;
        if (stan::math::logical_negation(prior_only)) {
          current_statement__ = 23;
          stan::math::validate_non_negative_index("mu", "N", N);
          Eigen::Matrix<local_scalar_t__,-1,1> mu =
            Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
          current_statement__ = 24;
          stan::model::assign(mu, stan::math::rep_vector(0.0, N),
            "assigning variable mu");
          current_statement__ = 25;
          stan::model::assign(mu,
            stan::math::add(stan::model::deep_copy(mu), Intercept),
            "assigning variable mu");
          current_statement__ = 28;
          for (int n = 1; n <= N; ++n) {
            current_statement__ = 26;
            stan::model::assign(mu,
              (stan::model::rvalue(mu, "mu", stan::model::index_uni(n)) +
              (((stan::model::rvalue(r_1_1, "r_1_1",
                   stan::model::index_uni(
                     stan::model::rvalue(J_1, "J_1",
                       stan::model::index_uni(n)))) *
              stan::model::rvalue(Z_1_1, "Z_1_1", stan::model::index_uni(n)))
              +
              (stan::model::rvalue(r_2_1, "r_2_1",
                 stan::model::index_uni(
                   stan::model::rvalue(J_2, "J_2", stan::model::index_uni(n))))
              *
              stan::model::rvalue(Z_2_1, "Z_2_1", stan::model::index_uni(n))))
              +
              (stan::model::rvalue(r_3_1, "r_3_1",
                 stan::model::index_uni(
                   stan::model::rvalue(J_3, "J_3", stan::model::index_uni(n))))
              *
              stan::model::rvalue(Z_3_1, "Z_3_1", stan::model::index_uni(n))))),
              "assigning variable mu", stan::model::index_uni(n));
          }
          current_statement__ = 29;
          lp_accum__.add(stan::math::normal_id_glm_lpdf<false>(Y, Xc, mu, b,
                           sigma));
        }
        current_statement__ = 32;
        lp_accum__.add(lprior);
        current_statement__ = 33;
        lp_accum__.add(stan::math::std_normal_lpdf<false>(
                         stan::model::rvalue(z_1, "z_1",
                           stan::model::index_uni(1))));
        current_statement__ = 34;
        lp_accum__.add(stan::math::std_normal_lpdf<false>(
                         stan::model::rvalue(z_2, "z_2",
                           stan::model::index_uni(1))));
        current_statement__ = 35;
        lp_accum__.add(stan::math::std_normal_lpdf<false>(
                         stan::model::rvalue(z_3, "z_3",
                           stan::model::index_uni(1))));
      }
    } 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__ =
      "model13c946e8d0e60__namespace::write_array";
    // suppress unused var warning
    (void) function__;
    try {
      Eigen::Matrix<double,-1,1> b =
        Eigen::Matrix<double,-1,1>::Constant(Kc,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 1;
      b = in__.template read<Eigen::Matrix<local_scalar_t__,-1,1>>(Kc);
      double Intercept = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 2;
      Intercept = in__.template read<local_scalar_t__>();
      double sigma = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 3;
      sigma = in__.template read_constrain_lb<local_scalar_t__,
                jacobian__>(0, lp__);
      Eigen::Matrix<double,-1,1> sd_1 =
        Eigen::Matrix<double,-1,1>::Constant(M_1,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 4;
      sd_1 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               M_1);
      std::vector<Eigen::Matrix<double,-1,1>> z_1 =
        std::vector<Eigen::Matrix<double,-1,1>>(M_1,
          Eigen::Matrix<double,-1,1>::Constant(N_1,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 5;
      z_1 = in__.template read<
              std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>>(M_1, N_1);
      Eigen::Matrix<double,-1,1> sd_2 =
        Eigen::Matrix<double,-1,1>::Constant(M_2,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 6;
      sd_2 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               M_2);
      std::vector<Eigen::Matrix<double,-1,1>> z_2 =
        std::vector<Eigen::Matrix<double,-1,1>>(M_2,
          Eigen::Matrix<double,-1,1>::Constant(N_2,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 7;
      z_2 = in__.template read<
              std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>>(M_2, N_2);
      Eigen::Matrix<double,-1,1> sd_3 =
        Eigen::Matrix<double,-1,1>::Constant(M_3,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 8;
      sd_3 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               M_3);
      std::vector<Eigen::Matrix<double,-1,1>> z_3 =
        std::vector<Eigen::Matrix<double,-1,1>>(M_3,
          Eigen::Matrix<double,-1,1>::Constant(N_3,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 9;
      z_3 = in__.template read<
              std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>>(M_3, N_3);
      Eigen::Matrix<double,-1,1> r_1_1 =
        Eigen::Matrix<double,-1,1>::Constant(N_1,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> r_2_1 =
        Eigen::Matrix<double,-1,1>::Constant(N_2,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> r_3_1 =
        Eigen::Matrix<double,-1,1>::Constant(N_3,
          std::numeric_limits<double>::quiet_NaN());
      double lprior = std::numeric_limits<double>::quiet_NaN();
      out__.write(b);
      out__.write(Intercept);
      out__.write(sigma);
      out__.write(sd_1);
      for (int sym1__ = 1; sym1__ <= N_1; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= M_1; ++sym2__) {
          out__.write(z_1[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      out__.write(sd_2);
      for (int sym1__ = 1; sym1__ <= N_2; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= M_2; ++sym2__) {
          out__.write(z_2[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      out__.write(sd_3);
      for (int sym1__ = 1; sym1__ <= N_3; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= M_3; ++sym2__) {
          out__.write(z_3[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      if (stan::math::logical_negation(
            (stan::math::primitive_value(emit_transformed_parameters__) ||
            stan::math::primitive_value(emit_generated_quantities__)))) {
        return ;
      }
      current_statement__ = 13;
      lprior = 0;
      current_statement__ = 15;
      stan::model::assign(r_1_1,
        stan::math::multiply(
          stan::model::rvalue(sd_1, "sd_1", stan::model::index_uni(1)),
          stan::math::multiply(Lcov_1,
            stan::model::rvalue(z_1, "z_1", stan::model::index_uni(1)))),
        "assigning variable r_1_1");
      current_statement__ = 16;
      stan::model::assign(r_2_1,
        stan::math::multiply(
          stan::model::rvalue(sd_2, "sd_2", stan::model::index_uni(1)),
          stan::model::rvalue(z_2, "z_2", stan::model::index_uni(1))),
        "assigning variable r_2_1");
      current_statement__ = 17;
      stan::model::assign(r_3_1,
        stan::math::multiply(
          stan::model::rvalue(sd_3, "sd_3", stan::model::index_uni(1)),
          stan::model::rvalue(z_3, "z_3", stan::model::index_uni(1))),
        "assigning variable r_3_1");
      current_statement__ = 18;
      lprior = (lprior +
        stan::math::student_t_lpdf<false>(Intercept, 3, 7.4, 2.8));
      current_statement__ = 19;
      lprior = (lprior + (stan::math::student_t_lpdf<false>(sigma, 3, 0, 2.8)
        - (1 * stan::math::student_t_lccdf(0, 3, 0, 2.8))));
      current_statement__ = 20;
      lprior = (lprior + (stan::math::student_t_lpdf<false>(sd_1, 3, 0, 2.8)
        - (1 * stan::math::student_t_lccdf(0, 3, 0, 2.8))));
      current_statement__ = 21;
      lprior = (lprior + (stan::math::student_t_lpdf<false>(sd_2, 3, 0, 2.8)
        - (1 * stan::math::student_t_lccdf(0, 3, 0, 2.8))));
      current_statement__ = 22;
      lprior = (lprior + (stan::math::student_t_lpdf<false>(sd_3, 3, 0, 2.8)
        - (1 * stan::math::student_t_lccdf(0, 3, 0, 2.8))));
      if (emit_transformed_parameters__) {
        out__.write(r_1_1);
        out__.write(r_2_1);
        out__.write(r_3_1);
        out__.write(lprior);
      }
      if (stan::math::logical_negation(emit_generated_quantities__)) {
        return ;
      }
      double b_Intercept = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 14;
      b_Intercept = (Intercept - stan::math::dot_product(means_X, b));
      out__.write(b_Intercept);
    } 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;
      Eigen::Matrix<local_scalar_t__,-1,1> b =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(Kc, DUMMY_VAR__);
      current_statement__ = 1;
      stan::model::assign(b,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(Kc),
        "assigning variable b");
      out__.write(b);
      local_scalar_t__ Intercept = DUMMY_VAR__;
      current_statement__ = 2;
      Intercept = in__.read<local_scalar_t__>();
      out__.write(Intercept);
      local_scalar_t__ sigma = DUMMY_VAR__;
      current_statement__ = 3;
      sigma = in__.read<local_scalar_t__>();
      out__.write_free_lb(0, sigma);
      Eigen::Matrix<local_scalar_t__,-1,1> sd_1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(M_1, DUMMY_VAR__);
      current_statement__ = 4;
      stan::model::assign(sd_1,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(M_1),
        "assigning variable sd_1");
      out__.write_free_lb(0, sd_1);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> z_1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(M_1,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_1, DUMMY_VAR__));
      current_statement__ = 5;
      for (int sym1__ = 1; sym1__ <= N_1; ++sym1__) {
        current_statement__ = 5;
        for (int sym2__ = 1; sym2__ <= M_1; ++sym2__) {
          current_statement__ = 5;
          stan::model::assign(z_1, in__.read<local_scalar_t__>(),
            "assigning variable z_1", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write(z_1);
      Eigen::Matrix<local_scalar_t__,-1,1> sd_2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(M_2, DUMMY_VAR__);
      current_statement__ = 6;
      stan::model::assign(sd_2,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(M_2),
        "assigning variable sd_2");
      out__.write_free_lb(0, sd_2);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> z_2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(M_2,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_2, DUMMY_VAR__));
      current_statement__ = 7;
      for (int sym1__ = 1; sym1__ <= N_2; ++sym1__) {
        current_statement__ = 7;
        for (int sym2__ = 1; sym2__ <= M_2; ++sym2__) {
          current_statement__ = 7;
          stan::model::assign(z_2, in__.read<local_scalar_t__>(),
            "assigning variable z_2", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write(z_2);
      Eigen::Matrix<local_scalar_t__,-1,1> sd_3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(M_3, DUMMY_VAR__);
      current_statement__ = 8;
      stan::model::assign(sd_3,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(M_3),
        "assigning variable sd_3");
      out__.write_free_lb(0, sd_3);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> z_3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(M_3,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_3, DUMMY_VAR__));
      current_statement__ = 9;
      for (int sym1__ = 1; sym1__ <= N_3; ++sym1__) {
        current_statement__ = 9;
        for (int sym2__ = 1; sym2__ <= M_3; ++sym2__) {
          current_statement__ = 9;
          stan::model::assign(z_3, in__.read<local_scalar_t__>(),
            "assigning variable z_3", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write(z_3);
    } 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", "b", "double",
        std::vector<size_t>{static_cast<size_t>(Kc)});
      current_statement__ = 2;
      context__.validate_dims("parameter initialization", "Intercept",
        "double", std::vector<size_t>{});
      current_statement__ = 3;
      context__.validate_dims("parameter initialization", "sigma", "double",
        std::vector<size_t>{});
      current_statement__ = 4;
      context__.validate_dims("parameter initialization", "sd_1", "double",
        std::vector<size_t>{static_cast<size_t>(M_1)});
      current_statement__ = 5;
      context__.validate_dims("parameter initialization", "z_1", "double",
        std::vector<size_t>{static_cast<size_t>(M_1),
          static_cast<size_t>(N_1)});
      current_statement__ = 6;
      context__.validate_dims("parameter initialization", "sd_2", "double",
        std::vector<size_t>{static_cast<size_t>(M_2)});
      current_statement__ = 7;
      context__.validate_dims("parameter initialization", "z_2", "double",
        std::vector<size_t>{static_cast<size_t>(M_2),
          static_cast<size_t>(N_2)});
      current_statement__ = 8;
      context__.validate_dims("parameter initialization", "sd_3", "double",
        std::vector<size_t>{static_cast<size_t>(M_3)});
      current_statement__ = 9;
      context__.validate_dims("parameter initialization", "z_3", "double",
        std::vector<size_t>{static_cast<size_t>(M_3),
          static_cast<size_t>(N_3)});
      int pos__ = std::numeric_limits<int>::min();
      pos__ = 1;
      Eigen::Matrix<local_scalar_t__,-1,1> b =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(Kc, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> b_flat__;
        current_statement__ = 1;
        b_flat__ = context__.vals_r("b");
        current_statement__ = 1;
        pos__ = 1;
        current_statement__ = 1;
        for (int sym1__ = 1; sym1__ <= Kc; ++sym1__) {
          current_statement__ = 1;
          stan::model::assign(b, b_flat__[(pos__ - 1)],
            "assigning variable b", stan::model::index_uni(sym1__));
          current_statement__ = 1;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(b);
      local_scalar_t__ Intercept = DUMMY_VAR__;
      current_statement__ = 2;
      Intercept = context__.vals_r("Intercept")[(1 - 1)];
      out__.write(Intercept);
      local_scalar_t__ sigma = DUMMY_VAR__;
      current_statement__ = 3;
      sigma = context__.vals_r("sigma")[(1 - 1)];
      out__.write_free_lb(0, sigma);
      Eigen::Matrix<local_scalar_t__,-1,1> sd_1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(M_1, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> sd_1_flat__;
        current_statement__ = 4;
        sd_1_flat__ = context__.vals_r("sd_1");
        current_statement__ = 4;
        pos__ = 1;
        current_statement__ = 4;
        for (int sym1__ = 1; sym1__ <= M_1; ++sym1__) {
          current_statement__ = 4;
          stan::model::assign(sd_1, sd_1_flat__[(pos__ - 1)],
            "assigning variable sd_1", stan::model::index_uni(sym1__));
          current_statement__ = 4;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, sd_1);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> z_1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(M_1,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_1, DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> z_1_flat__;
        current_statement__ = 5;
        z_1_flat__ = context__.vals_r("z_1");
        current_statement__ = 5;
        pos__ = 1;
        current_statement__ = 5;
        for (int sym1__ = 1; sym1__ <= N_1; ++sym1__) {
          current_statement__ = 5;
          for (int sym2__ = 1; sym2__ <= M_1; ++sym2__) {
            current_statement__ = 5;
            stan::model::assign(z_1, z_1_flat__[(pos__ - 1)],
              "assigning variable z_1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 5;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write(z_1);
      Eigen::Matrix<local_scalar_t__,-1,1> sd_2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(M_2, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> sd_2_flat__;
        current_statement__ = 6;
        sd_2_flat__ = context__.vals_r("sd_2");
        current_statement__ = 6;
        pos__ = 1;
        current_statement__ = 6;
        for (int sym1__ = 1; sym1__ <= M_2; ++sym1__) {
          current_statement__ = 6;
          stan::model::assign(sd_2, sd_2_flat__[(pos__ - 1)],
            "assigning variable sd_2", stan::model::index_uni(sym1__));
          current_statement__ = 6;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, sd_2);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> z_2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(M_2,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_2, DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> z_2_flat__;
        current_statement__ = 7;
        z_2_flat__ = context__.vals_r("z_2");
        current_statement__ = 7;
        pos__ = 1;
        current_statement__ = 7;
        for (int sym1__ = 1; sym1__ <= N_2; ++sym1__) {
          current_statement__ = 7;
          for (int sym2__ = 1; sym2__ <= M_2; ++sym2__) {
            current_statement__ = 7;
            stan::model::assign(z_2, z_2_flat__[(pos__ - 1)],
              "assigning variable z_2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 7;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write(z_2);
      Eigen::Matrix<local_scalar_t__,-1,1> sd_3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(M_3, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> sd_3_flat__;
        current_statement__ = 8;
        sd_3_flat__ = context__.vals_r("sd_3");
        current_statement__ = 8;
        pos__ = 1;
        current_statement__ = 8;
        for (int sym1__ = 1; sym1__ <= M_3; ++sym1__) {
          current_statement__ = 8;
          stan::model::assign(sd_3, sd_3_flat__[(pos__ - 1)],
            "assigning variable sd_3", stan::model::index_uni(sym1__));
          current_statement__ = 8;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, sd_3);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> z_3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(M_3,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_3, DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> z_3_flat__;
        current_statement__ = 9;
        z_3_flat__ = context__.vals_r("z_3");
        current_statement__ = 9;
        pos__ = 1;
        current_statement__ = 9;
        for (int sym1__ = 1; sym1__ <= N_3; ++sym1__) {
          current_statement__ = 9;
          for (int sym2__ = 1; sym2__ <= M_3; ++sym2__) {
            current_statement__ = 9;
            stan::model::assign(z_3, z_3_flat__[(pos__ - 1)],
              "assigning variable z_3", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 9;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write(z_3);
    } 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>{"b", "Intercept", "sigma", "sd_1",
                "z_1", "sd_2", "z_2", "sd_3", "z_3"};
    if (emit_transformed_parameters__) {
      std::vector<std::string> temp{"r_1_1", "r_2_1", "r_3_1", "lprior"};
      names__.reserve(names__.size() + temp.size());
      names__.insert(names__.end(), temp.begin(), temp.end());
    }
    if (emit_generated_quantities__) {
      std::vector<std::string> temp{"b_Intercept"};
      names__.reserve(names__.size() + temp.size());
      names__.insert(names__.end(), temp.begin(), temp.end());
    }
  }
  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>{static_cast<
                                                                    size_t>(
                                                                    Kc)},
                std::vector<size_t>{}, std::vector<size_t>{},
                std::vector<size_t>{static_cast<size_t>(M_1)},
                std::vector<size_t>{static_cast<size_t>(M_1),
                  static_cast<size_t>(N_1)},
                std::vector<size_t>{static_cast<size_t>(M_2)},
                std::vector<size_t>{static_cast<size_t>(M_2),
                  static_cast<size_t>(N_2)},
                std::vector<size_t>{static_cast<size_t>(M_3)},
                std::vector<size_t>{static_cast<size_t>(M_3),
                  static_cast<size_t>(N_3)}};
    if (emit_transformed_parameters__) {
      std::vector<std::vector<size_t>>
        temp{std::vector<size_t>{static_cast<size_t>(N_1)},
             std::vector<size_t>{static_cast<size_t>(N_2)},
             std::vector<size_t>{static_cast<size_t>(N_3)},
             std::vector<size_t>{}};
      dimss__.reserve(dimss__.size() + temp.size());
      dimss__.insert(dimss__.end(), temp.begin(), temp.end());
    }
    if (emit_generated_quantities__) {
      std::vector<std::vector<size_t>> temp{std::vector<size_t>{}};
      dimss__.reserve(dimss__.size() + temp.size());
      dimss__.insert(dimss__.end(), temp.begin(), temp.end());
    }
  }
  inline void
  constrained_param_names(std::vector<std::string>& param_names__, bool
                          emit_transformed_parameters__ = true, bool
                          emit_generated_quantities__ = true) const final {
    for (int sym1__ = 1; sym1__ <= Kc; ++sym1__) {
      param_names__.emplace_back(std::string() + "b" + '.' +
        std::to_string(sym1__));
    }
    param_names__.emplace_back(std::string() + "Intercept");
    param_names__.emplace_back(std::string() + "sigma");
    for (int sym1__ = 1; sym1__ <= M_1; ++sym1__) {
      param_names__.emplace_back(std::string() + "sd_1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= N_1; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= M_1; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= M_2; ++sym1__) {
      param_names__.emplace_back(std::string() + "sd_2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= N_2; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= M_2; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= M_3; ++sym1__) {
      param_names__.emplace_back(std::string() + "sd_3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= N_3; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= M_3; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_3" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    if (emit_transformed_parameters__) {
      for (int sym1__ = 1; sym1__ <= N_1; ++sym1__) {
        param_names__.emplace_back(std::string() + "r_1_1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= N_2; ++sym1__) {
        param_names__.emplace_back(std::string() + "r_2_1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= N_3; ++sym1__) {
        param_names__.emplace_back(std::string() + "r_3_1" + '.' +
          std::to_string(sym1__));
      }
      param_names__.emplace_back(std::string() + "lprior");
    }
    if (emit_generated_quantities__) {
      param_names__.emplace_back(std::string() + "b_Intercept");
    }
  }
  inline void
  unconstrained_param_names(std::vector<std::string>& param_names__, bool
                            emit_transformed_parameters__ = true, bool
                            emit_generated_quantities__ = true) const final {
    for (int sym1__ = 1; sym1__ <= Kc; ++sym1__) {
      param_names__.emplace_back(std::string() + "b" + '.' +
        std::to_string(sym1__));
    }
    param_names__.emplace_back(std::string() + "Intercept");
    param_names__.emplace_back(std::string() + "sigma");
    for (int sym1__ = 1; sym1__ <= M_1; ++sym1__) {
      param_names__.emplace_back(std::string() + "sd_1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= N_1; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= M_1; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= M_2; ++sym1__) {
      param_names__.emplace_back(std::string() + "sd_2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= N_2; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= M_2; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= M_3; ++sym1__) {
      param_names__.emplace_back(std::string() + "sd_3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= N_3; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= M_3; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_3" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    if (emit_transformed_parameters__) {
      for (int sym1__ = 1; sym1__ <= N_1; ++sym1__) {
        param_names__.emplace_back(std::string() + "r_1_1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= N_2; ++sym1__) {
        param_names__.emplace_back(std::string() + "r_2_1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= N_3; ++sym1__) {
        param_names__.emplace_back(std::string() + "r_3_1" + '.' +
          std::to_string(sym1__));
      }
      param_names__.emplace_back(std::string() + "lprior");
    }
    if (emit_generated_quantities__) {
      param_names__.emplace_back(std::string() + "b_Intercept");
    }
  }
  inline std::string get_constrained_sizedtypes() const {
    return std::string("[{\"name\":\"b\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(Kc) + "},\"block\":\"parameters\"},{\"name\":\"Intercept\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sd_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(M_1) + "},\"block\":\"parameters\"},{\"name\":\"z_1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(M_1) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N_1) + "}},\"block\":\"parameters\"},{\"name\":\"sd_2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(M_2) + "},\"block\":\"parameters\"},{\"name\":\"z_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(M_2) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N_2) + "}},\"block\":\"parameters\"},{\"name\":\"sd_3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(M_3) + "},\"block\":\"parameters\"},{\"name\":\"z_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(M_3) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N_3) + "}},\"block\":\"parameters\"},{\"name\":\"r_1_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"r_2_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N_2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"r_3_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N_3) + "},\"block\":\"transformed_parameters\"},{\"name\":\"lprior\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"b_Intercept\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]");
  }
  inline std::string get_unconstrained_sizedtypes() const {
    return std::string("[{\"name\":\"b\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(Kc) + "},\"block\":\"parameters\"},{\"name\":\"Intercept\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sigma\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"sd_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(M_1) + "},\"block\":\"parameters\"},{\"name\":\"z_1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(M_1) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N_1) + "}},\"block\":\"parameters\"},{\"name\":\"sd_2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(M_2) + "},\"block\":\"parameters\"},{\"name\":\"z_2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(M_2) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N_2) + "}},\"block\":\"parameters\"},{\"name\":\"sd_3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(M_3) + "},\"block\":\"parameters\"},{\"name\":\"z_3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(M_3) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(N_3) + "}},\"block\":\"parameters\"},{\"name\":\"r_1_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N_1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"r_2_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N_2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"r_3_1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(N_3) + "},\"block\":\"transformed_parameters\"},{\"name\":\"lprior\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"b_Intercept\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"}]");
  }
  // 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__ = ((((((((Kc + 1) + 1) + M_1) + (M_1 * N_1)) +
      M_2) + (M_2 * N_2)) + M_3) + (M_3 * N_3));
    const size_t num_transformed = emit_transformed_parameters * ((((N_1 +
      N_2) + N_3) + 1));
    const size_t num_gen_quantities = emit_generated_quantities * (1);
    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__ = ((((((((Kc + 1) + 1) + M_1) + (M_1 * N_1)) +
      M_2) + (M_2 * N_2)) + M_3) + (M_3 * N_3));
    const size_t num_transformed = emit_transformed_parameters * ((((N_1 +
      N_2) + N_3) + 1));
    const size_t num_gen_quantities = emit_generated_quantities * (1);
    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 = model13c946e8d0e60__namespace::model13c946e8d0e60_;
#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 model13c946e8d0e60__namespace::profiles__;
}
#endif
#endif