// Generated by rstantools.  Do not edit by hand.

/*
    rstanarm is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    rstanarm is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with rstanarm.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MODELS_HPP
#define MODELS_HPP
#define STAN__SERVICES__COMMAND_HPP
#ifndef USE_STANC3
#define USE_STANC3
#endif
#include <rstan/rstaninc.hpp>
// Code generated by stanc v2.32.2
#include <stan/model/model_header.hpp>
namespace model_jm_namespace {
using stan::model::model_base_crtp;
using namespace stan::math;
stan::math::profile_map profiles__;
static constexpr std::array<const char*, 2041> locations_array__ =
  {" (found before start of program)",
  " (in 'jm', line 1959, column 2 to line 1960, column 12)",
  " (in 'jm', line 1961, column 2 to line 1962, column 12)",
  " (in 'jm', line 1963, column 2 to line 1964, column 12)",
  " (in 'jm', line 1967, column 2 to column 25)",
  " (in 'jm', line 1968, column 2 to column 25)",
  " (in 'jm', line 1969, column 2 to column 25)",
  " (in 'jm', line 1972, column 2 to column 46)",
  " (in 'jm', line 1973, column 2 to column 52)",
  " (in 'jm', line 1974, column 2 to column 69)",
  " (in 'jm', line 1975, column 2 to column 72)",
  " (in 'jm', line 1976, column 2 to column 55)",
  " (in 'jm', line 1980, column 4 to column 60)",
  " (in 'jm', line 1982, column 4 to column 86)",
  " (in 'jm', line 1984, column 4 to column 82)",
  " (in 'jm', line 1988, column 4 to column 60)",
  " (in 'jm', line 1990, column 4 to column 86)",
  " (in 'jm', line 1992, column 4 to column 82)",
  " (in 'jm', line 1995, column 2 to column 49)",
  " (in 'jm', line 1996, column 2 to column 49)",
  " (in 'jm', line 1997, column 2 to column 49)",
  " (in 'jm', line 2000, column 2 to column 37)",
  " (in 'jm', line 2001, column 2 to column 37)",
  " (in 'jm', line 2002, column 2 to column 37)",
  " (in 'jm', line 2003, column 2 to column 45)",
  " (in 'jm', line 2004, column 2 to column 45)",
  " (in 'jm', line 2005, column 2 to column 45)",
  " (in 'jm', line 2006, column 2 to column 40)",
  " (in 'jm', line 2007, column 2 to column 40)",
  " (in 'jm', line 2008, column 2 to column 40)",
  " (in 'jm', line 2009, column 2 to column 50)",
  " (in 'jm', line 2010, column 2 to column 50)",
  " (in 'jm', line 2011, column 2 to column 50)",
  " (in 'jm', line 2012, column 2 to column 83)",
  " (in 'jm', line 2013, column 2 to column 83)",
  " (in 'jm', line 2014, column 2 to column 83)",
  " (in 'jm', line 2017, column 2 to column 38)",
  " (in 'jm', line 2018, column 2 to column 23)",
  " (in 'jm', line 2024, column 2 to column 89)",
  " (in 'jm', line 2027, column 2 to column 37)",
  " (in 'jm', line 2028, column 2 to column 52)",
  " (in 'jm', line 2029, column 2 to column 39)",
  " (in 'jm', line 2030, column 2 to column 75)",
  " (in 'jm', line 2031, column 2 to column 47)",
  " (in 'jm', line 2034, column 2 to column 23)",
  " (in 'jm', line 2037, column 2 to column 37)",
  " (in 'jm', line 2038, column 2 to column 52)",
  " (in 'jm', line 2039, column 2 to column 39)",
  " (in 'jm', line 2040, column 2 to column 75)",
  " (in 'jm', line 2041, column 2 to column 47)",
  " (in 'jm', line 2044, column 2 to column 21)",
  " (in 'jm', line 2045, column 2 to column 21)",
  " (in 'jm', line 2046, column 2 to column 27)",
  " (in 'jm', line 2051, column 2 to column 23)",
  " (in 'jm', line 2052, column 2 to column 23)",
  " (in 'jm', line 2053, column 2 to column 23)",
  " (in 'jm', line 2054, column 2 to column 31)",
  " (in 'jm', line 2055, column 2 to column 31)",
  " (in 'jm', line 2056, column 2 to column 31)",
  " (in 'jm', line 2057, column 2 to column 30)",
  " (in 'jm', line 2058, column 2 to column 25)",
  " (in 'jm', line 2061, column 2 to column 40)",
  " (in 'jm', line 2062, column 2 to column 40)",
  " (in 'jm', line 2800, column 2 to column 15)",
  " (in 'jm', line 2803, column 2 to column 25)",
  " (in 'jm', line 2804, column 2 to column 44)",
  " (in 'jm', line 2805, column 2 to column 44)",
  " (in 'jm', line 2806, column 2 to column 44)",
  " (in 'jm', line 2807, column 2 to column 73)",
  " (in 'jm', line 2808, column 2 to column 73)",
  " (in 'jm', line 2809, column 2 to column 43)",
  " (in 'jm', line 2810, column 2 to column 43)",
  " (in 'jm', line 2066, column 4 to line 2067, column 75)",
  " (in 'jm', line 2069, column 6 to column 29)",
  " (in 'jm', line 2068, column 4 to line 2069, column 29)",
  " (in 'jm', line 2065, column 23 to line 2070, column 3)",
  " (in 'jm', line 2065, column 2 to line 2070, column 3)",
  " (in 'jm', line 2073, column 4 to line 2076, column 49)",
  " (in 'jm', line 2072, column 2 to line 2076, column 49)",
  " (in 'jm', line 2079, column 6 to line 2080, column 77)",
  " (in 'jm', line 2082, column 8 to column 31)",
  " (in 'jm', line 2081, column 6 to line 2082, column 31)",
  " (in 'jm', line 2078, column 25 to line 2083, column 5)",
  " (in 'jm', line 2078, column 4 to line 2083, column 5)",
  " (in 'jm', line 2085, column 6 to line 2088, column 51)",
  " (in 'jm', line 2084, column 4 to line 2088, column 51)",
  " (in 'jm', line 2077, column 13 to line 2089, column 3)",
  " (in 'jm', line 2077, column 2 to line 2089, column 3)",
  " (in 'jm', line 2092, column 6 to line 2093, column 77)",
  " (in 'jm', line 2095, column 8 to column 31)",
  " (in 'jm', line 2094, column 6 to line 2095, column 31)",
  " (in 'jm', line 2091, column 25 to line 2096, column 5)",
  " (in 'jm', line 2091, column 4 to line 2096, column 5)",
  " (in 'jm', line 2098, column 6 to line 2101, column 51)",
  " (in 'jm', line 2097, column 4 to line 2101, column 51)",
  " (in 'jm', line 2090, column 13 to line 2102, column 3)",
  " (in 'jm', line 2090, column 2 to line 2102, column 3)",
  " (in 'jm', line 2124, column 6 to column 63)",
  " (in 'jm', line 2123, column 9 to line 2124, column 63)",
  " (in 'jm', line 2122, column 6 to column 35)",
  " (in 'jm', line 2121, column 4 to line 2124, column 63)",
  " (in 'jm', line 2129, column 6 to column 63)",
  " (in 'jm', line 2128, column 9 to line 2129, column 63)",
  " (in 'jm', line 2127, column 6 to column 35)",
  " (in 'jm', line 2126, column 4 to line 2129, column 63)",
  " (in 'jm', line 2119, column 36 to line 2130, column 3)",
  " (in 'jm', line 2119, column 7 to line 2130, column 3)",
  " (in 'jm', line 2106, column 4 to column 17)",
  " (in 'jm', line 2108, column 4 to line 2109, column 58)",
  " (in 'jm', line 2112, column 6 to column 51)",
  " (in 'jm', line 2111, column 4 to line 2112, column 51)",
  " (in 'jm', line 2115, column 6 to column 51)",
  " (in 'jm', line 2114, column 4 to line 2115, column 51)",
  " (in 'jm', line 2105, column 31 to line 2116, column 3)",
  " (in 'jm', line 2105, column 2 to line 2130, column 3)",
  " (in 'jm', line 2132, column 2 to line 2135, column 29)",
  " (in 'jm', line 2136, column 2 to line 2139, column 29)",
  " (in 'jm', line 2140, column 2 to line 2141, column 73)",
  " (in 'jm', line 2814, column 4 to column 27)",
  " (in 'jm', line 2815, column 4 to column 27)",
  " (in 'jm', line 2819, column 13 to column 21)",
  " (in 'jm', line 2819, column 6 to line 2823, column 28)",
  " (in 'jm', line 2824, column 6 to column 58)",
  " (in 'jm', line 2818, column 15 to line 2825, column 5)",
  " (in 'jm', line 2818, column 4 to line 2825, column 5)",
  " (in 'jm', line 2829, column 13 to column 21)",
  " (in 'jm', line 2829, column 6 to column 29)",
  " (in 'jm', line 2830, column 6 to column 35)",
  " (in 'jm', line 2831, column 6 to column 35)",
  " (in 'jm', line 2832, column 6 to line 2835, column 46)",
  " (in 'jm', line 2836, column 6 to column 58)",
  " (in 'jm', line 2828, column 15 to line 2837, column 5)",
  " (in 'jm', line 2828, column 4 to line 2837, column 5)",
  " (in 'jm', line 2841, column 13 to column 21)",
  " (in 'jm', line 2841, column 6 to column 29)",
  " (in 'jm', line 2842, column 6 to column 35)",
  " (in 'jm', line 2843, column 6 to column 35)",
  " (in 'jm', line 2844, column 6 to line 2847, column 46)",
  " (in 'jm', line 2848, column 6 to column 58)",
  " (in 'jm', line 2840, column 15 to line 2849, column 5)",
  " (in 'jm', line 2840, column 4 to line 2849, column 5)",
  " (in 'jm', line 2813, column 2 to line 2850, column 3)",
  " (in 'jm', line 2854, column 4 to column 58)",
  " (in 'jm', line 2853, column 4 to line 2854, column 58)",
  " (in 'jm', line 2856, column 4 to column 58)",
  " (in 'jm', line 2855, column 2 to line 2856, column 58)",
  " (in 'jm', line 2858, column 4 to column 58)",
  " (in 'jm', line 2857, column 2 to line 2858, column 58)",
  " (in 'jm', line 2867, column 6 to line 2868, column 73)",
  " (in 'jm', line 2866, column 49 to line 2869, column 5)",
  " (in 'jm', line 2866, column 9 to line 2869, column 5)",
  " (in 'jm', line 2864, column 6 to column 35)",
  " (in 'jm', line 2863, column 45 to line 2865, column 5)",
  " (in 'jm', line 2863, column 4 to line 2869, column 5)",
  " (in 'jm', line 2876, column 6 to line 2877, column 73)",
  " (in 'jm', line 2875, column 49 to line 2878, column 5)",
  " (in 'jm', line 2875, column 9 to line 2878, column 5)",
  " (in 'jm', line 2873, column 6 to column 35)",
  " (in 'jm', line 2872, column 45 to line 2874, column 5)",
  " (in 'jm', line 2872, column 4 to line 2878, column 5)",
  " (in 'jm', line 2884, column 4 to line 2885, column 55)",
  " (in 'jm', line 2881, column 4 to line 2882, column 55)",
  " (in 'jm', line 2880, column 2 to line 2885, column 55)",
  " (in 'jm', line 2146, column 9 to column 17)",
  " (in 'jm', line 2146, column 2 to column 25)",
  " (in 'jm', line 2147, column 9 to column 17)",
  " (in 'jm', line 2147, column 2 to column 25)",
  " (in 'jm', line 2148, column 9 to column 17)",
  " (in 'jm', line 2148, column 2 to column 25)",
  " (in 'jm', line 2152, column 4 to column 27)",
  " (in 'jm', line 2153, column 4 to column 27)",
  " (in 'jm', line 2154, column 4 to line 2155, column 101)",
  " (in 'jm', line 2151, column 13 to line 2156, column 3)",
  " (in 'jm', line 2151, column 2 to line 2156, column 3)",
  " (in 'jm', line 2160, column 4 to column 36)",
  " (in 'jm', line 2161, column 4 to column 36)",
  " (in 'jm', line 2162, column 4 to line 2163, column 101)",
  " (in 'jm', line 2159, column 13 to line 2164, column 3)",
  " (in 'jm', line 2159, column 2 to line 2164, column 3)",
  " (in 'jm', line 2168, column 4 to column 43)",
  " (in 'jm', line 2169, column 4 to column 43)",
  " (in 'jm', line 2170, column 4 to line 2171, column 101)",
  " (in 'jm', line 2167, column 13 to line 2172, column 3)",
  " (in 'jm', line 2167, column 2 to line 2172, column 3)",
  " (in 'jm', line 2176, column 4 to column 102)",
  " (in 'jm', line 2178, column 6 to column 104)",
  " (in 'jm', line 2177, column 4 to line 2178, column 104)",
  " (in 'jm', line 2180, column 6 to column 104)",
  " (in 'jm', line 2179, column 4 to line 2180, column 104)",
  " (in 'jm', line 2175, column 21 to line 2181, column 3)",
  " (in 'jm', line 2175, column 2 to line 2181, column 3)",
  " (in 'jm', line 2184, column 11 to column 20)",
  " (in 'jm', line 2184, column 4 to column 30)",
  " (in 'jm', line 2189, column 6 to column 43)",
  " (in 'jm', line 2187, column 6 to column 30)",
  " (in 'jm', line 2186, column 4 to line 2189, column 43)",
  " (in 'jm', line 2198, column 4 to column 17)",
  " (in 'jm', line 2203, column 4 to column 18)",
  " (in 'jm', line 2206, column 4 to column 18)",
  " (in 'jm', line 2212, column 6 to column 17)",
  " (in 'jm', line 2363, column 8 to column 19)",
  " (in 'jm', line 2362, column 11 to line 2364, column 7)",
  " (in 'jm', line 2220, column 15 to column 27)",
  " (in 'jm', line 2220, column 8 to column 37)",
  " (in 'jm', line 2240, column 10 to column 49)",
  " (in 'jm', line 2241, column 10 to column 49)",
  " (in 'jm', line 2242, column 10 to line 2246, column 67)",
  " (in 'jm', line 2239, column 25 to line 2247, column 9)",
  " (in 'jm', line 2239, column 13 to line 2247, column 9)",
  " (in 'jm', line 2231, column 10 to column 42)",
  " (in 'jm', line 2232, column 10 to column 42)",
  " (in 'jm', line 2233, column 10 to line 2237, column 67)",
  " (in 'jm', line 2230, column 25 to line 2238, column 9)",
  " (in 'jm', line 2230, column 13 to line 2247, column 9)",
  " (in 'jm', line 2222, column 10 to column 33)",
  " (in 'jm', line 2223, column 10 to column 33)",
  " (in 'jm', line 2224, column 10 to line 2228, column 67)",
  " (in 'jm', line 2221, column 20 to line 2229, column 9)",
  " (in 'jm', line 2221, column 8 to line 2247, column 9)",
  " (in 'jm', line 2251, column 17 to column 26)",
  " (in 'jm', line 2251, column 10 to column 32)",
  " (in 'jm', line 2256, column 12 to column 70)",
  " (in 'jm', line 2255, column 15 to line 2257, column 11)",
  " (in 'jm', line 2253, column 12 to column 26)",
  " (in 'jm', line 2252, column 31 to line 2254, column 11)",
  " (in 'jm', line 2252, column 10 to line 2257, column 11)",
  " (in 'jm', line 2258, column 10 to column 20)",
  " (in 'jm', line 2259, column 10 to column 73)",
  " (in 'jm', line 2250, column 33 to line 2260, column 9)",
  " (in 'jm', line 2250, column 8 to line 2260, column 9)",
  " (in 'jm', line 2262, column 10 to column 34)",
  " (in 'jm', line 2263, column 10 to column 70)",
  " (in 'jm', line 2265, column 19 to column 28)",
  " (in 'jm', line 2265, column 12 to column 34)",
  " (in 'jm', line 2266, column 12 to column 34)",
  " (in 'jm', line 2271, column 14 to line 2273, column 36)",
  " (in 'jm', line 2270, column 17 to line 2274, column 13)",
  " (in 'jm', line 2268, column 14 to column 69)",
  " (in 'jm', line 2267, column 33 to line 2269, column 13)",
  " (in 'jm', line 2267, column 12 to line 2274, column 13)",
  " (in 'jm', line 2275, column 12 to column 22)",
  " (in 'jm', line 2276, column 12 to column 75)",
  " (in 'jm', line 2264, column 25 to line 2277, column 11)",
  " (in 'jm', line 2264, column 10 to line 2277, column 11)",
  " (in 'jm', line 2261, column 33 to line 2278, column 9)",
  " (in 'jm', line 2261, column 8 to line 2278, column 9)",
  " (in 'jm', line 2279, column 8 to column 19)",
  " (in 'jm', line 2282, column 12 to column 87)",
  " (in 'jm', line 2283, column 12 to column 52)",
  " (in 'jm', line 2284, column 19 to column 28)",
  " (in 'jm', line 2284, column 12 to column 34)",
  " (in 'jm', line 2286, column 19 to column 33)",
  " (in 'jm', line 2286, column 12 to column 44)",
  " (in 'jm', line 2306, column 14 to column 53)",
  " (in 'jm', line 2307, column 14 to column 53)",
  " (in 'jm', line 2308, column 14 to line 2312, column 72)",
  " (in 'jm', line 2305, column 31 to line 2313, column 13)",
  " (in 'jm', line 2305, column 17 to line 2313, column 13)",
  " (in 'jm', line 2297, column 14 to column 46)",
  " (in 'jm', line 2298, column 14 to column 46)",
  " (in 'jm', line 2299, column 14 to line 2303, column 72)",
  " (in 'jm', line 2296, column 31 to line 2304, column 13)",
  " (in 'jm', line 2296, column 17 to line 2313, column 13)",
  " (in 'jm', line 2288, column 14 to column 37)",
  " (in 'jm', line 2289, column 14 to column 37)",
  " (in 'jm', line 2290, column 14 to line 2294, column 72)",
  " (in 'jm', line 2287, column 26 to line 2295, column 13)",
  " (in 'jm', line 2287, column 12 to line 2313, column 13)",
  " (in 'jm', line 2314, column 12 to column 38)",
  " (in 'jm', line 2315, column 12 to column 22)",
  " (in 'jm', line 2316, column 12 to column 75)",
  " (in 'jm', line 2281, column 54 to line 2317, column 11)",
  " (in 'jm', line 2281, column 10 to line 2317, column 11)",
  " (in 'jm', line 2280, column 34 to line 2318, column 9)",
  " (in 'jm', line 2280, column 8 to line 2318, column 9)",
  " (in 'jm', line 2319, column 8 to column 19)",
  " (in 'jm', line 2322, column 12 to column 87)",
  " (in 'jm', line 2323, column 12 to column 52)",
  " (in 'jm', line 2324, column 19 to column 28)",
  " (in 'jm', line 2324, column 12 to column 34)",
  " (in 'jm', line 2325, column 19 to column 33)",
  " (in 'jm', line 2325, column 12 to column 43)",
  " (in 'jm', line 2327, column 19 to column 33)",
  " (in 'jm', line 2327, column 12 to column 44)",
  " (in 'jm', line 2347, column 14 to column 53)",
  " (in 'jm', line 2348, column 14 to column 53)",
  " (in 'jm', line 2349, column 14 to line 2353, column 72)",
  " (in 'jm', line 2346, column 31 to line 2354, column 13)",
  " (in 'jm', line 2346, column 17 to line 2354, column 13)",
  " (in 'jm', line 2338, column 14 to column 46)",
  " (in 'jm', line 2339, column 14 to column 46)",
  " (in 'jm', line 2340, column 14 to line 2344, column 72)",
  " (in 'jm', line 2337, column 31 to line 2345, column 13)",
  " (in 'jm', line 2337, column 17 to line 2354, column 13)",
  " (in 'jm', line 2329, column 14 to column 37)",
  " (in 'jm', line 2330, column 14 to column 37)",
  " (in 'jm', line 2331, column 14 to line 2335, column 72)",
  " (in 'jm', line 2328, column 26 to line 2336, column 13)",
  " (in 'jm', line 2328, column 12 to line 2354, column 13)",
  " (in 'jm', line 2355, column 12 to column 68)",
  " (in 'jm', line 2356, column 12 to column 37)",
  " (in 'jm', line 2357, column 12 to column 22)",
  " (in 'jm', line 2358, column 12 to column 75)",
  " (in 'jm', line 2321, column 54 to line 2359, column 11)",
  " (in 'jm', line 2321, column 10 to line 2359, column 11)",
  " (in 'jm', line 2320, column 34 to line 2360, column 9)",
  " (in 'jm', line 2320, column 8 to line 2360, column 9)",
  " (in 'jm', line 2216, column 32 to line 2361, column 7)",
  " (in 'jm', line 2213, column 6 to line 2364, column 7)",
  " (in 'jm', line 2368, column 6 to column 17)",
  " (in 'jm', line 2372, column 15 to column 27)",
  " (in 'jm', line 2372, column 8 to column 40)",
  " (in 'jm', line 2392, column 10 to column 49)",
  " (in 'jm', line 2393, column 10 to column 49)",
  " (in 'jm', line 2394, column 10 to line 2398, column 61)",
  " (in 'jm', line 2391, column 25 to line 2399, column 9)",
  " (in 'jm', line 2391, column 13 to line 2399, column 9)",
  " (in 'jm', line 2383, column 10 to column 42)",
  " (in 'jm', line 2384, column 10 to column 42)",
  " (in 'jm', line 2385, column 10 to line 2389, column 61)",
  " (in 'jm', line 2382, column 25 to line 2390, column 9)",
  " (in 'jm', line 2382, column 13 to line 2399, column 9)",
  " (in 'jm', line 2374, column 10 to column 33)",
  " (in 'jm', line 2375, column 10 to column 33)",
  " (in 'jm', line 2376, column 10 to line 2380, column 61)",
  " (in 'jm', line 2373, column 20 to line 2381, column 9)",
  " (in 'jm', line 2373, column 8 to line 2399, column 9)",
  " (in 'jm', line 2403, column 17 to column 26)",
  " (in 'jm', line 2403, column 10 to column 32)",
  " (in 'jm', line 2408, column 12 to column 73)",
  " (in 'jm', line 2407, column 15 to line 2409, column 11)",
  " (in 'jm', line 2405, column 12 to column 29)",
  " (in 'jm', line 2404, column 31 to line 2406, column 11)",
  " (in 'jm', line 2404, column 10 to line 2409, column 11)",
  " (in 'jm', line 2410, column 10 to column 20)",
  " (in 'jm', line 2411, column 10 to column 73)",
  " (in 'jm', line 2402, column 33 to line 2412, column 9)",
  " (in 'jm', line 2402, column 8 to line 2412, column 9)",
  " (in 'jm', line 2414, column 10 to column 34)",
  " (in 'jm', line 2415, column 10 to column 70)",
  " (in 'jm', line 2417, column 19 to column 28)",
  " (in 'jm', line 2417, column 12 to column 34)",
  " (in 'jm', line 2418, column 12 to column 34)",
  " (in 'jm', line 2423, column 14 to line 2425, column 42)",
  " (in 'jm', line 2422, column 17 to line 2426, column 13)",
  " (in 'jm', line 2420, column 14 to column 72)",
  " (in 'jm', line 2419, column 33 to line 2421, column 13)",
  " (in 'jm', line 2419, column 12 to line 2426, column 13)",
  " (in 'jm', line 2427, column 12 to column 22)",
  " (in 'jm', line 2428, column 12 to column 75)",
  " (in 'jm', line 2416, column 25 to line 2429, column 11)",
  " (in 'jm', line 2416, column 10 to line 2429, column 11)",
  " (in 'jm', line 2413, column 34 to line 2430, column 9)",
  " (in 'jm', line 2413, column 8 to line 2430, column 9)",
  " (in 'jm', line 2369, column 59 to line 2431, column 7)",
  " (in 'jm', line 2369, column 6 to line 2431, column 7)",
  " (in 'jm', line 2437, column 15 to column 28)",
  " (in 'jm', line 2437, column 8 to column 42)",
  " (in 'jm', line 2438, column 15 to column 27)",
  " (in 'jm', line 2438, column 8 to column 33)",
  " (in 'jm', line 2458, column 10 to column 49)",
  " (in 'jm', line 2459, column 10 to column 49)",
  " (in 'jm', line 2460, column 10 to line 2464, column 71)",
  " (in 'jm', line 2457, column 25 to line 2465, column 9)",
  " (in 'jm', line 2457, column 13 to line 2465, column 9)",
  " (in 'jm', line 2449, column 10 to column 42)",
  " (in 'jm', line 2450, column 10 to column 42)",
  " (in 'jm', line 2451, column 10 to line 2455, column 71)",
  " (in 'jm', line 2448, column 25 to line 2456, column 9)",
  " (in 'jm', line 2448, column 13 to line 2465, column 9)",
  " (in 'jm', line 2440, column 10 to column 33)",
  " (in 'jm', line 2441, column 10 to column 33)",
  " (in 'jm', line 2442, column 10 to line 2446, column 71)",
  " (in 'jm', line 2439, column 20 to line 2447, column 9)",
  " (in 'jm', line 2439, column 8 to line 2465, column 9)",
  " (in 'jm', line 2466, column 8 to column 18)",
  " (in 'jm', line 2468, column 17 to column 27)",
  " (in 'jm', line 2468, column 10 to column 37)",
  " (in 'jm', line 2469, column 17 to column 27)",
  " (in 'jm', line 2469, column 10 to column 37)",
  " (in 'jm', line 2470, column 10 to column 75)",
  " (in 'jm', line 2471, column 10 to column 72)",
  " (in 'jm', line 2472, column 10 to column 43)",
  " (in 'jm', line 2467, column 34 to line 2473, column 9)",
  " (in 'jm', line 2467, column 8 to line 2473, column 9)",
  " (in 'jm', line 2474, column 8 to column 71)",
  " (in 'jm', line 2436, column 31 to line 2475, column 7)",
  " (in 'jm', line 2436, column 6 to line 2475, column 7)",
  " (in 'jm', line 2479, column 6 to column 17)",
  " (in 'jm', line 2632, column 8 to column 19)",
  " (in 'jm', line 2631, column 11 to line 2633, column 7)",
  " (in 'jm', line 2486, column 15 to column 27)",
  " (in 'jm', line 2486, column 8 to column 36)",
  " (in 'jm', line 2488, column 15 to column 27)",
  " (in 'jm', line 2488, column 8 to column 37)",
  " (in 'jm', line 2508, column 10 to column 49)",
  " (in 'jm', line 2509, column 10 to column 49)",
  " (in 'jm', line 2510, column 10 to line 2514, column 67)",
  " (in 'jm', line 2507, column 25 to line 2515, column 9)",
  " (in 'jm', line 2507, column 13 to line 2515, column 9)",
  " (in 'jm', line 2499, column 10 to column 42)",
  " (in 'jm', line 2500, column 10 to column 42)",
  " (in 'jm', line 2501, column 10 to line 2505, column 67)",
  " (in 'jm', line 2498, column 25 to line 2506, column 9)",
  " (in 'jm', line 2498, column 13 to line 2515, column 9)",
  " (in 'jm', line 2490, column 10 to column 33)",
  " (in 'jm', line 2491, column 10 to column 33)",
  " (in 'jm', line 2492, column 10 to line 2496, column 67)",
  " (in 'jm', line 2489, column 20 to line 2497, column 9)",
  " (in 'jm', line 2489, column 8 to line 2515, column 9)",
  " (in 'jm', line 2516, column 8 to column 58)",
  " (in 'jm', line 2520, column 17 to column 26)",
  " (in 'jm', line 2520, column 10 to column 32)",
  " (in 'jm', line 2525, column 12 to column 69)",
  " (in 'jm', line 2524, column 15 to line 2526, column 11)",
  " (in 'jm', line 2522, column 12 to column 25)",
  " (in 'jm', line 2521, column 31 to line 2523, column 11)",
  " (in 'jm', line 2521, column 10 to line 2526, column 11)",
  " (in 'jm', line 2527, column 10 to column 20)",
  " (in 'jm', line 2528, column 10 to column 73)",
  " (in 'jm', line 2519, column 33 to line 2529, column 9)",
  " (in 'jm', line 2519, column 8 to line 2529, column 9)",
  " (in 'jm', line 2531, column 10 to column 36)",
  " (in 'jm', line 2532, column 10 to column 70)",
  " (in 'jm', line 2534, column 19 to column 28)",
  " (in 'jm', line 2534, column 12 to column 34)",
  " (in 'jm', line 2535, column 12 to column 34)",
  " (in 'jm', line 2540, column 14 to line 2542, column 36)",
  " (in 'jm', line 2539, column 17 to line 2543, column 13)",
  " (in 'jm', line 2537, column 14 to column 68)",
  " (in 'jm', line 2536, column 33 to line 2538, column 13)",
  " (in 'jm', line 2536, column 12 to line 2543, column 13)",
  " (in 'jm', line 2544, column 12 to column 22)",
  " (in 'jm', line 2545, column 12 to column 75)",
  " (in 'jm', line 2533, column 27 to line 2546, column 11)",
  " (in 'jm', line 2533, column 10 to line 2546, column 11)",
  " (in 'jm', line 2530, column 34 to line 2547, column 9)",
  " (in 'jm', line 2530, column 8 to line 2547, column 9)",
  " (in 'jm', line 2548, column 8 to column 19)",
  " (in 'jm', line 2551, column 12 to column 87)",
  " (in 'jm', line 2552, column 12 to column 52)",
  " (in 'jm', line 2553, column 19 to column 28)",
  " (in 'jm', line 2553, column 12 to column 34)",
  " (in 'jm', line 2555, column 19 to column 33)",
  " (in 'jm', line 2555, column 12 to column 44)",
  " (in 'jm', line 2575, column 14 to column 53)",
  " (in 'jm', line 2576, column 14 to column 53)",
  " (in 'jm', line 2577, column 14 to line 2581, column 72)",
  " (in 'jm', line 2574, column 31 to line 2582, column 13)",
  " (in 'jm', line 2574, column 17 to line 2582, column 13)",
  " (in 'jm', line 2566, column 14 to column 46)",
  " (in 'jm', line 2567, column 14 to column 46)",
  " (in 'jm', line 2568, column 14 to line 2572, column 72)",
  " (in 'jm', line 2565, column 31 to line 2573, column 13)",
  " (in 'jm', line 2565, column 17 to line 2582, column 13)",
  " (in 'jm', line 2557, column 14 to column 37)",
  " (in 'jm', line 2558, column 14 to column 37)",
  " (in 'jm', line 2559, column 14 to line 2563, column 72)",
  " (in 'jm', line 2556, column 26 to line 2564, column 13)",
  " (in 'jm', line 2556, column 12 to line 2582, column 13)",
  " (in 'jm', line 2583, column 12 to column 37)",
  " (in 'jm', line 2584, column 12 to column 22)",
  " (in 'jm', line 2585, column 12 to column 75)",
  " (in 'jm', line 2550, column 54 to line 2586, column 11)",
  " (in 'jm', line 2550, column 10 to line 2586, column 11)",
  " (in 'jm', line 2549, column 34 to line 2587, column 9)",
  " (in 'jm', line 2549, column 8 to line 2587, column 9)",
  " (in 'jm', line 2588, column 8 to column 19)",
  " (in 'jm', line 2591, column 12 to column 87)",
  " (in 'jm', line 2592, column 12 to column 52)",
  " (in 'jm', line 2593, column 19 to column 28)",
  " (in 'jm', line 2593, column 12 to column 34)",
  " (in 'jm', line 2594, column 19 to column 33)",
  " (in 'jm', line 2594, column 12 to column 43)",
  " (in 'jm', line 2596, column 19 to column 33)",
  " (in 'jm', line 2596, column 12 to column 44)",
  " (in 'jm', line 2616, column 14 to column 53)",
  " (in 'jm', line 2617, column 14 to column 53)",
  " (in 'jm', line 2618, column 14 to line 2622, column 72)",
  " (in 'jm', line 2615, column 31 to line 2623, column 13)",
  " (in 'jm', line 2615, column 17 to line 2623, column 13)",
  " (in 'jm', line 2607, column 14 to column 46)",
  " (in 'jm', line 2608, column 14 to column 46)",
  " (in 'jm', line 2609, column 14 to line 2613, column 72)",
  " (in 'jm', line 2606, column 31 to line 2614, column 13)",
  " (in 'jm', line 2606, column 17 to line 2623, column 13)",
  " (in 'jm', line 2598, column 14 to column 37)",
  " (in 'jm', line 2599, column 14 to column 37)",
  " (in 'jm', line 2600, column 14 to line 2604, column 72)",
  " (in 'jm', line 2597, column 26 to line 2605, column 13)",
  " (in 'jm', line 2597, column 12 to line 2623, column 13)",
  " (in 'jm', line 2624, column 12 to column 68)",
  " (in 'jm', line 2625, column 12 to column 36)",
  " (in 'jm', line 2626, column 12 to column 22)",
  " (in 'jm', line 2627, column 12 to column 75)",
  " (in 'jm', line 2590, column 54 to line 2628, column 11)",
  " (in 'jm', line 2590, column 10 to line 2628, column 11)",
  " (in 'jm', line 2589, column 34 to line 2629, column 9)",
  " (in 'jm', line 2589, column 8 to line 2629, column 9)",
  " (in 'jm', line 2483, column 32 to line 2630, column 7)",
  " (in 'jm', line 2480, column 6 to line 2633, column 7)",
  " (in 'jm', line 2637, column 6 to column 17)",
  " (in 'jm', line 2639, column 8 to column 66)",
  " (in 'jm', line 2638, column 55 to line 2640, column 7)",
  " (in 'jm', line 2638, column 6 to line 2640, column 7)",
  " (in 'jm', line 2646, column 15 to column 28)",
  " (in 'jm', line 2646, column 8 to column 42)",
  " (in 'jm', line 2647, column 15 to column 28)",
  " (in 'jm', line 2647, column 8 to column 41)",
  " (in 'jm', line 2648, column 15 to column 27)",
  " (in 'jm', line 2648, column 8 to column 33)",
  " (in 'jm', line 2668, column 10 to column 49)",
  " (in 'jm', line 2669, column 10 to column 49)",
  " (in 'jm', line 2670, column 10 to line 2674, column 71)",
  " (in 'jm', line 2667, column 25 to line 2675, column 9)",
  " (in 'jm', line 2667, column 13 to line 2675, column 9)",
  " (in 'jm', line 2659, column 10 to column 42)",
  " (in 'jm', line 2660, column 10 to column 42)",
  " (in 'jm', line 2661, column 10 to line 2665, column 71)",
  " (in 'jm', line 2658, column 25 to line 2666, column 9)",
  " (in 'jm', line 2658, column 13 to line 2675, column 9)",
  " (in 'jm', line 2650, column 10 to column 33)",
  " (in 'jm', line 2651, column 10 to column 33)",
  " (in 'jm', line 2652, column 10 to line 2656, column 71)",
  " (in 'jm', line 2649, column 20 to line 2657, column 9)",
  " (in 'jm', line 2649, column 8 to line 2675, column 9)",
  " (in 'jm', line 2676, column 8 to column 66)",
  " (in 'jm', line 2677, column 8 to column 18)",
  " (in 'jm', line 2679, column 17 to column 27)",
  " (in 'jm', line 2679, column 10 to column 37)",
  " (in 'jm', line 2680, column 17 to column 27)",
  " (in 'jm', line 2680, column 10 to column 37)",
  " (in 'jm', line 2681, column 10 to column 74)",
  " (in 'jm', line 2682, column 10 to column 72)",
  " (in 'jm', line 2683, column 10 to column 43)",
  " (in 'jm', line 2678, column 34 to line 2684, column 9)",
  " (in 'jm', line 2678, column 8 to line 2684, column 9)",
  " (in 'jm', line 2685, column 8 to column 71)",
  " (in 'jm', line 2645, column 31 to line 2686, column 7)",
  " (in 'jm', line 2645, column 6 to line 2686, column 7)",
  " (in 'jm', line 2208, column 19 to line 2688, column 5)",
  " (in 'jm', line 2208, column 4 to line 2688, column 5)",
  " (in 'jm', line 2693, column 6 to column 43)",
  " (in 'jm', line 2692, column 30 to line 2694, column 5)",
  " (in 'jm', line 2692, column 4 to line 2694, column 5)",
  " (in 'jm', line 2696, column 6 to column 46)",
  " (in 'jm', line 2695, column 33 to line 2697, column 5)",
  " (in 'jm', line 2695, column 4 to line 2697, column 5)",
  " (in 'jm', line 2190, column 20 to line 2698, column 5)",
  " (in 'jm', line 2190, column 4 to line 2698, column 5)",
  " (in 'jm', line 2703, column 9 to column 18)",
  " (in 'jm', line 2703, column 2 to column 32)",
  " (in 'jm', line 2704, column 9 to column 18)",
  " (in 'jm', line 2704, column 2 to column 30)",
  " (in 'jm', line 2705, column 9 to column 16)",
  " (in 'jm', line 2705, column 2 to column 33)",
  " (in 'jm', line 2706, column 9 to column 26)",
  " (in 'jm', line 2706, column 2 to column 43)",
  " (in 'jm', line 2711, column 7 to column 52)",
  " (in 'jm', line 2710, column 4 to column 84)",
  " (in 'jm', line 2709, column 2 to line 2711, column 52)",
  " (in 'jm', line 2714, column 2 to column 36)",
  " (in 'jm', line 2715, column 2 to column 44)",
  " (in 'jm', line 2716, column 2 to column 54)",
  " (in 'jm', line 2724, column 4 to line 2725, column 62)",
  " (in 'jm', line 2723, column 26 to line 2726, column 3)",
  " (in 'jm', line 2723, column 7 to line 2726, column 3)",
  " (in 'jm', line 2720, column 4 to line 2721, column 42)",
  " (in 'jm', line 2719, column 41 to line 2722, column 3)",
  " (in 'jm', line 2719, column 2 to line 2726, column 3)",
  " (in 'jm', line 2699, column 4 to line 2727, column 5)",
  " (in 'jm', line 2182, column 2 to line 2728, column 3)",
  " (in 'jm', line 2734, column 4 to line 2735, column 60)",
  " (in 'jm', line 2733, column 2 to line 2735, column 60)",
  " (in 'jm', line 2737, column 4 to line 2738, column 60)",
  " (in 'jm', line 2736, column 2 to line 2738, column 60)",
  " (in 'jm', line 2740, column 4 to line 2741, column 60)",
  " (in 'jm', line 2739, column 2 to line 2741, column 60)",
  " (in 'jm', line 2745, column 4 to line 2746, column 74)",
  " (in 'jm', line 2744, column 2 to line 2746, column 74)",
  " (in 'jm', line 2748, column 4 to line 2749, column 74)",
  " (in 'jm', line 2747, column 2 to line 2749, column 74)",
  " (in 'jm', line 2751, column 3 to line 2752, column 74)",
  " (in 'jm', line 2750, column 2 to line 2752, column 74)",
  " (in 'jm', line 2756, column 4 to line 2758, column 35)",
  " (in 'jm', line 2755, column 2 to line 2758, column 35)",
  " (in 'jm', line 2760, column 4 to line 2762, column 35)",
  " (in 'jm', line 2759, column 2 to line 2762, column 35)",
  " (in 'jm', line 2764, column 4 to line 2766, column 35)",
  " (in 'jm', line 2763, column 2 to line 2766, column 35)",
  " (in 'jm', line 2776, column 6 to column 70)",
  " (in 'jm', line 2778, column 6 to column 55)",
  " (in 'jm', line 2781, column 8 to column 79)",
  " (in 'jm', line 2780, column 6 to line 2781, column 79)",
  " (in 'jm', line 2774, column 17 to line 2782, column 5)",
  " (in 'jm', line 2774, column 4 to line 2782, column 5)",
  " (in 'jm', line 2785, column 6 to column 70)",
  " (in 'jm', line 2787, column 6 to column 55)",
  " (in 'jm', line 2790, column 8 to column 79)",
  " (in 'jm', line 2789, column 6 to line 2790, column 79)",
  " (in 'jm', line 2783, column 17 to line 2791, column 5)",
  " (in 'jm', line 2783, column 4 to line 2791, column 5)",
  " (in 'jm', line 2773, column 36 to line 2792, column 3)",
  " (in 'jm', line 2773, column 7 to line 2792, column 3)",
  " (in 'jm', line 2770, column 4 to line 2771, column 54)",
  " (in 'jm', line 2769, column 31 to line 2772, column 3)",
  " (in 'jm', line 2769, column 2 to line 2792, column 3)",
  " (in 'jm', line 2793, column 2 to column 152)",
  " (in 'jm', line 2794, column 2 to column 152)",
  " (in 'jm', line 2795, column 2 to column 107)",
  " (in 'jm', line 2797, column 4 to column 156)",
  " (in 'jm', line 2796, column 2 to line 2797, column 156)",
  " (in 'jm', line 1517, column 2 to column 25)",
  " (in 'jm', line 1518, column 2 to column 40)",
  " (in 'jm', line 1519, column 2 to column 35)",
  " (in 'jm', line 1520, column 2 to column 42)",
  " (in 'jm', line 1521, column 2 to column 47)",
  " (in 'jm', line 1522, column 2 to column 30)",
  " (in 'jm', line 1523, column 2 to column 30)",
  " (in 'jm', line 1524, column 2 to column 27)",
  " (in 'jm', line 1527, column 2 to column 17)",
  " (in 'jm', line 1528, column 8 to column 9)",
  " (in 'jm', line 1528, column 2 to column 26)",
  " (in 'jm', line 1529, column 8 to column 9)",
  " (in 'jm', line 1529, column 2 to column 26)",
  " (in 'jm', line 1530, column 2 to column 17)",
  " (in 'jm', line 1531, column 2 to column 27)",
  " (in 'jm', line 1536, column 4 to column 21)",
  " (in 'jm', line 1537, column 4 to column 21)",
  " (in 'jm', line 1538, column 4 to column 34)",
  " (in 'jm', line 1539, column 4 to column 36)",
  " (in 'jm', line 1542, column 4 to column 21)",
  " (in 'jm', line 1543, column 4 to column 21)",
  " (in 'jm', line 1544, column 4 to column 34)",
  " (in 'jm', line 1545, column 4 to column 36)",
  " (in 'jm', line 1551, column 8 to column 40)",
  " (in 'jm', line 1551, column 2 to column 61)",
  " (in 'jm', line 1552, column 8 to column 40)",
  " (in 'jm', line 1552, column 2 to column 61)",
  " (in 'jm', line 1553, column 8 to column 40)",
  " (in 'jm', line 1553, column 2 to column 61)",
  " (in 'jm', line 1554, column 9 to column 41)",
  " (in 'jm', line 1554, column 2 to column 50)",
  " (in 'jm', line 1555, column 9 to column 41)",
  " (in 'jm', line 1555, column 2 to column 50)",
  " (in 'jm', line 1556, column 9 to column 41)",
  " (in 'jm', line 1556, column 2 to column 50)",
  " (in 'jm', line 1557, column 9 to column 17)",
  " (in 'jm', line 1557, column 18 to column 23)",
  " (in 'jm', line 1557, column 2 to column 29)",
  " (in 'jm', line 1558, column 9 to column 17)",
  " (in 'jm', line 1558, column 18 to column 23)",
  " (in 'jm', line 1558, column 2 to column 29)",
  " (in 'jm', line 1559, column 9 to column 17)",
  " (in 'jm', line 1559, column 18 to column 23)",
  " (in 'jm', line 1559, column 2 to column 29)",
  " (in 'jm', line 1560, column 9 to column 14)",
  " (in 'jm', line 1560, column 2 to column 23)",
  " (in 'jm', line 1561, column 9 to column 14)",
  " (in 'jm', line 1561, column 2 to column 23)",
  " (in 'jm', line 1562, column 9 to column 14)",
  " (in 'jm', line 1562, column 2 to column 23)",
  " (in 'jm', line 1572, column 8 to column 9)",
  " (in 'jm', line 1572, column 2 to column 31)",
  " (in 'jm', line 1573, column 8 to column 9)",
  " (in 'jm', line 1573, column 2 to column 29)",
  " (in 'jm', line 1576, column 8 to column 18)",
  " (in 'jm', line 1576, column 27 to column 56)",
  " (in 'jm', line 1576, column 2 to column 64)",
  " (in 'jm', line 1577, column 8 to column 18)",
  " (in 'jm', line 1577, column 27 to column 56)",
  " (in 'jm', line 1577, column 2 to column 64)",
  " (in 'jm', line 1578, column 8 to column 18)",
  " (in 'jm', line 1578, column 27 to column 56)",
  " (in 'jm', line 1578, column 2 to column 64)",
  " (in 'jm', line 1579, column 8 to column 37)",
  " (in 'jm', line 1579, column 2 to column 61)",
  " (in 'jm', line 1580, column 8 to column 37)",
  " (in 'jm', line 1580, column 2 to column 61)",
  " (in 'jm', line 1581, column 8 to column 37)",
  " (in 'jm', line 1581, column 2 to column 61)",
  " (in 'jm', line 1584, column 8 to column 18)",
  " (in 'jm', line 1584, column 27 to column 56)",
  " (in 'jm', line 1584, column 2 to column 64)",
  " (in 'jm', line 1585, column 8 to column 18)",
  " (in 'jm', line 1585, column 27 to column 56)",
  " (in 'jm', line 1585, column 2 to column 64)",
  " (in 'jm', line 1586, column 8 to column 18)",
  " (in 'jm', line 1586, column 27 to column 56)",
  " (in 'jm', line 1586, column 2 to column 64)",
  " (in 'jm', line 1587, column 8 to column 37)",
  " (in 'jm', line 1587, column 2 to column 61)",
  " (in 'jm', line 1588, column 8 to column 37)",
  " (in 'jm', line 1588, column 2 to column 61)",
  " (in 'jm', line 1589, column 8 to column 37)",
  " (in 'jm', line 1589, column 2 to column 61)",
  " (in 'jm', line 1593, column 2 to column 45)",
  " (in 'jm', line 1594, column 8 to column 9)",
  " (in 'jm', line 1594, column 2 to column 59)",
  " (in 'jm', line 1597, column 8 to column 9)",
  " (in 'jm', line 1597, column 2 to column 53)",
  " (in 'jm', line 1600, column 2 to column 42)",
  " (in 'jm', line 1603, column 2 to column 32)",
  " (in 'jm', line 1606, column 2 to column 43)",
  " (in 'jm', line 1607, column 9 to column 37)",
  " (in 'jm', line 1607, column 2 to column 49)",
  " (in 'jm', line 1608, column 9 to column 37)",
  " (in 'jm', line 1608, column 2 to column 49)",
  " (in 'jm', line 1609, column 9 to column 37)",
  " (in 'jm', line 1609, column 2 to column 49)",
  " (in 'jm', line 1617, column 2 to column 36)",
  " (in 'jm', line 1618, column 2 to column 50)",
  " (in 'jm', line 1621, column 2 to column 44)",
  " (in 'jm', line 1624, column 2 to column 18)",
  " (in 'jm', line 1625, column 2 to column 19)",
  " (in 'jm', line 1626, column 2 to column 20)",
  " (in 'jm', line 1627, column 2 to column 23)",
  " (in 'jm', line 1628, column 2 to column 22)",
  " (in 'jm', line 1629, column 2 to column 33)",
  " (in 'jm', line 1630, column 2 to column 36)",
  " (in 'jm', line 1631, column 2 to column 26)",
  " (in 'jm', line 1632, column 2 to column 39)",
  " (in 'jm', line 1633, column 2 to column 25)",
  " (in 'jm', line 1634, column 9 to column 32)",
  " (in 'jm', line 1634, column 34 to column 37)",
  " (in 'jm', line 1634, column 2 to column 44)",
  " (in 'jm', line 1635, column 9 to column 18)",
  " (in 'jm', line 1635, column 2 to column 28)",
  " (in 'jm', line 1636, column 9 to column 18)",
  " (in 'jm', line 1636, column 19 to column 29)",
  " (in 'jm', line 1636, column 2 to column 41)",
  " (in 'jm', line 1637, column 9 to column 12)",
  " (in 'jm', line 1637, column 2 to column 21)",
  " (in 'jm', line 1638, column 9 to column 13)",
  " (in 'jm', line 1638, column 2 to column 25)",
  " (in 'jm', line 1639, column 9 to column 26)",
  " (in 'jm', line 1639, column 2 to column 42)",
  " (in 'jm', line 1640, column 9 to column 26)",
  " (in 'jm', line 1640, column 2 to column 33)",
  " (in 'jm', line 1651, column 2 to column 36)",
  " (in 'jm', line 1656, column 4 to column 21)",
  " (in 'jm', line 1659, column 11 to column 14)",
  " (in 'jm', line 1659, column 4 to column 23)",
  " (in 'jm', line 1662, column 11 to column 14)",
  " (in 'jm', line 1662, column 4 to column 24)",
  " (in 'jm', line 1665, column 4 to column 31)",
  " (in 'jm', line 1668, column 4 to column 47)",
  " (in 'jm', line 1671, column 13 to column 14)",
  " (in 'jm', line 1671, column 4 to column 47)",
  " (in 'jm', line 1674, column 4 to column 34)",
  " (in 'jm', line 1677, column 10 to column 11)",
  " (in 'jm', line 1677, column 4 to column 39)",
  " (in 'jm', line 1680, column 10 to column 26)",
  " (in 'jm', line 1680, column 4 to column 56)",
  " (in 'jm', line 1683, column 4 to column 37)",
  " (in 'jm', line 1686, column 10 to column 11)",
  " (in 'jm', line 1686, column 4 to column 42)",
  " (in 'jm', line 1689, column 10 to column 29)",
  " (in 'jm', line 1689, column 4 to column 62)",
  " (in 'jm', line 1692, column 10 to column 29)",
  " (in 'jm', line 1692, column 4 to column 62)",
  " (in 'jm', line 1695, column 4 to column 45)",
  " (in 'jm', line 1699, column 10 to column 13)",
  " (in 'jm', line 1699, column 4 to column 86)",
  " (in 'jm', line 1702, column 10 to column 37)",
  " (in 'jm', line 1702, column 4 to column 71)",
  " (in 'jm', line 1706, column 4 to column 36)",
  " (in 'jm', line 1709, column 11 to column 50)",
  " (in 'jm', line 1709, column 52 to column 57)",
  " (in 'jm', line 1709, column 4 to column 69)",
  " (in 'jm', line 1710, column 11 to column 50)",
  " (in 'jm', line 1710, column 52 to column 57)",
  " (in 'jm', line 1710, column 4 to column 69)",
  " (in 'jm', line 1711, column 11 to column 50)",
  " (in 'jm', line 1711, column 52 to column 57)",
  " (in 'jm', line 1711, column 4 to column 69)",
  " (in 'jm', line 1714, column 11 to column 67)",
  " (in 'jm', line 1714, column 4 to column 83)",
  " (in 'jm', line 1715, column 11 to column 67)",
  " (in 'jm', line 1715, column 4 to column 83)",
  " (in 'jm', line 1716, column 11 to column 67)",
  " (in 'jm', line 1716, column 4 to column 83)",
  " (in 'jm', line 1719, column 10 to column 20)",
  " (in 'jm', line 1719, column 29 to column 86)",
  " (in 'jm', line 1719, column 4 to column 99)",
  " (in 'jm', line 1720, column 10 to column 20)",
  " (in 'jm', line 1720, column 29 to column 86)",
  " (in 'jm', line 1720, column 4 to column 99)",
  " (in 'jm', line 1721, column 10 to column 20)",
  " (in 'jm', line 1721, column 29 to column 86)",
  " (in 'jm', line 1721, column 4 to column 99)",
  " (in 'jm', line 1722, column 10 to column 67)",
  " (in 'jm', line 1722, column 4 to column 96)",
  " (in 'jm', line 1723, column 10 to column 67)",
  " (in 'jm', line 1723, column 4 to column 96)",
  " (in 'jm', line 1724, column 10 to column 67)",
  " (in 'jm', line 1724, column 4 to column 96)",
  " (in 'jm', line 1727, column 10 to column 20)",
  " (in 'jm', line 1727, column 29 to column 86)",
  " (in 'jm', line 1727, column 4 to column 99)",
  " (in 'jm', line 1728, column 10 to column 20)",
  " (in 'jm', line 1728, column 29 to column 86)",
  " (in 'jm', line 1728, column 4 to column 99)",
  " (in 'jm', line 1729, column 10 to column 20)",
  " (in 'jm', line 1729, column 29 to column 86)",
  " (in 'jm', line 1729, column 4 to column 99)",
  " (in 'jm', line 1730, column 10 to column 67)",
  " (in 'jm', line 1730, column 4 to column 96)",
  " (in 'jm', line 1731, column 10 to column 67)",
  " (in 'jm', line 1731, column 4 to column 96)",
  " (in 'jm', line 1732, column 10 to column 67)",
  " (in 'jm', line 1732, column 4 to column 96)",
  " (in 'jm', line 1737, column 11 to column 50)",
  " (in 'jm', line 1737, column 52 to column 57)",
  " (in 'jm', line 1737, column 4 to column 69)",
  " (in 'jm', line 1738, column 11 to column 50)",
  " (in 'jm', line 1738, column 52 to column 57)",
  " (in 'jm', line 1738, column 4 to column 69)",
  " (in 'jm', line 1739, column 11 to column 50)",
  " (in 'jm', line 1739, column 52 to column 57)",
  " (in 'jm', line 1739, column 4 to column 69)",
  " (in 'jm', line 1742, column 11 to column 67)",
  " (in 'jm', line 1742, column 4 to column 83)",
  " (in 'jm', line 1743, column 11 to column 67)",
  " (in 'jm', line 1743, column 4 to column 83)",
  " (in 'jm', line 1744, column 11 to column 67)",
  " (in 'jm', line 1744, column 4 to column 83)",
  " (in 'jm', line 1747, column 10 to column 20)",
  " (in 'jm', line 1747, column 29 to column 86)",
  " (in 'jm', line 1747, column 4 to column 99)",
  " (in 'jm', line 1748, column 10 to column 20)",
  " (in 'jm', line 1748, column 29 to column 86)",
  " (in 'jm', line 1748, column 4 to column 99)",
  " (in 'jm', line 1749, column 10 to column 20)",
  " (in 'jm', line 1749, column 29 to column 86)",
  " (in 'jm', line 1749, column 4 to column 99)",
  " (in 'jm', line 1750, column 10 to column 67)",
  " (in 'jm', line 1750, column 4 to column 96)",
  " (in 'jm', line 1751, column 10 to column 67)",
  " (in 'jm', line 1751, column 4 to column 96)",
  " (in 'jm', line 1752, column 10 to column 67)",
  " (in 'jm', line 1752, column 4 to column 96)",
  " (in 'jm', line 1755, column 10 to column 20)",
  " (in 'jm', line 1755, column 29 to column 86)",
  " (in 'jm', line 1755, column 4 to column 99)",
  " (in 'jm', line 1756, column 10 to column 20)",
  " (in 'jm', line 1756, column 29 to column 86)",
  " (in 'jm', line 1756, column 4 to column 99)",
  " (in 'jm', line 1757, column 10 to column 20)",
  " (in 'jm', line 1757, column 29 to column 86)",
  " (in 'jm', line 1757, column 4 to column 99)",
  " (in 'jm', line 1758, column 10 to column 67)",
  " (in 'jm', line 1758, column 4 to column 96)",
  " (in 'jm', line 1759, column 10 to column 67)",
  " (in 'jm', line 1759, column 4 to column 96)",
  " (in 'jm', line 1760, column 10 to column 67)",
  " (in 'jm', line 1760, column 4 to column 96)",
  " (in 'jm', line 1765, column 4 to column 28)",
  " (in 'jm', line 1766, column 4 to column 31)",
  " (in 'jm', line 1767, column 11 to column 54)",
  " (in 'jm', line 1767, column 4 to column 65)",
  " (in 'jm', line 1770, column 11 to column 51)",
  " (in 'jm', line 1770, column 53 to column 58)",
  " (in 'jm', line 1770, column 4 to column 70)",
  " (in 'jm', line 1771, column 11 to column 51)",
  " (in 'jm', line 1771, column 53 to column 58)",
  " (in 'jm', line 1771, column 4 to column 70)",
  " (in 'jm', line 1772, column 11 to column 51)",
  " (in 'jm', line 1772, column 53 to column 58)",
  " (in 'jm', line 1772, column 4 to column 70)",
  " (in 'jm', line 1775, column 11 to column 68)",
  " (in 'jm', line 1775, column 4 to column 84)",
  " (in 'jm', line 1776, column 11 to column 68)",
  " (in 'jm', line 1776, column 4 to column 84)",
  " (in 'jm', line 1777, column 11 to column 68)",
  " (in 'jm', line 1777, column 4 to column 84)",
  " (in 'jm', line 1780, column 10 to column 20)",
  " (in 'jm', line 1780, column 29 to column 87)",
  " (in 'jm', line 1780, column 4 to column 100)",
  " (in 'jm', line 1781, column 10 to column 20)",
  " (in 'jm', line 1781, column 29 to column 87)",
  " (in 'jm', line 1781, column 4 to column 100)",
  " (in 'jm', line 1782, column 10 to column 20)",
  " (in 'jm', line 1782, column 29 to column 87)",
  " (in 'jm', line 1782, column 4 to column 100)",
  " (in 'jm', line 1783, column 10 to column 68)",
  " (in 'jm', line 1783, column 4 to column 97)",
  " (in 'jm', line 1784, column 10 to column 68)",
  " (in 'jm', line 1784, column 4 to column 97)",
  " (in 'jm', line 1785, column 10 to column 68)",
  " (in 'jm', line 1785, column 4 to column 97)",
  " (in 'jm', line 1788, column 10 to column 20)",
  " (in 'jm', line 1788, column 29 to column 87)",
  " (in 'jm', line 1788, column 4 to column 100)",
  " (in 'jm', line 1789, column 10 to column 20)",
  " (in 'jm', line 1789, column 29 to column 87)",
  " (in 'jm', line 1789, column 4 to column 100)",
  " (in 'jm', line 1790, column 10 to column 20)",
  " (in 'jm', line 1790, column 29 to column 87)",
  " (in 'jm', line 1790, column 4 to column 100)",
  " (in 'jm', line 1791, column 10 to column 68)",
  " (in 'jm', line 1791, column 4 to column 97)",
  " (in 'jm', line 1792, column 10 to column 68)",
  " (in 'jm', line 1792, column 4 to column 97)",
  " (in 'jm', line 1793, column 10 to column 68)",
  " (in 'jm', line 1793, column 4 to column 97)",
  " (in 'jm', line 1798, column 10 to column 13)",
  " (in 'jm', line 1798, column 4 to column 47)",
  " (in 'jm', line 1801, column 11 to column 30)",
  " (in 'jm', line 1801, column 32 to column 45)",
  " (in 'jm', line 1801, column 4 to column 57)",
  " (in 'jm', line 1805, column 4 to column 34)",
  " (in 'jm', line 1809, column 10 to column 11)",
  " (in 'jm', line 1809, column 4 to column 42)",
  " (in 'jm', line 1810, column 4 to column 35)",
  " (in 'jm', line 1811, column 10 to column 19)",
  " (in 'jm', line 1811, column 4 to column 44)",
  " (in 'jm', line 1818, column 9 to column 14)",
  " (in 'jm', line 1818, column 2 to column 30)",
  " (in 'jm', line 1819, column 9 to column 14)",
  " (in 'jm', line 1819, column 2 to column 30)",
  " (in 'jm', line 1820, column 9 to column 14)",
  " (in 'jm', line 1820, column 2 to column 30)",
  " (in 'jm', line 1821, column 18 to column 23)",
  " (in 'jm', line 1821, column 2 to column 40)",
  " (in 'jm', line 1822, column 18 to column 23)",
  " (in 'jm', line 1822, column 2 to column 40)",
  " (in 'jm', line 1823, column 18 to column 23)",
  " (in 'jm', line 1823, column 2 to column 40)",
  " (in 'jm', line 1824, column 18 to column 23)",
  " (in 'jm', line 1824, column 2 to column 37)",
  " (in 'jm', line 1825, column 18 to column 23)",
  " (in 'jm', line 1825, column 2 to column 37)",
  " (in 'jm', line 1826, column 18 to column 23)",
  " (in 'jm', line 1826, column 2 to column 37)",
  " (in 'jm', line 1827, column 18 to column 19)",
  " (in 'jm', line 1827, column 2 to column 39)",
  " (in 'jm', line 1828, column 18 to column 19)",
  " (in 'jm', line 1828, column 2 to column 42)",
  " (in 'jm', line 1829, column 18 to column 19)",
  " (in 'jm', line 1829, column 2 to column 31)",
  " (in 'jm', line 1830, column 18 to column 19)",
  " (in 'jm', line 1830, column 2 to column 34)",
  " (in 'jm', line 1833, column 9 to column 10)",
  " (in 'jm', line 1833, column 2 to column 39)",
  " (in 'jm', line 1834, column 18 to column 19)",
  " (in 'jm', line 1834, column 2 to column 49)",
  " (in 'jm', line 1835, column 18 to column 19)",
  " (in 'jm', line 1835, column 2 to column 46)",
  " (in 'jm', line 1838, column 18 to column 19)",
  " (in 'jm', line 1838, column 2 to column 42)",
  " (in 'jm', line 1839, column 18 to column 19)",
  " (in 'jm', line 1839, column 2 to column 43)",
  " (in 'jm', line 1840, column 18 to column 19)",
  " (in 'jm', line 1840, column 2 to column 40)",
  " (in 'jm', line 1843, column 2 to column 33)",
  " (in 'jm', line 1844, column 2 to column 34)",
  " (in 'jm', line 1845, column 18 to column 19)",
  " (in 'jm', line 1845, column 2 to column 35)",
  " (in 'jm', line 1846, column 18 to column 19)",
  " (in 'jm', line 1846, column 2 to column 35)",
  " (in 'jm', line 1847, column 8 to column 25)",
  " (in 'jm', line 1847, column 2 to column 64)",
  " (in 'jm', line 1848, column 8 to column 26)",
  " (in 'jm', line 1848, column 2 to column 65)",
  " (in 'jm', line 1851, column 18 to column 21)",
  " (in 'jm', line 1851, column 2 to column 38)",
  " (in 'jm', line 1852, column 18 to column 21)",
  " (in 'jm', line 1852, column 2 to column 38)",
  " (in 'jm', line 1853, column 18 to column 21)",
  " (in 'jm', line 1853, column 2 to column 35)",
  " (in 'jm', line 1854, column 18 to column 21)",
  " (in 'jm', line 1854, column 2 to column 35)",
  " (in 'jm', line 1855, column 2 to column 40)",
  " (in 'jm', line 1856, column 2 to column 40)",
  " (in 'jm', line 1859, column 9 to column 12)",
  " (in 'jm', line 1859, column 2 to column 43)",
  " (in 'jm', line 1860, column 2 to column 57)",
  " (in 'jm', line 1861, column 9 to column 19)",
  " (in 'jm', line 1861, column 2 to column 51)",
  " (in 'jm', line 1862, column 18 to column 21)",
  " (in 'jm', line 1862, column 2 to column 44)",
  " (in 'jm', line 1863, column 2 to column 58)",
  " (in 'jm', line 1864, column 18 to column 28)",
  " (in 'jm', line 1864, column 2 to column 52)",
  " (in 'jm', line 1865, column 18 to column 21)",
  " (in 'jm', line 1865, column 2 to column 41)",
  " (in 'jm', line 1866, column 2 to column 55)",
  " (in 'jm', line 1867, column 18 to column 28)",
  " (in 'jm', line 1867, column 2 to column 49)",
  " (in 'jm', line 1868, column 2 to column 51)",
  " (in 'jm', line 1869, column 2 to column 48)",
  " (in 'jm', line 1870, column 2 to column 40)",
  " (in 'jm', line 1871, column 2 to column 43)",
  " (in 'jm', line 1875, column 9 to column 12)",
  " (in 'jm', line 1875, column 2 to column 36)",
  " (in 'jm', line 1876, column 18 to column 21)",
  " (in 'jm', line 1876, column 2 to column 37)",
  " (in 'jm', line 1877, column 18 to column 21)",
  " (in 'jm', line 1877, column 2 to column 34)",
  " (in 'jm', line 1878, column 2 to column 44)",
  " (in 'jm', line 1879, column 2 to column 41)",
  " (in 'jm', line 1880, column 2 to column 33)",
  " (in 'jm', line 1881, column 2 to column 36)",
  " (in 'jm', line 1884, column 2 to column 53)",
  " (in 'jm', line 1885, column 2 to column 53)",
  " (in 'jm', line 1890, column 2 to column 68)",
  " (in 'jm', line 1891, column 2 to column 68)",
  " (in 'jm', line 1892, column 2 to column 68)",
  " (in 'jm', line 1895, column 2 to column 27)",
  " (in 'jm', line 1896, column 2 to column 48)",
  " (in 'jm', line 1897, column 2 to column 36)",
  " (in 'jm', line 1898, column 2 to column 23)",
  " (in 'jm', line 1899, column 8 to column 25)",
  " (in 'jm', line 1899, column 2 to column 47)",
  " (in 'jm', line 1902, column 8 to column 60)",
  " (in 'jm', line 1902, column 2 to column 76)",
  " (in 'jm', line 1903, column 8 to column 60)",
  " (in 'jm', line 1903, column 2 to column 76)",
  " (in 'jm', line 1906, column 2 to line 1907, column 38)",
  " (in 'jm', line 1908, column 2 to line 1909, column 38)",
  " (in 'jm', line 1910, column 2 to line 1911, column 38)",
  " (in 'jm', line 1912, column 9 to column 47)",
  " (in 'jm', line 1912, column 2 to column 57)",
  " (in 'jm', line 1913, column 9 to column 47)",
  " (in 'jm', line 1913, column 2 to column 57)",
  " (in 'jm', line 1914, column 9 to column 47)",
  " (in 'jm', line 1914, column 2 to column 57)",
  " (in 'jm', line 1915, column 9 to column 47)",
  " (in 'jm', line 1915, column 2 to column 56)",
  " (in 'jm', line 1916, column 9 to column 47)",
  " (in 'jm', line 1916, column 2 to column 56)",
  " (in 'jm', line 1917, column 9 to column 47)",
  " (in 'jm', line 1917, column 2 to column 56)",
  " (in 'jm', line 1919, column 4 to column 27)",
  " (in 'jm', line 1920, column 4 to column 25)",
  " (in 'jm', line 1918, column 31 to line 1921, column 3)",
  " (in 'jm', line 1918, column 2 to line 1921, column 3)",
  " (in 'jm', line 1923, column 4 to column 27)",
  " (in 'jm', line 1924, column 4 to column 25)",
  " (in 'jm', line 1922, column 31 to line 1925, column 3)",
  " (in 'jm', line 1922, column 2 to line 1925, column 3)",
  " (in 'jm', line 1927, column 4 to column 27)",
  " (in 'jm', line 1928, column 4 to column 25)",
  " (in 'jm', line 1926, column 31 to line 1929, column 3)",
  " (in 'jm', line 1926, column 2 to line 1929, column 3)",
  " (in 'jm', line 1936, column 10 to column 48)",
  " (in 'jm', line 1937, column 10 to column 19)",
  " (in 'jm', line 1935, column 26 to line 1938, column 9)",
  " (in 'jm', line 1935, column 8 to line 1938, column 9)",
  " (in 'jm', line 1934, column 20 to line 1939, column 7)",
  " (in 'jm', line 1934, column 6 to line 1939, column 7)",
  " (in 'jm', line 1940, column 24 to column 44)",
  " (in 'jm', line 1940, column 6 to column 44)",
  " (in 'jm', line 1933, column 19 to line 1941, column 5)",
  " (in 'jm', line 1933, column 4 to line 1941, column 5)",
  " (in 'jm', line 1932, column 31 to line 1942, column 3)",
  " (in 'jm', line 1932, column 2 to line 1942, column 3)",
  " (in 'jm', line 1947, column 6 to column 41)",
  " (in 'jm', line 1946, column 4 to line 1947, column 41)",
  " (in 'jm', line 1949, column 6 to column 41)",
  " (in 'jm', line 1948, column 4 to line 1949, column 41)",
  " (in 'jm', line 1945, column 31 to line 1950, column 3)",
  " (in 'jm', line 1945, column 2 to line 1950, column 3)",
  " (in 'jm', line 1959, column 8 to column 29)",
  " (in 'jm', line 1961, column 8 to column 29)",
  " (in 'jm', line 1963, column 8 to column 29)",
  " (in 'jm', line 1967, column 9 to column 14)",
  " (in 'jm', line 1968, column 9 to column 14)",
  " (in 'jm', line 1969, column 9 to column 14)",
  " (in 'jm', line 1972, column 9 to column 40)",
  " (in 'jm', line 1973, column 9 to column 46)",
  " (in 'jm', line 1974, column 26 to column 63)",
  " (in 'jm', line 1975, column 18 to column 65)",
  " (in 'jm', line 1976, column 18 to column 49)",
  " (in 'jm', line 1980, column 20 to column 53)",
  " (in 'jm', line 1982, column 11 to column 56)",
  " (in 'jm', line 1982, column 58 to column 76)",
  " (in 'jm', line 1984, column 25 to column 69)",
  " (in 'jm', line 1988, column 20 to column 53)",
  " (in 'jm', line 1990, column 11 to column 56)",
  " (in 'jm', line 1990, column 58 to column 76)",
  " (in 'jm', line 1992, column 25 to column 69)",
  " (in 'jm', line 1995, column 8 to column 18)",
  " (in 'jm', line 1996, column 8 to column 18)",
  " (in 'jm', line 1997, column 8 to column 18)",
  " (in 'jm', line 2000, column 8 to column 12)",
  " (in 'jm', line 2001, column 8 to column 12)",
  " (in 'jm', line 2002, column 8 to column 12)",
  " (in 'jm', line 2003, column 8 to column 12)",
  " (in 'jm', line 2003, column 30 to column 35)",
  " (in 'jm', line 2004, column 8 to column 12)",
  " (in 'jm', line 2004, column 30 to column 35)",
  " (in 'jm', line 2005, column 8 to column 12)",
  " (in 'jm', line 2005, column 30 to column 35)",
  " (in 'jm', line 2006, column 8 to column 16)",
  " (in 'jm', line 2007, column 8 to column 16)",
  " (in 'jm', line 2008, column 8 to column 16)",
  " (in 'jm', line 2009, column 8 to column 28)",
  " (in 'jm', line 2010, column 8 to column 28)",
  " (in 'jm', line 2011, column 8 to column 28)",
  " (in 'jm', line 2012, column 8 to column 52)",
  " (in 'jm', line 2012, column 70 to column 75)",
  " (in 'jm', line 2013, column 8 to column 52)",
  " (in 'jm', line 2013, column 70 to column 75)",
  " (in 'jm', line 2014, column 8 to column 52)",
  " (in 'jm', line 2014, column 70 to column 75)",
  " (in 'jm', line 2017, column 8 to column 23)",
  " (in 'jm', line 2018, column 9 to column 12)",
  " (in 'jm', line 2024, column 62 to column 72)",
  " (in 'jm', line 2027, column 8 to column 12)",
  " (in 'jm', line 2028, column 8 to column 12)",
  " (in 'jm', line 2028, column 30 to column 42)",
  " (in 'jm', line 2029, column 8 to column 16)",
  " (in 'jm', line 2030, column 8 to column 46)",
  " (in 'jm', line 2030, column 64 to column 67)",
  " (in 'jm', line 2031, column 8 to column 25)",
  " (in 'jm', line 2034, column 9 to column 12)",
  " (in 'jm', line 2037, column 8 to column 12)",
  " (in 'jm', line 2038, column 8 to column 12)",
  " (in 'jm', line 2038, column 30 to column 42)",
  " (in 'jm', line 2039, column 8 to column 16)",
  " (in 'jm', line 2040, column 8 to column 46)",
  " (in 'jm', line 2040, column 64 to column 67)",
  " (in 'jm', line 2041, column 8 to column 25)",
  " (in 'jm', line 2044, column 9 to column 12)",
  " (in 'jm', line 2045, column 9 to column 12)",
  " (in 'jm', line 2046, column 9 to column 19)",
  " (in 'jm', line 2051, column 9 to column 14)",
  " (in 'jm', line 2052, column 9 to column 14)",
  " (in 'jm', line 2053, column 9 to column 14)",
  " (in 'jm', line 2054, column 8 to column 18)",
  " (in 'jm', line 2055, column 8 to column 18)",
  " (in 'jm', line 2056, column 8 to column 18)",
  " (in 'jm', line 2057, column 9 to column 20)",
  " (in 'jm', line 2061, column 9 to column 27)",
  " (in 'jm', line 2061, column 29 to column 32)",
  " (in 'jm', line 2062, column 9 to column 27)",
  " (in 'jm', line 2062, column 29 to column 32)",
  " (in 'jm', line 2803, column 8 to column 9)",
  " (in 'jm', line 2804, column 8 to column 29)",
  " (in 'jm', line 2805, column 8 to column 29)",
  " (in 'jm', line 2806, column 8 to column 29)",
  " (in 'jm', line 2807, column 9 to column 65)",
  " (in 'jm', line 2808, column 9 to column 65)",
  " (in 'jm', line 2809, column 9 to column 18)",
  " (in 'jm', line 2810, column 9 to column 18)",
  " (in 'jm', line 46, column 11 to column 22)",
  " (in 'jm', line 46, column 4 to column 32)",
  " (in 'jm', line 47, column 4 to column 22)",
  " (in 'jm', line 48, column 4 to column 21)",
  " (in 'jm', line 49, column 4 to column 21)",
  " (in 'jm', line 50, column 4 to column 25)",
  " (in 'jm', line 54, column 6 to column 20)",
  " (in 'jm', line 61, column 15 to column 17)",
  " (in 'jm', line 61, column 18 to column 20)",
  " (in 'jm', line 61, column 8 to column 26)",
  " (in 'jm', line 62, column 8 to column 21)",
  " (in 'jm', line 63, column 8 to column 17)",
  " (in 'jm', line 64, column 8 to column 69)",
  " (in 'jm', line 65, column 15 to column 17)",
  " (in 'jm', line 65, column 8 to column 53)",
  " (in 'jm', line 66, column 8 to column 22)",
  " (in 'jm', line 69, column 8 to column 24)",
  " (in 'jm', line 70, column 8 to column 42)",
  " (in 'jm', line 71, column 8 to column 27)",
  " (in 'jm', line 74, column 8 to column 42)",
  " (in 'jm', line 75, column 8 to column 40)",
  " (in 'jm', line 76, column 8 to column 22)",
  " (in 'jm', line 77, column 8 to column 53)",
  " (in 'jm', line 78, column 8 to column 33)",
  " (in 'jm', line 81, column 10 to column 26)",
  " (in 'jm', line 82, column 17 to column 18)",
  " (in 'jm', line 82, column 10 to column 54)",
  " (in 'jm', line 83, column 10 to column 78)",
  " (in 'jm', line 84, column 10 to column 24)",
  " (in 'jm', line 85, column 10 to column 46)",
  " (in 'jm', line 86, column 24 to column 61)",
  " (in 'jm', line 86, column 10 to column 61)",
  " (in 'jm', line 87, column 10 to column 61)",
  " (in 'jm', line 88, column 10 to column 24)",
  " (in 'jm', line 80, column 30 to line 89, column 9)",
  " (in 'jm', line 80, column 8 to line 89, column 9)",
  " (in 'jm', line 93, column 10 to column 43)",
  " (in 'jm', line 94, column 10 to column 28)",
  " (in 'jm', line 92, column 40 to line 95, column 9)",
  " (in 'jm', line 92, column 24 to line 95, column 9)",
  " (in 'jm', line 92, column 8 to line 95, column 9)",
  " (in 'jm', line 60, column 11 to line 96, column 7)",
  " (in 'jm', line 56, column 8 to column 63)",
  " (in 'jm', line 58, column 8 to column 26)",
  " (in 'jm', line 55, column 19 to line 59, column 7)",
  " (in 'jm', line 55, column 6 to line 96, column 7)",
  " (in 'jm', line 53, column 25 to line 97, column 5)",
  " (in 'jm', line 53, column 4 to line 97, column 5)",
  " (in 'jm', line 98, column 4 to column 19)",
  " (in 'jm', line 45, column 46 to line 99, column 3)",
  " (in 'jm', line 113, column 11 to column 20)",
  " (in 'jm', line 113, column 4 to column 24)",
  " (in 'jm', line 114, column 4 to column 19)",
  " (in 'jm', line 115, column 4 to column 25)",
  " (in 'jm', line 117, column 6 to column 20)",
  " (in 'jm', line 126, column 15 to column 17)",
  " (in 'jm', line 126, column 18 to column 20)",
  " (in 'jm', line 126, column 8 to column 50)",
  " (in 'jm', line 128, column 10 to column 43)",
  " (in 'jm', line 129, column 10 to column 28)",
  " (in 'jm', line 131, column 12 to column 45)",
  " (in 'jm', line 132, column 12 to column 30)",
  " (in 'jm', line 130, column 29 to line 133, column 11)",
  " (in 'jm', line 130, column 10 to line 133, column 11)",
  " (in 'jm', line 127, column 24 to line 134, column 9)",
  " (in 'jm', line 127, column 8 to line 134, column 9)",
  " (in 'jm', line 136, column 17 to column 19)",
  " (in 'jm', line 136, column 10 to column 59)",
  " (in 'jm', line 137, column 10 to column 22)",
  " (in 'jm', line 138, column 26 to column 50)",
  " (in 'jm', line 138, column 10 to column 50)",
  " (in 'jm', line 139, column 10 to column 27)",
  " (in 'jm', line 135, column 26 to line 140, column 9)",
  " (in 'jm', line 135, column 8 to line 140, column 9)",
  " (in 'jm', line 125, column 11 to line 141, column 7)",
  " (in 'jm', line 119, column 8 to column 51)",
  " (in 'jm', line 121, column 10 to column 40)",
  " (in 'jm', line 120, column 8 to line 121, column 40)",
  " (in 'jm', line 122, column 8 to column 23)",
  " (in 'jm', line 123, column 8 to column 26)",
  " (in 'jm', line 118, column 19 to line 124, column 7)",
  " (in 'jm', line 118, column 6 to line 141, column 7)",
  " (in 'jm', line 116, column 25 to line 142, column 5)",
  " (in 'jm', line 116, column 4 to line 142, column 5)",
  " (in 'jm', line 143, column 4 to column 13)",
  " (in 'jm', line 112, column 74 to line 144, column 3)",
  " (in 'jm', line 164, column 4 to column 16)",
  " (in 'jm', line 165, column 4 to column 20)",
  " (in 'jm', line 166, column 4 to column 20)",
  " (in 'jm', line 167, column 4 to column 34)",
  " (in 'jm', line 168, column 4 to column 34)",
  " (in 'jm', line 170, column 13 to column 21)",
  " (in 'jm', line 170, column 6 to column 30)",
  " (in 'jm', line 171, column 13 to column 21)",
  " (in 'jm', line 171, column 6 to column 30)",
  " (in 'jm', line 172, column 6 to column 59)",
  " (in 'jm', line 173, column 6 to column 19)",
  " (in 'jm', line 174, column 6 to column 21)",
  " (in 'jm', line 175, column 6 to column 21)",
  " (in 'jm', line 177, column 8 to column 18)",
  " (in 'jm', line 178, column 8 to column 28)",
  " (in 'jm', line 179, column 8 to column 23)",
  " (in 'jm', line 176, column 28 to line 180, column 7)",
  " (in 'jm', line 176, column 6 to line 180, column 7)",
  " (in 'jm', line 181, column 6 to column 74)",
  " (in 'jm', line 182, column 6 to column 26)",
  " (in 'jm', line 169, column 33 to line 183, column 5)",
  " (in 'jm', line 169, column 19 to line 183, column 5)",
  " (in 'jm', line 169, column 4 to line 183, column 5)",
  " (in 'jm', line 184, column 4 to column 38)",
  " (in 'jm', line 185, column 4 to column 38)",
  " (in 'jm', line 186, column 4 to column 14)",
  " (in 'jm', line 163, column 38 to line 187, column 3)",
  " (in 'jm', line 202, column 4 to column 25)",
  " (in 'jm', line 203, column 11 to column 12)",
  " (in 'jm', line 203, column 4 to column 50)",
  " (in 'jm', line 204, column 4 to column 78)",
  " (in 'jm', line 205, column 11 to column 12)",
  " (in 'jm', line 205, column 4 to column 39)",
  " (in 'jm', line 206, column 11 to column 12)",
  " (in 'jm', line 206, column 4 to column 82)",
  " (in 'jm', line 207, column 4 to column 40)",
  " (in 'jm', line 201, column 70 to line 208, column 3)",
  " (in 'jm', line 223, column 4 to column 25)",
  " (in 'jm', line 224, column 11 to column 12)",
  " (in 'jm', line 224, column 4 to column 50)",
  " (in 'jm', line 225, column 11 to column 12)",
  " (in 'jm', line 225, column 4 to column 47)",
  " (in 'jm', line 226, column 4 to column 78)",
  " (in 'jm', line 227, column 11 to column 12)",
  " (in 'jm', line 227, column 4 to column 50)",
  " (in 'jm', line 228, column 11 to column 12)",
  " (in 'jm', line 228, column 4 to line 229, column 69)",
  " (in 'jm', line 230, column 4 to column 40)",
  " (in 'jm', line 222, column 74 to line 231, column 3)",
  " (in 'jm', line 244, column 4 to column 24)",
  " (in 'jm', line 245, column 4 to column 21)",
  " (in 'jm', line 246, column 4 to column 22)",
  " (in 'jm', line 247, column 4 to column 22)",
  " (in 'jm', line 248, column 4 to column 22)",
  " (in 'jm', line 249, column 4 to column 26)",
  " (in 'jm', line 250, column 4 to column 24)",
  " (in 'jm', line 251, column 4 to column 25)",
  " (in 'jm', line 252, column 4 to line 254, column 84)",
  " (in 'jm', line 243, column 28 to line 255, column 3)",
  " (in 'jm', line 266, column 10 to column 11)",
  " (in 'jm', line 266, column 12 to column 13)",
  " (in 'jm', line 266, column 4 to column 21)",
  " (in 'jm', line 267, column 4 to column 16)",
  " (in 'jm', line 269, column 6 to column 22)",
  " (in 'jm', line 270, column 6 to column 15)",
  " (in 'jm', line 268, column 45 to line 271, column 5)",
  " (in 'jm', line 268, column 30 to line 271, column 5)",
  " (in 'jm', line 268, column 15 to line 271, column 5)",
  " (in 'jm', line 268, column 4 to line 271, column 5)",
  " (in 'jm', line 272, column 4 to column 13)",
  " (in 'jm', line 265, column 51 to line 273, column 3)",
  " (in 'jm', line 291, column 21 to column 48)",
  " (in 'jm', line 291, column 4 to column 48)",
  " (in 'jm', line 293, column 21 to column 48)",
  " (in 'jm', line 293, column 6 to column 48)",
  " (in 'jm', line 294, column 6 to column 15)",
  " (in 'jm', line 292, column 21 to line 295, column 5)",
  " (in 'jm', line 292, column 4 to line 295, column 5)",
  " (in 'jm', line 296, column 4 to column 31)",
  " (in 'jm', line 290, column 40 to line 297, column 3)",
  " (in 'jm', line 307, column 34 to column 43)",
  " (in 'jm', line 307, column 4 to column 43)",
  " (in 'jm', line 308, column 4 to column 31)",
  " (in 'jm', line 306, column 40 to line 309, column 3)",
  " (in 'jm', line 325, column 9 to column 32)",
  " (in 'jm', line 324, column 24 to column 49)",
  " (in 'jm', line 324, column 9 to line 325, column 32)",
  " (in 'jm', line 323, column 24 to column 41)",
  " (in 'jm', line 323, column 9 to line 325, column 32)",
  " (in 'jm', line 322, column 24 to column 55)",
  " (in 'jm', line 322, column 9 to line 325, column 32)",
  " (in 'jm', line 321, column 24 to column 41)",
  " (in 'jm', line 321, column 9 to line 325, column 32)",
  " (in 'jm', line 320, column 24 to column 47)",
  " (in 'jm', line 320, column 4 to line 325, column 32)",
  " (in 'jm', line 326, column 4 to column 15)",
  " (in 'jm', line 319, column 44 to line 327, column 3)",
  " (in 'jm', line 339, column 4 to column 16)",
  " (in 'jm', line 360, column 9 to column 32)",
  " (in 'jm', line 357, column 6 to column 39)",
  " (in 'jm', line 358, column 6 to column 28)",
  " (in 'jm', line 356, column 23 to line 359, column 5)",
  " (in 'jm', line 356, column 9 to line 360, column 32)",
  " (in 'jm', line 353, column 6 to column 33)",
  " (in 'jm', line 354, column 6 to column 22)",
  " (in 'jm', line 352, column 23 to line 355, column 5)",
  " (in 'jm', line 352, column 9 to line 360, column 32)",
  " (in 'jm', line 349, column 6 to column 38)",
  " (in 'jm', line 350, column 6 to column 38)",
  " (in 'jm', line 348, column 24 to line 351, column 5)",
  " (in 'jm', line 348, column 9 to line 360, column 32)",
  " (in 'jm', line 345, column 6 to column 38)",
  " (in 'jm', line 346, column 6 to column 38)",
  " (in 'jm', line 344, column 24 to line 347, column 5)",
  " (in 'jm', line 344, column 9 to line 360, column 32)",
  " (in 'jm', line 341, column 6 to column 40)",
  " (in 'jm', line 342, column 6 to column 40)",
  " (in 'jm', line 340, column 19 to line 343, column 5)",
  " (in 'jm', line 340, column 4 to line 360, column 32)",
  " (in 'jm', line 361, column 4 to column 14)",
  " (in 'jm', line 338, column 68 to line 362, column 3)",
  " (in 'jm', line 374, column 4 to column 22)",
  " (in 'jm', line 375, column 11 to column 12)",
  " (in 'jm', line 375, column 4 to column 17)",
  " (in 'jm', line 383, column 9 to column 32)",
  " (in 'jm', line 380, column 13 to column 14)",
  " (in 'jm', line 380, column 6 to column 45)",
  " (in 'jm', line 381, column 21 to column 55)",
  " (in 'jm', line 381, column 6 to column 55)",
  " (in 'jm', line 379, column 24 to line 382, column 5)",
  " (in 'jm', line 379, column 9 to line 383, column 32)",
  " (in 'jm', line 377, column 21 to column 62)",
  " (in 'jm', line 377, column 6 to column 62)",
  " (in 'jm', line 376, column 19 to line 378, column 5)",
  " (in 'jm', line 376, column 4 to line 383, column 32)",
  " (in 'jm', line 384, column 4 to column 14)",
  " (in 'jm', line 373, column 46 to line 385, column 3)",
  " (in 'jm', line 396, column 40 to column 66)",
  " (in 'jm', line 396, column 4 to column 66)",
  " (in 'jm', line 397, column 18 to column 27)",
  " (in 'jm', line 397, column 4 to column 27)",
  " (in 'jm', line 403, column 6 to column 26)",
  " (in 'jm', line 404, column 6 to line 405, column 79)",
  " (in 'jm', line 402, column 9 to line 406, column 5)",
  " (in 'jm', line 399, column 20 to column 38)",
  " (in 'jm', line 399, column 6 to column 38)",
  " (in 'jm', line 400, column 6 to column 45)",
  " (in 'jm', line 398, column 20 to line 401, column 5)",
  " (in 'jm', line 398, column 4 to line 406, column 5)",
  " (in 'jm', line 407, column 4 to column 26)",
  " (in 'jm', line 395, column 56 to line 408, column 3)",
  " (in 'jm', line 421, column 4 to column 39)",
  " (in 'jm', line 422, column 4 to column 17)",
  " (in 'jm', line 423, column 4 to column 17)",
  " (in 'jm', line 424, column 11 to column 12)",
  " (in 'jm', line 424, column 4 to column 23)",
  " (in 'jm', line 426, column 6 to column 29)",
  " (in 'jm', line 427, column 6 to column 32)",
  " (in 'jm', line 428, column 6 to column 28)",
  " (in 'jm', line 429, column 13 to column 16)",
  " (in 'jm', line 429, column 6 to line 430, column 63)",
  " (in 'jm', line 431, column 6 to column 54)",
  " (in 'jm', line 432, column 6 to column 18)",
  " (in 'jm', line 433, column 6 to column 18)",
  " (in 'jm', line 425, column 19 to line 434, column 5)",
  " (in 'jm', line 425, column 4 to line 434, column 5)",
  " (in 'jm', line 435, column 4 to column 37)",
  " (in 'jm', line 420, column 91 to line 436, column 3)",
  " (in 'jm', line 451, column 9 to column 32)",
  " (in 'jm', line 450, column 24 to column 49)",
  " (in 'jm', line 450, column 9 to line 451, column 32)",
  " (in 'jm', line 449, column 24 to column 41)",
  " (in 'jm', line 449, column 9 to line 451, column 32)",
  " (in 'jm', line 448, column 24 to column 55)",
  " (in 'jm', line 448, column 9 to line 451, column 32)",
  " (in 'jm', line 447, column 24 to column 41)",
  " (in 'jm', line 447, column 9 to line 451, column 32)",
  " (in 'jm', line 446, column 24 to column 47)",
  " (in 'jm', line 446, column 4 to line 451, column 32)",
  " (in 'jm', line 452, column 4 to column 15)",
  " (in 'jm', line 445, column 45 to line 453, column 3)",
  " (in 'jm', line 464, column 4 to column 16)",
  " (in 'jm', line 482, column 9 to column 32)",
  " (in 'jm', line 476, column 8 to column 40)",
  " (in 'jm', line 477, column 8 to column 44)",
  " (in 'jm', line 478, column 8 to column 47)",
  " (in 'jm', line 479, column 8 to column 39)",
  " (in 'jm', line 475, column 35 to line 480, column 7)",
  " (in 'jm', line 475, column 6 to line 480, column 7)",
  " (in 'jm', line 474, column 24 to line 481, column 5)",
  " (in 'jm', line 474, column 9 to line 482, column 32)",
  " (in 'jm', line 469, column 8 to column 28)",
  " (in 'jm', line 470, column 8 to column 53)",
  " (in 'jm', line 471, column 8 to column 39)",
  " (in 'jm', line 468, column 35 to line 472, column 7)",
  " (in 'jm', line 468, column 6 to line 472, column 7)",
  " (in 'jm', line 467, column 24 to line 473, column 5)",
  " (in 'jm', line 467, column 9 to line 482, column 32)",
  " (in 'jm', line 466, column 24 to column 83)",
  " (in 'jm', line 466, column 9 to line 482, column 32)",
  " (in 'jm', line 465, column 19 to column 62)",
  " (in 'jm', line 465, column 4 to line 482, column 32)",
  " (in 'jm', line 483, column 4 to column 14)",
  " (in 'jm', line 463, column 75 to line 484, column 3)",
  " (in 'jm', line 494, column 4 to column 22)",
  " (in 'jm', line 495, column 11 to column 12)",
  " (in 'jm', line 495, column 4 to column 17)",
  " (in 'jm', line 504, column 9 to column 32)",
  " (in 'jm', line 501, column 13 to column 14)",
  " (in 'jm', line 501, column 6 to column 46)",
  " (in 'jm', line 502, column 21 to column 69)",
  " (in 'jm', line 502, column 6 to column 69)",
  " (in 'jm', line 500, column 24 to line 503, column 5)",
  " (in 'jm', line 500, column 9 to line 504, column 32)",
  " (in 'jm', line 498, column 8 to column 62)",
  " (in 'jm', line 497, column 6 to line 498, column 62)",
  " (in 'jm', line 496, column 19 to line 499, column 5)",
  " (in 'jm', line 496, column 4 to line 504, column 32)",
  " (in 'jm', line 505, column 4 to column 14)",
  " (in 'jm', line 493, column 75 to line 506, column 3)",
  " (in 'jm', line 519, column 9 to column 32)",
  " (in 'jm', line 518, column 24 to column 40)",
  " (in 'jm', line 518, column 9 to line 519, column 32)",
  " (in 'jm', line 517, column 24 to column 40)",
  " (in 'jm', line 517, column 9 to line 519, column 32)",
  " (in 'jm', line 516, column 24 to column 35)",
  " (in 'jm', line 516, column 4 to line 519, column 32)",
  " (in 'jm', line 520, column 4 to column 15)",
  " (in 'jm', line 515, column 45 to line 521, column 3)",
  " (in 'jm', line 531, column 4 to line 532, column 65)",
  " (in 'jm', line 530, column 62 to line 533, column 3)",
  " (in 'jm', line 546, column 9 to column 32)",
  " (in 'jm', line 545, column 24 to column 40)",
  " (in 'jm', line 545, column 9 to line 546, column 32)",
  " (in 'jm', line 544, column 24 to column 40)",
  " (in 'jm', line 544, column 9 to line 546, column 32)",
  " (in 'jm', line 543, column 24 to column 35)",
  " (in 'jm', line 543, column 4 to line 546, column 32)",
  " (in 'jm', line 547, column 4 to column 15)",
  " (in 'jm', line 542, column 45 to line 548, column 3)",
  " (in 'jm', line 562, column 4 to line 563, column 39)",
  " (in 'jm', line 570, column 9 to column 32)",
  " (in 'jm', line 569, column 6 to column 65)",
  " (in 'jm', line 568, column 9 to line 570, column 32)",
  " (in 'jm', line 567, column 6 to column 59)",
  " (in 'jm', line 566, column 9 to line 570, column 32)",
  " (in 'jm', line 565, column 6 to column 59)",
  " (in 'jm', line 564, column 4 to line 570, column 32)",
  " (in 'jm', line 571, column 4 to column 15)",
  " (in 'jm', line 561, column 42 to line 572, column 3)",
  " (in 'jm', line 583, column 4 to column 22)",
  " (in 'jm', line 584, column 11 to column 12)",
  " (in 'jm', line 584, column 4 to column 17)",
  " (in 'jm', line 600, column 9 to column 32)",
  " (in 'jm', line 597, column 8 to column 57)",
  " (in 'jm', line 596, column 21 to line 598, column 7)",
  " (in 'jm', line 596, column 6 to line 598, column 7)",
  " (in 'jm', line 595, column 24 to line 599, column 5)",
  " (in 'jm', line 595, column 9 to line 600, column 32)",
  " (in 'jm', line 592, column 8 to column 62)",
  " (in 'jm', line 591, column 21 to line 593, column 7)",
  " (in 'jm', line 591, column 6 to line 593, column 7)",
  " (in 'jm', line 590, column 24 to line 594, column 5)",
  " (in 'jm', line 590, column 9 to line 600, column 32)",
  " (in 'jm', line 587, column 8 to column 57)",
  " (in 'jm', line 586, column 21 to line 588, column 7)",
  " (in 'jm', line 586, column 6 to line 588, column 7)",
  " (in 'jm', line 585, column 19 to line 589, column 5)",
  " (in 'jm', line 585, column 4 to line 600, column 32)",
  " (in 'jm', line 601, column 4 to column 14)",
  " (in 'jm', line 582, column 62 to line 602, column 3)",
  " (in 'jm', line 616, column 9 to column 32)",
  " (in 'jm', line 615, column 24 to column 45)",
  " (in 'jm', line 615, column 9 to line 616, column 32)",
  " (in 'jm', line 614, column 24 to column 40)",
  " (in 'jm', line 614, column 9 to line 616, column 32)",
  " (in 'jm', line 613, column 24 to column 40)",
  " (in 'jm', line 613, column 9 to line 616, column 32)",
  " (in 'jm', line 612, column 24 to column 35)",
  " (in 'jm', line 612, column 4 to line 616, column 32)",
  " (in 'jm', line 617, column 4 to column 15)",
  " (in 'jm', line 611, column 52 to line 618, column 3)",
  " (in 'jm', line 632, column 4 to line 634, column 60)",
  " (in 'jm', line 631, column 51 to line 635, column 3)",
  " (in 'jm', line 650, column 11 to column 18)",
  " (in 'jm', line 650, column 4 to column 57)",
  " (in 'jm', line 651, column 4 to line 652, column 67)",
  " (in 'jm', line 649, column 64 to line 653, column 3)",
  " (in 'jm', line 665, column 4 to column 26)",
  " (in 'jm', line 666, column 4 to column 30)",
  " (in 'jm', line 667, column 4 to column 37)",
  " (in 'jm', line 668, column 4 to line 669, column 26)",
  " (in 'jm', line 671, column 9 to column 24)",
  " (in 'jm', line 670, column 30 to column 39)",
  " (in 'jm', line 670, column 4 to line 671, column 24)",
  " (in 'jm', line 664, column 46 to line 672, column 3)",
  " (in 'jm', line 688, column 9 to column 32)",
  " (in 'jm', line 687, column 24 to column 53)",
  " (in 'jm', line 687, column 9 to line 688, column 32)",
  " (in 'jm', line 686, column 24 to column 40)",
  " (in 'jm', line 686, column 9 to line 688, column 32)",
  " (in 'jm', line 685, column 24 to column 54)",
  " (in 'jm', line 685, column 9 to line 688, column 32)",
  " (in 'jm', line 684, column 24 to column 48)",
  " (in 'jm', line 684, column 9 to line 688, column 32)",
  " (in 'jm', line 683, column 24 to column 40)",
  " (in 'jm', line 683, column 9 to line 688, column 32)",
  " (in 'jm', line 682, column 19 to column 41)",
  " (in 'jm', line 682, column 4 to line 688, column 32)",
  " (in 'jm', line 689, column 4 to column 15)",
  " (in 'jm', line 681, column 44 to line 690, column 3)",
  " (in 'jm', line 703, column 9 to column 32)",
  " (in 'jm', line 702, column 24 to column 43)",
  " (in 'jm', line 702, column 9 to line 703, column 32)",
  " (in 'jm', line 701, column 24 to column 35)",
  " (in 'jm', line 701, column 9 to line 703, column 32)",
  " (in 'jm', line 700, column 19 to column 35)",
  " (in 'jm', line 700, column 4 to line 703, column 32)",
  " (in 'jm', line 704, column 4 to column 15)",
  " (in 'jm', line 699, column 46 to line 705, column 3)",
  " (in 'jm', line 717, column 11 to column 18)",
  " (in 'jm', line 717, column 4 to column 23)",
  " (in 'jm', line 718, column 11 to column 18)",
  " (in 'jm', line 718, column 4 to column 49)",
  " (in 'jm', line 720, column 6 to column 77)",
  " (in 'jm', line 719, column 25 to line 721, column 5)",
  " (in 'jm', line 719, column 4 to line 721, column 5)",
  " (in 'jm', line 722, column 4 to column 14)",
  " (in 'jm', line 716, column 66 to line 723, column 3)",
  " (in 'jm', line 736, column 11 to column 18)",
  " (in 'jm', line 736, column 4 to column 23)",
  " (in 'jm', line 737, column 11 to column 18)",
  " (in 'jm', line 737, column 4 to column 49)",
  " (in 'jm', line 738, column 11 to column 18)",
  " (in 'jm', line 738, column 4 to column 59)",
  " (in 'jm', line 740, column 6 to column 69)",
  " (in 'jm', line 739, column 25 to line 741, column 5)",
  " (in 'jm', line 739, column 4 to line 741, column 5)",
  " (in 'jm', line 742, column 4 to column 14)",
  " (in 'jm', line 735, column 79 to line 743, column 3)",
  " (in 'jm', line 757, column 9 to column 32)",
  " (in 'jm', line 756, column 24 to column 44)",
  " (in 'jm', line 756, column 9 to line 757, column 32)",
  " (in 'jm', line 755, column 24 to column 35)",
  " (in 'jm', line 755, column 9 to line 757, column 32)",
  " (in 'jm', line 754, column 24 to column 40)",
  " (in 'jm', line 754, column 4 to line 757, column 32)",
  " (in 'jm', line 758, column 4 to column 15)",
  " (in 'jm', line 753, column 45 to line 759, column 3)",
  " (in 'jm', line 770, column 4 to column 22)",
  " (in 'jm', line 771, column 11 to column 12)",
  " (in 'jm', line 771, column 4 to column 17)",
  " (in 'jm', line 778, column 9 to column 32)",
  " (in 'jm', line 775, column 13 to column 14)",
  " (in 'jm', line 775, column 6 to column 47)",
  " (in 'jm', line 776, column 21 to column 58)",
  " (in 'jm', line 776, column 6 to column 58)",
  " (in 'jm', line 774, column 24 to line 777, column 5)",
  " (in 'jm', line 774, column 9 to line 778, column 32)",
  " (in 'jm', line 773, column 21 to column 61)",
  " (in 'jm', line 773, column 6 to column 61)",
  " (in 'jm', line 772, column 4 to line 778, column 32)",
  " (in 'jm', line 779, column 4 to column 14)",
  " (in 'jm', line 769, column 54 to line 780, column 3)",
  " (in 'jm', line 792, column 4 to column 22)",
  " (in 'jm', line 793, column 11 to column 12)",
  " (in 'jm', line 793, column 4 to column 45)",
  " (in 'jm', line 794, column 11 to column 12)",
  " (in 'jm', line 794, column 4 to column 17)",
  " (in 'jm', line 795, column 19 to column 69)",
  " (in 'jm', line 795, column 4 to column 69)",
  " (in 'jm', line 796, column 4 to column 14)",
  " (in 'jm', line 791, column 64 to line 797, column 3)",
  " (in 'jm', line 806, column 4 to column 15)",
  " (in 'jm', line 808, column 30 to column 37)",
  " (in 'jm', line 808, column 9 to column 37)",
  " (in 'jm', line 807, column 25 to column 32)",
  " (in 'jm', line 807, column 4 to line 808, column 37)",
  " (in 'jm', line 809, column 4 to column 14)",
  " (in 'jm', line 805, column 39 to line 810, column 3)",
  " (in 'jm', line 820, column 4 to column 57)",
  " (in 'jm', line 819, column 30 to line 821, column 3)",
  " (in 'jm', line 823, column 4 to column 57)",
  " (in 'jm', line 822, column 30 to line 824, column 3)",
  " (in 'jm', line 833, column 10 to column 30)",
  " (in 'jm', line 833, column 4 to column 44)",
  " (in 'jm', line 834, column 4 to column 17)",
  " (in 'jm', line 837, column 8 to column 42)",
  " (in 'jm', line 838, column 8 to column 18)",
  " (in 'jm', line 836, column 23 to line 839, column 7)",
  " (in 'jm', line 836, column 6 to line 839, column 7)",
  " (in 'jm', line 835, column 21 to line 840, column 5)",
  " (in 'jm', line 835, column 4 to line 840, column 5)",
  " (in 'jm', line 841, column 4 to column 19)",
  " (in 'jm', line 832, column 41 to line 842, column 3)",
  " (in 'jm', line 855, column 4 to column 13)",
  " (in 'jm', line 859, column 6 to column 39)",
  " (in 'jm', line 861, column 8 to column 26)",
  " (in 'jm', line 860, column 6 to line 861, column 26)",
  " (in 'jm', line 858, column 9 to line 862, column 5)",
  " (in 'jm', line 857, column 6 to column 25)",
  " (in 'jm', line 856, column 4 to line 862, column 5)",
  " (in 'jm', line 863, column 4 to column 15)",
  " (in 'jm', line 854, column 51 to line 864, column 3)",
  " (in 'jm', line 879, column 11 to column 23)",
  " (in 'jm', line 879, column 4 to column 30)",
  " (in 'jm', line 902, column 6 to column 77)",
  " (in 'jm', line 901, column 9 to line 902, column 77)",
  " (in 'jm', line 900, column 6 to column 68)",
  " (in 'jm', line 899, column 9 to line 902, column 77)",
  " (in 'jm', line 893, column 6 to column 45)",
  " (in 'jm', line 897, column 8 to column 78)",
  " (in 'jm', line 895, column 8 to column 83)",
  " (in 'jm', line 894, column 6 to line 897, column 78)",
  " (in 'jm', line 892, column 30 to line 898, column 5)",
  " (in 'jm', line 892, column 9 to line 902, column 77)",
  " (in 'jm', line 886, column 6 to column 45)",
  " (in 'jm', line 890, column 8 to column 74)",
  " (in 'jm', line 888, column 8 to column 79)",
  " (in 'jm', line 887, column 6 to line 890, column 74)",
  " (in 'jm', line 885, column 30 to line 891, column 5)",
  " (in 'jm', line 885, column 9 to line 902, column 77)",
  " (in 'jm', line 883, column 6 to column 77)",
  " (in 'jm', line 882, column 60 to line 884, column 5)",
  " (in 'jm', line 882, column 30 to line 884, column 5)",
  " (in 'jm', line 882, column 9 to line 902, column 77)",
  " (in 'jm', line 881, column 30 to column 72)",
  " (in 'jm', line 881, column 9 to line 902, column 77)",
  " (in 'jm', line 880, column 25 to column 39)",
  " (in 'jm', line 880, column 4 to line 902, column 77)",
  " (in 'jm', line 903, column 4 to column 16)",
  " (in 'jm', line 878, column 85 to line 904, column 3)",
  " (in 'jm', line 920, column 11 to column 15)",
  " (in 'jm', line 920, column 16 to column 20)",
  " (in 'jm', line 920, column 4 to column 31)",
  " (in 'jm', line 921, column 4 to column 18)",
  " (in 'jm', line 922, column 4 to column 19)",
  " (in 'jm', line 923, column 4 to column 25)",
  " (in 'jm', line 926, column 8 to column 47)",
  " (in 'jm', line 927, column 8 to column 30)",
  " (in 'jm', line 925, column 25 to line 928, column 7)",
  " (in 'jm', line 925, column 6 to line 928, column 7)",
  " (in 'jm', line 924, column 15 to line 929, column 5)",
  " (in 'jm', line 924, column 4 to line 929, column 5)",
  " (in 'jm', line 936, column 13 to column 15)",
  " (in 'jm', line 936, column 16 to column 18)",
  " (in 'jm', line 936, column 6 to column 48)",
  " (in 'jm', line 938, column 8 to column 41)",
  " (in 'jm', line 939, column 8 to column 26)",
  " (in 'jm', line 941, column 10 to column 43)",
  " (in 'jm', line 942, column 10 to column 28)",
  " (in 'jm', line 940, column 27 to line 943, column 9)",
  " (in 'jm', line 940, column 8 to line 943, column 9)",
  " (in 'jm', line 937, column 22 to line 944, column 7)",
  " (in 'jm', line 937, column 6 to line 944, column 7)",
  " (in 'jm', line 946, column 15 to column 17)",
  " (in 'jm', line 946, column 8 to column 57)",
  " (in 'jm', line 947, column 8 to column 28)",
  " (in 'jm', line 948, column 8 to column 21)",
  " (in 'jm', line 945, column 24 to line 949, column 7)",
  " (in 'jm', line 945, column 6 to line 949, column 7)",
  " (in 'jm', line 935, column 9 to line 950, column 5)",
  " (in 'jm', line 931, column 6 to column 49)",
  " (in 'jm', line 933, column 8 to column 48)",
  " (in 'jm', line 932, column 6 to line 933, column 48)",
  " (in 'jm', line 930, column 17 to line 934, column 5)",
  " (in 'jm', line 930, column 4 to line 950, column 5)",
  " (in 'jm', line 951, column 4 to column 21)",
  " (in 'jm', line 919, column 88 to line 952, column 3)",
  " (in 'jm', line 976, column 4 to column 20)",
  " (in 'jm', line 977, column 4 to column 23)",
  " (in 'jm', line 978, column 4 to column 22)",
  " (in 'jm', line 979, column 4 to column 22)",
  " (in 'jm', line 980, column 11 to column 12)",
  " (in 'jm', line 980, column 4 to column 18)",
  " (in 'jm', line 983, column 9 to column 34)",
  " (in 'jm', line 982, column 15 to column 30)",
  " (in 'jm', line 982, column 4 to line 983, column 34)",
  " (in 'jm', line 988, column 36 to column 63)",
  " (in 'jm', line 988, column 11 to column 63)",
  " (in 'jm', line 987, column 36 to column 63)",
  " (in 'jm', line 987, column 11 to line 988, column 63)",
  " (in 'jm', line 986, column 31 to column 47)",
  " (in 'jm', line 986, column 6 to line 988, column 63)",
  " (in 'jm', line 985, column 28 to line 989, column 5)",
  " (in 'jm', line 985, column 4 to line 989, column 5)",
  " (in 'jm', line 994, column 10 to column 66)",
  " (in 'jm', line 993, column 8 to line 994, column 66)",
  " (in 'jm', line 992, column 6 to line 994, column 66)",
  " (in 'jm', line 991, column 16 to line 995, column 5)",
  " (in 'jm', line 991, column 4 to line 995, column 5)",
  " (in 'jm', line 999, column 10 to column 66)",
  " (in 'jm', line 998, column 8 to line 999, column 66)",
  " (in 'jm', line 997, column 6 to line 999, column 66)",
  " (in 'jm', line 996, column 16 to line 1000, column 5)",
  " (in 'jm', line 996, column 4 to line 1000, column 5)",
  " (in 'jm', line 1002, column 22 to column 37)",
  " (in 'jm', line 1002, column 4 to column 37)",
  " (in 'jm', line 1004, column 4 to column 15)",
  " (in 'jm', line 975, column 53 to line 1005, column 3)",
  " (in 'jm', line 1016, column 11 to column 20)",
  " (in 'jm', line 1016, column 4 to column 25)",
  " (in 'jm', line 1028, column 6 to column 36)",
  " (in 'jm', line 1027, column 9 to line 1028, column 36)",
  " (in 'jm', line 1026, column 6 to column 36)",
  " (in 'jm', line 1025, column 9 to line 1028, column 36)",
  " (in 'jm', line 1024, column 6 to column 35)",
  " (in 'jm', line 1023, column 9 to line 1028, column 36)",
  " (in 'jm', line 1022, column 6 to column 43)",
  " (in 'jm', line 1021, column 9 to line 1028, column 36)",
  " (in 'jm', line 1020, column 6 to column 36)",
  " (in 'jm', line 1019, column 9 to line 1028, column 36)",
  " (in 'jm', line 1018, column 6 to column 36)",
  " (in 'jm', line 1017, column 4 to line 1028, column 36)",
  " (in 'jm', line 1029, column 4 to column 14)",
  " (in 'jm', line 1015, column 55 to line 1030, column 3)",
  " (in 'jm', line 1043, column 4 to column 16)",
  " (in 'jm', line 1071, column 9 to column 35)",
  " (in 'jm', line 1069, column 11 to column 83)",
  " (in 'jm', line 1068, column 23 to column 78)",
  " (in 'jm', line 1068, column 8 to line 1069, column 83)",
  " (in 'jm', line 1067, column 26 to line 1070, column 5)",
  " (in 'jm', line 1067, column 9 to line 1071, column 35)",
  " (in 'jm', line 1065, column 11 to column 68)",
  " (in 'jm', line 1064, column 21 to column 61)",
  " (in 'jm', line 1064, column 6 to line 1065, column 68)",
  " (in 'jm', line 1063, column 41 to line 1066, column 5)",
  " (in 'jm', line 1063, column 9 to line 1071, column 35)",
  " (in 'jm', line 1061, column 6 to column 53)",
  " (in 'jm', line 1060, column 26 to line 1062, column 5)",
  " (in 'jm', line 1060, column 9 to line 1071, column 35)",
  " (in 'jm', line 1058, column 11 to column 69)",
  " (in 'jm', line 1057, column 21 to column 65)",
  " (in 'jm', line 1057, column 6 to line 1058, column 69)",
  " (in 'jm', line 1056, column 26 to line 1059, column 5)",
  " (in 'jm', line 1056, column 9 to line 1071, column 35)",
  " (in 'jm', line 1053, column 6 to line 1054, column 56)",
  " (in 'jm', line 1052, column 26 to line 1055, column 5)",
  " (in 'jm', line 1052, column 9 to line 1071, column 35)",
  " (in 'jm', line 1050, column 6 to column 59)",
  " (in 'jm', line 1049, column 26 to line 1051, column 5)",
  " (in 'jm', line 1049, column 9 to line 1071, column 35)",
  " (in 'jm', line 1047, column 11 to column 56)",
  " (in 'jm', line 1046, column 26 to column 69)",
  " (in 'jm', line 1046, column 11 to line 1047, column 56)",
  " (in 'jm', line 1045, column 21 to column 61)",
  " (in 'jm', line 1045, column 6 to line 1047, column 56)",
  " (in 'jm', line 1044, column 21 to line 1048, column 5)",
  " (in 'jm', line 1044, column 4 to line 1071, column 35)",
  " (in 'jm', line 1072, column 4 to column 14)",
  " (in 'jm', line 1042, column 81 to line 1073, column 3)",
  " (in 'jm', line 1093, column 4 to column 16)",
  " (in 'jm', line 1125, column 6 to column 39)",
  " (in 'jm', line 1124, column 30 to line 1126, column 5)",
  " (in 'jm', line 1124, column 9 to line 1126, column 5)",
  " (in 'jm', line 1120, column 6 to column 39)",
  " (in 'jm', line 1121, column 6 to column 41)",
  " (in 'jm', line 1122, column 6 to column 62)",
  " (in 'jm', line 1119, column 30 to line 1123, column 5)",
  " (in 'jm', line 1119, column 9 to line 1126, column 5)",
  " (in 'jm', line 1116, column 6 to column 39)",
  " (in 'jm', line 1117, column 6 to column 41)",
  " (in 'jm', line 1115, column 30 to line 1118, column 5)",
  " (in 'jm', line 1115, column 9 to line 1126, column 5)",
  " (in 'jm', line 1105, column 6 to column 39)",
  " (in 'jm', line 1106, column 6 to column 41)",
  " (in 'jm', line 1107, column 6 to column 70)",
  " (in 'jm', line 1108, column 6 to column 41)",
  " (in 'jm', line 1110, column 6 to column 76)",
  " (in 'jm', line 1111, column 6 to column 42)",
  " (in 'jm', line 1112, column 6 to column 85)",
  " (in 'jm', line 1113, column 6 to column 64)",
  " (in 'jm', line 1104, column 30 to line 1114, column 5)",
  " (in 'jm', line 1104, column 9 to line 1126, column 5)",
  " (in 'jm', line 1097, column 6 to column 39)",
  " (in 'jm', line 1098, column 6 to column 41)",
  " (in 'jm', line 1099, column 6 to column 70)",
  " (in 'jm', line 1100, column 6 to column 42)",
  " (in 'jm', line 1101, column 6 to column 85)",
  " (in 'jm', line 1102, column 6 to column 64)",
  " (in 'jm', line 1096, column 30 to line 1103, column 5)",
  " (in 'jm', line 1096, column 9 to line 1126, column 5)",
  " (in 'jm', line 1095, column 30 to column 63)",
  " (in 'jm', line 1095, column 9 to line 1126, column 5)",
  " (in 'jm', line 1094, column 30 to column 63)",
  " (in 'jm', line 1094, column 4 to line 1126, column 5)",
  " (in 'jm', line 1127, column 4 to column 14)",
  " (in 'jm', line 1092, column 48 to line 1129, column 3)",
  " (in 'jm', line 1142, column 4 to column 16)",
  " (in 'jm', line 1146, column 6 to column 53)",
  " (in 'jm', line 1145, column 9 to line 1146, column 53)",
  " (in 'jm', line 1144, column 6 to column 46)",
  " (in 'jm', line 1143, column 4 to line 1146, column 53)",
  " (in 'jm', line 1149, column 4 to column 14)",
  " (in 'jm', line 1141, column 80 to line 1150, column 3)",
  " (in 'jm', line 1163, column 4 to column 16)",
  " (in 'jm', line 1170, column 8 to column 49)",
  " (in 'jm', line 1168, column 8 to column 54)",
  " (in 'jm', line 1167, column 11 to line 1170, column 49)",
  " (in 'jm', line 1166, column 8 to column 47)",
  " (in 'jm', line 1165, column 6 to line 1170, column 49)",
  " (in 'jm', line 1164, column 31 to line 1171, column 5)",
  " (in 'jm', line 1164, column 4 to line 1171, column 5)",
  " (in 'jm', line 1172, column 4 to column 14)",
  " (in 'jm', line 1162, column 66 to line 1173, column 3)",
  " (in 'jm', line 1187, column 4 to column 21)",
  " (in 'jm', line 1188, column 4 to column 22)",
  " (in 'jm', line 1218, column 6 to column 40)",
  " (in 'jm', line 1220, column 8 to column 24)",
  " (in 'jm', line 1224, column 10 to column 57)",
  " (in 'jm', line 1222, column 10 to column 29)",
  " (in 'jm', line 1221, column 8 to line 1224, column 57)",
  " (in 'jm', line 1228, column 10 to column 63)",
  " (in 'jm', line 1226, column 10 to column 46)",
  " (in 'jm', line 1225, column 8 to line 1228, column 63)",
  " (in 'jm', line 1219, column 21 to line 1229, column 7)",
  " (in 'jm', line 1219, column 6 to line 1229, column 7)",
  " (in 'jm', line 1217, column 26 to line 1230, column 5)",
  " (in 'jm', line 1217, column 9 to line 1230, column 5)",
  " (in 'jm', line 1209, column 6 to column 40)",
  " (in 'jm', line 1214, column 10 to column 53)",
  " (in 'jm', line 1212, column 10 to column 41)",
  " (in 'jm', line 1211, column 8 to line 1214, column 53)",
  " (in 'jm', line 1210, column 21 to line 1215, column 7)",
  " (in 'jm', line 1210, column 6 to line 1215, column 7)",
  " (in 'jm', line 1208, column 41 to line 1216, column 5)",
  " (in 'jm', line 1208, column 9 to line 1230, column 5)",
  " (in 'jm', line 1206, column 6 to column 53)",
  " (in 'jm', line 1205, column 26 to line 1207, column 5)",
  " (in 'jm', line 1205, column 9 to line 1230, column 5)",
  " (in 'jm', line 1203, column 8 to column 41)",
  " (in 'jm', line 1202, column 6 to line 1203, column 41)",
  " (in 'jm', line 1201, column 26 to line 1204, column 5)",
  " (in 'jm', line 1201, column 9 to line 1230, column 5)",
  " (in 'jm', line 1199, column 8 to column 52)",
  " (in 'jm', line 1198, column 6 to line 1199, column 52)",
  " (in 'jm', line 1197, column 26 to line 1200, column 5)",
  " (in 'jm', line 1197, column 9 to line 1230, column 5)",
  " (in 'jm', line 1195, column 8 to column 54)",
  " (in 'jm', line 1194, column 6 to line 1195, column 54)",
  " (in 'jm', line 1193, column 26 to line 1196, column 5)",
  " (in 'jm', line 1193, column 9 to line 1230, column 5)",
  " (in 'jm', line 1191, column 8 to column 46)",
  " (in 'jm', line 1190, column 6 to line 1191, column 46)",
  " (in 'jm', line 1189, column 21 to line 1192, column 5)",
  " (in 'jm', line 1189, column 4 to line 1230, column 5)",
  " (in 'jm', line 1231, column 4 to column 18)",
  " (in 'jm', line 1232, column 4 to column 20)",
  " (in 'jm', line 1186, column 61 to line 1233, column 3)",
  " (in 'jm', line 1246, column 11 to column 29)",
  " (in 'jm', line 1246, column 4 to column 35)",
  " (in 'jm', line 1250, column 6 to column 40)",
  " (in 'jm', line 1252, column 8 to column 26)",
  " (in 'jm', line 1251, column 6 to line 1252, column 26)",
  " (in 'jm', line 1249, column 9 to line 1253, column 5)",
  " (in 'jm', line 1248, column 6 to column 25)",
  " (in 'jm', line 1247, column 4 to line 1253, column 5)",
  " (in 'jm', line 1254, column 4 to column 15)",
  " (in 'jm', line 1245, column 66 to line 1255, column 3)",
  " (in 'jm', line 1268, column 4 to column 16)",
  " (in 'jm', line 1275, column 8 to column 49)",
  " (in 'jm', line 1273, column 8 to column 54)",
  " (in 'jm', line 1272, column 11 to line 1275, column 49)",
  " (in 'jm', line 1271, column 8 to column 47)",
  " (in 'jm', line 1270, column 6 to line 1275, column 49)",
  " (in 'jm', line 1269, column 18 to line 1276, column 5)",
  " (in 'jm', line 1269, column 4 to line 1276, column 5)",
  " (in 'jm', line 1277, column 4 to column 14)",
  " (in 'jm', line 1267, column 76 to line 1278, column 3)",
  " (in 'jm', line 1296, column 4 to column 26)",
  " (in 'jm', line 1297, column 11 to column 12)",
  " (in 'jm', line 1297, column 4 to column 18)",
  " (in 'jm', line 1312, column 8 to column 53)",
  " (in 'jm', line 1311, column 6 to line 1312, column 53)",
  " (in 'jm', line 1310, column 29 to line 1313, column 5)",
  " (in 'jm', line 1310, column 9 to line 1313, column 5)",
  " (in 'jm', line 1308, column 8 to column 53)",
  " (in 'jm', line 1307, column 6 to line 1308, column 53)",
  " (in 'jm', line 1306, column 29 to line 1309, column 5)",
  " (in 'jm', line 1306, column 9 to line 1313, column 5)",
  " (in 'jm', line 1304, column 8 to column 54)",
  " (in 'jm', line 1303, column 6 to line 1304, column 54)",
  " (in 'jm', line 1302, column 29 to line 1305, column 5)",
  " (in 'jm', line 1302, column 9 to line 1313, column 5)",
  " (in 'jm', line 1300, column 8 to column 53)",
  " (in 'jm', line 1299, column 6 to line 1300, column 53)",
  " (in 'jm', line 1298, column 24 to line 1301, column 5)",
  " (in 'jm', line 1298, column 4 to line 1313, column 5)",
  " (in 'jm', line 1314, column 4 to column 15)",
  " (in 'jm', line 1295, column 47 to line 1315, column 3)",
  " (in 'jm', line 1350, column 4 to column 20)",
  " (in 'jm', line 1351, column 4 to column 20)",
  " (in 'jm', line 1352, column 4 to column 18)",
  " (in 'jm', line 1353, column 11 to column 15)",
  " (in 'jm', line 1353, column 16 to column 32)",
  " (in 'jm', line 1353, column 4 to column 39)",
  " (in 'jm', line 1354, column 12 to column 27)",
  " (in 'jm', line 1354, column 29 to column 45)",
  " (in 'jm', line 1354, column 4 to column 64)",
  " (in 'jm', line 1356, column 9 to column 41)",
  " (in 'jm', line 1355, column 18 to column 34)",
  " (in 'jm', line 1355, column 4 to line 1356, column 41)",
  " (in 'jm', line 1358, column 6 to column 15)",
  " (in 'jm', line 1359, column 6 to column 24)",
  " (in 'jm', line 1360, column 6 to column 15)",
  " (in 'jm', line 1361, column 6 to column 53)",
  " (in 'jm', line 1364, column 10 to column 20)",
  " (in 'jm', line 1365, column 10 to column 22)",
  " (in 'jm', line 1371, column 12 to column 44)",
  " (in 'jm', line 1372, column 12 to column 49)",
  " (in 'jm', line 1370, column 15 to line 1373, column 11)",
  " (in 'jm', line 1367, column 12 to column 22)",
  " (in 'jm', line 1368, column 12 to column 24)",
  " (in 'jm', line 1366, column 22 to line 1369, column 11)",
  " (in 'jm', line 1366, column 10 to line 1373, column 11)",
  " (in 'jm', line 1375, column 12 to column 29)",
  " (in 'jm', line 1376, column 12 to column 74)",
  " (in 'jm', line 1377, column 12 to column 43)",
  " (in 'jm', line 1378, column 12 to column 22)",
  " (in 'jm', line 1374, column 39 to line 1379, column 11)",
  " (in 'jm', line 1374, column 10 to line 1379, column 11)",
  " (in 'jm', line 1363, column 33 to line 1380, column 9)",
  " (in 'jm', line 1363, column 8 to line 1380, column 9)",
  " (in 'jm', line 1362, column 21 to line 1381, column 7)",
  " (in 'jm', line 1362, column 6 to line 1381, column 7)",
  " (in 'jm', line 1357, column 22 to line 1382, column 5)",
  " (in 'jm', line 1357, column 4 to line 1382, column 5)",
  " (in 'jm', line 1384, column 6 to column 39)",
  " (in 'jm', line 1385, column 6 to column 29)",
  " (in 'jm', line 1386, column 6 to column 54)",
  " (in 'jm', line 1383, column 28 to line 1387, column 5)",
  " (in 'jm', line 1383, column 4 to line 1387, column 5)",
  " (in 'jm', line 1388, column 2 to column 26)",
  " (in 'jm', line 1349, column 89 to line 1389, column 3)",
  " (in 'jm', line 1437, column 4 to column 16)",
  " (in 'jm', line 1438, column 4 to column 20)",
  " (in 'jm', line 1439, column 4 to column 18)",
  " (in 'jm', line 1440, column 11 to column 15)",
  " (in 'jm', line 1440, column 16 to column 35)",
  " (in 'jm', line 1440, column 4 to column 42)",
  " (in 'jm', line 1441, column 12 to column 27)",
  " (in 'jm', line 1441, column 29 to column 48)",
  " (in 'jm', line 1441, column 4 to column 70)",
  " (in 'jm', line 1443, column 9 to column 37)",
  " (in 'jm', line 1442, column 18 to column 30)",
  " (in 'jm', line 1442, column 4 to line 1443, column 37)",
  " (in 'jm', line 1445, column 6 to column 15)",
  " (in 'jm', line 1446, column 6 to column 18)",
  " (in 'jm', line 1447, column 6 to column 15)",
  " (in 'jm', line 1448, column 6 to column 33)",
  " (in 'jm', line 1451, column 10 to column 22)",
  " (in 'jm', line 1452, column 10 to column 22)",
  " (in 'jm', line 1453, column 10 to column 23)",
  " (in 'jm', line 1454, column 10 to column 23)",
  " (in 'jm', line 1455, column 10 to column 23)",
  " (in 'jm', line 1456, column 10 to column 25)",
  " (in 'jm', line 1462, column 12 to column 52)",
  " (in 'jm', line 1463, column 12 to column 46)",
  " (in 'jm', line 1464, column 12 to column 55)",
  " (in 'jm', line 1465, column 12 to column 55)",
  " (in 'jm', line 1466, column 12 to column 55)",
  " (in 'jm', line 1467, column 12 to column 42)",
  " (in 'jm', line 1461, column 15 to line 1468, column 11)",
  " (in 'jm', line 1458, column 12 to column 24)",
  " (in 'jm', line 1458, column 25 to column 37)",
  " (in 'jm', line 1458, column 38 to column 51)",
  " (in 'jm', line 1459, column 12 to column 25)",
  " (in 'jm', line 1459, column 26 to column 39)",
  " (in 'jm', line 1459, column 40 to column 55)",
  " (in 'jm', line 1457, column 22 to line 1460, column 11)",
  " (in 'jm', line 1457, column 10 to line 1468, column 11)",
  " (in 'jm', line 1470, column 12 to column 26)",
  " (in 'jm', line 1471, column 12 to column 31)",
  " (in 'jm', line 1472, column 12 to column 29)",
  " (in 'jm', line 1473, column 12 to column 22)",
  " (in 'jm', line 1474, column 12 to column 87)",
  " (in 'jm', line 1475, column 12 to column 62)",
  " (in 'jm', line 1476, column 12 to column 55)",
  " (in 'jm', line 1477, column 12 to column 32)",
  " (in 'jm', line 1493, column 14 to column 41)",
  " (in 'jm', line 1490, column 14 to column 47)",
  " (in 'jm', line 1487, column 44 to line 1491, column 13)",
  " (in 'jm', line 1487, column 17 to line 1493, column 41)",
  " (in 'jm', line 1485, column 16 to column 63)",
  " (in 'jm', line 1484, column 19 to line 1485, column 63)",
  " (in 'jm', line 1483, column 16 to column 63)",
  " (in 'jm', line 1482, column 19 to line 1485, column 63)",
  " (in 'jm', line 1481, column 16 to column 63)",
  " (in 'jm', line 1480, column 14 to line 1485, column 63)",
  " (in 'jm', line 1478, column 64 to line 1486, column 13)",
  " (in 'jm', line 1478, column 12 to line 1493, column 41)",
  " (in 'jm', line 1495, column 12 to column 33)",
  " (in 'jm', line 1496, column 12 to column 22)",
  " (in 'jm', line 1469, column 42 to line 1497, column 11)",
  " (in 'jm', line 1469, column 10 to line 1497, column 11)",
  " (in 'jm', line 1450, column 36 to line 1498, column 9)",
  " (in 'jm', line 1450, column 8 to line 1498, column 9)",
  " (in 'jm', line 1449, column 21 to line 1499, column 7)",
  " (in 'jm', line 1449, column 6 to line 1499, column 7)",
  " (in 'jm', line 1444, column 22 to line 1500, column 5)",
  " (in 'jm', line 1444, column 4 to line 1500, column 5)",
  " (in 'jm', line 1504, column 6 to column 39)",
  " (in 'jm', line 1505, column 6 to column 29)",
  " (in 'jm', line 1506, column 6 to column 58)",
  " (in 'jm', line 1503, column 28 to line 1507, column 5)",
  " (in 'jm', line 1503, column 4 to line 1507, column 5)",
  " (in 'jm', line 1508, column 2 to column 29)",
  " (in 'jm', line 1428, column 76 to line 1509, column 3)"};
template <typename T2__, typename T3__, typename T4__, typename T5__,
          typename T6__, typename T7__,
          stan::require_all_t<stan::is_stan_scalar<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>,
                              stan::is_col_vector<T5__>,
                              stan::is_vt_not_complex<T5__>,
                              stan::is_col_vector<T6__>,
                              stan::is_vt_not_complex<T6__>,
                              stan::is_col_vector<T7__>,
                              stan::is_vt_not_complex<T7__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<T2__, stan::base_type_t<T3__>,
                stan::base_type_t<T4__>, stan::base_type_t<T5__>,
                stan::base_type_t<T6__>,
                stan::promote_args_t<stan::base_type_t<T7__>>>,-1,1>
make_theta_L(const int& len_theta_L, const std::vector<int>& p, const T2__&
             dispersion, const T3__& tau_arg__, const T4__& scale_arg__,
             const T5__& zeta_arg__, const T6__& rho_arg__, const T7__&
             z_T_arg__, std::ostream* pstream__);
template <typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>>,-1,1>
make_b(const T0__& z_b_arg__, const T1__& theta_L_arg__,
       const std::vector<int>& p, const std::vector<int>& l, std::ostream*
       pstream__);
template <bool propto__, typename T0__, typename T1__, typename T2__,
          typename T3__, typename T4__, typename T5__, typename T6__,
          typename T7__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_col_vector<T7__>,
                              stan::is_vt_not_complex<T7__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>,
  stan::base_type_t<T2__>, stan::base_type_t<T3__>, stan::base_type_t<T4__>,
  stan::promote_args_t<T5__, T6__, stan::base_type_t<T7__>>>
decov_lpdf(const T0__& z_b_arg__, const T1__& z_T_arg__, const T2__&
           rho_arg__, const T3__& zeta_arg__, const T4__& tau_arg__,
           const std::vector<T5__>& regularization, const std::vector<T6__>&
           delta, const T7__& shape_arg__, const int& t,
           const std::vector<int>& p, std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__, typename T3__,
          typename T4__, typename T5__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T4__>,
                              stan::is_stan_scalar<T5__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>, T1__, T2__, T3__,
                T4__, stan::promote_args_t<T5__>>,-1,1>
hs_prior(const T0__& z_beta_arg__, const std::vector<T1__>& global,
         const std::vector<Eigen::Matrix<T2__,-1,1>>& local, const T3__&
         global_prior_scale, const T4__& error_scale, const T5__& c2,
         std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__, typename T3__,
          typename T4__, typename T5__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T4__>,
                              stan::is_stan_scalar<T5__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>, T1__, T2__, T3__,
                T4__, stan::promote_args_t<T5__>>,-1,1>
hsplus_prior(const T0__& z_beta_arg__, const std::vector<T1__>& global,
             const std::vector<Eigen::Matrix<T2__,-1,1>>& local, const T3__&
             global_prior_scale, const T4__& error_scale, const T5__& c2,
             std::ostream* pstream__);
template <typename T0__, typename T1__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T1__>>* = nullptr>
stan::promote_args_t<T0__, T1__>
CFt(const T0__& z, const T1__& df, std::ostream* pstream__);
std::vector<std::vector<int>>
make_V(const int& N, const int& t, const std::vector<int>& v, std::ostream*
       pstream__);
double
make_lower(const int& family, const int& link, std::ostream* pstream__);
double
make_upper(const int& family, const int& link, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_bern(const T0__& eta_arg__, const int& link, std::ostream* pstream__);
template <bool propto__, typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>>
bern_lpdf(const T0__& eta0_arg__, const T1__& eta1_arg__, const int& link,
          const std::vector<int>& N, std::ostream* pstream__);
template <typename T1__,
          stan::require_all_t<stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T1__>>,-1,1>
pw_bern(const int& y, const T1__& eta_arg__, const int& link, std::ostream*
        pstream__);
template <typename T2__,
          stan::require_all_t<stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T2__>>
log_clogit_denom(const int& N_j, const int& D_j, const T2__& eta_j_arg__,
                 std::ostream* pstream__);
template <bool propto__, typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>>
clogit_lpdf(const T0__& eta0_arg__, const T1__& eta1_arg__,
            const std::vector<int>& successes, const std::vector<int>&
            failures, const std::vector<int>& observations, std::ostream*
            pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_binom(const T0__& eta_arg__, const int& link, std::ostream* pstream__);
template <bool propto__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T2__>>
binom_lpmf(const std::vector<int>& y, const std::vector<int>& trials,
           const T2__& eta_arg__, const int& link, std::ostream* pstream__);
template <typename T2__,
          stan::require_all_t<stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T2__>>,-1,1>
pw_binom(const std::vector<int>& y, const std::vector<int>& trials,
         const T2__& eta_arg__, const int& link, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_gauss(const T0__& eta_arg__, const int& link, std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T2__>,-1,1>
pw_gauss(const T0__& y_arg__, const T1__& eta_arg__, const T2__& sigma,
         const int& link, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_gamma(const T0__& eta_arg__, const int& link, std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__, typename T4__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T4__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>, T2__,
  T4__>
GammaReg(const T0__& y_arg__, const T1__& eta_arg__, const T2__& shape,
         const int& link, const T4__& sum_log_y, std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T2__>,-1,1>
pw_gamma(const T0__& y_arg__, const T1__& eta_arg__, const T2__& shape,
         const int& link, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_inv_gaussian(const T0__& eta_arg__, const int& link, std::ostream*
                     pstream__);
template <typename T0__, typename T1__, typename T2__, typename T3__,
          typename T4__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>, T2__,
  T3__, stan::base_type_t<T4__>>
inv_gaussian(const T0__& y_arg__, const T1__& mu_arg__, const T2__& lambda,
             const T3__& sum_log_y, const T4__& sqrt_y_arg__, std::ostream*
             pstream__);
template <typename T0__, typename T1__, typename T2__, typename T4__,
          typename T5__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>,
                              stan::is_col_vector<T5__>,
                              stan::is_vt_not_complex<T5__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T2__, stan::base_type_t<T4__>,
                stan::base_type_t<T5__>>,-1,1>
pw_inv_gaussian(const T0__& y_arg__, const T1__& eta_arg__, const T2__&
                lambda, const int& link, const T4__& log_y_arg__, const T5__&
                sqrt_y_arg__, std::ostream* pstream__);
template <typename T0__, typename T1__, typename RNG,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T1__>>* = nullptr>
stan::promote_args_t<T0__, T1__>
inv_gaussian_rng(const T0__& mu, const T1__& lambda, RNG& base_rng__,
                 std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_beta(const T0__& eta_arg__, const int& link, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_beta_z(const T0__& eta_arg__, const int& link, std::ostream*
               pstream__);
template <typename T0__, typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T2__>,-1,1>
pw_beta(const T0__& y_arg__, const T1__& eta_arg__, const T2__& dispersion,
        const int& link, std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, stan::base_type_t<T2__>>,-1,1>
pw_beta_z(const T0__& y_arg__, const T1__& eta_arg__, const T2__&
          eta_z_arg__, const int& link, const int& link_phi, std::ostream*
          pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_count(const T0__& eta_arg__, const int& link, std::ostream* pstream__);
template <typename T1__,
          stan::require_all_t<stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T1__>>,-1,1>
pw_pois(const std::vector<int>& y, const T1__& eta_arg__, const int& link,
        std::ostream* pstream__);
template <typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T1__>, T2__>,-1,1>
pw_nb(const std::vector<int>& y, const T1__& eta_arg__, const T2__& theta,
      const int& link, std::ostream* pstream__);
int get_nvars_for_hs(const int& prior_dist, std::ostream* pstream__);
double lb(const int& intercept_type, std::ostream* pstream__);
double ub(const int& intercept_type, std::ostream* pstream__);
std::vector<int> lower_tri_indices(const int& dim, std::ostream* pstream__);
template <typename T0__, typename T2__, typename T3__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>>* = nullptr>
stan::promote_args_t<T0__, T2__, T3__>
make_aux(const T0__& aux_unscaled, const int& prior_dist, const T2__&
         prior_mean, const T3__& prior_scale, std::ostream* pstream__);
template <typename T0__, typename T2__, typename T3__, typename T4__,
          typename T5__, typename T6__, typename T7__, typename T8__,
          typename T9__, typename T10__, typename T12__, typename T13__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_stan_scalar<T7__>,
                              stan::is_stan_scalar<T8__>,
                              stan::is_stan_scalar<T9__>,
                              stan::is_stan_scalar<T10__>,
                              stan::is_stan_scalar<T12__>,
                              stan::is_stan_scalar<T13__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T2__>, stan::base_type_t<T3__>,
                stan::base_type_t<T4__>, T5__,
                stan::promote_args_t<T6__, T7__, T8__, T9__, T10__,
                  stan::promote_args_t<T12__, T13__>>>,-1,1>
make_beta(const T0__& z_beta_arg__, const int& prior_dist, const T2__&
          prior_mean_arg__, const T3__& prior_scale_arg__, const T4__&
          prior_df_arg__, const T5__& global_prior_scale,
          const std::vector<T6__>& global,
          const std::vector<Eigen::Matrix<T7__,-1,1>>& local,
          const std::vector<T8__>& ool,
          const std::vector<Eigen::Matrix<T9__,-1,1>>& mix,
          const std::vector<T10__>& aux, const int& family, const T12__&
          slab_scale, const std::vector<T13__>& caux, std::ostream* pstream__);
template <typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>>,-1,-1>
make_b_matrix(const T0__& z_b_arg__, const T1__& theta_L_arg__,
              const std::vector<int>& p, const std::vector<int>& l,
              const int& i, std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__, typename T5__,
          typename T6__, typename T7__, typename T8__, typename T12__,
          stan::require_all_t<stan::is_eigen_matrix_dynamic<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_col_vector<T6__>,
                              stan::is_vt_not_complex<T6__>,
                              stan::is_eigen_matrix_dynamic<T7__>,
                              stan::is_vt_not_complex<T7__>,
                              stan::is_eigen_matrix_dynamic<T8__>,
                              stan::is_vt_not_complex<T8__>,
                              stan::is_col_vector<T12__>,
                              stan::is_vt_not_complex<T12__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>, T1__, T2__, T5__,
                stan::base_type_t<T6__>,
                stan::promote_args_t<stan::base_type_t<T7__>,
                  stan::base_type_t<T8__>, stan::base_type_t<T12__>>>,-1,1>
evaluate_eta(const T0__& X_arg__,
             const std::vector<Eigen::Matrix<T1__,-1,1>>& Z1,
             const std::vector<Eigen::Matrix<T2__,-1,1>>& Z2,
             const std::vector<int>& Z1_id, const std::vector<int>& Z2_id,
             const std::vector<T5__>& gamma, const T6__& beta_arg__,
             const T7__& b1Mat_arg__, const T8__& b2Mat_arg__, const int&
             b1Mat_colshift, const int& b2Mat_colshift, const int&
             intercept_type, const T12__& Ti_arg__, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
evaluate_mu(const T0__& eta_arg__, const int& family, const int& link,
            std::ostream* pstream__);
template <bool propto__, typename T0__, typename T2__, typename T3__,
          typename T6__, typename T7__, typename T8__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_col_vector<T7__>,
                              stan::is_vt_not_complex<T7__>,
                              stan::is_col_vector<T8__>,
                              stan::is_vt_not_complex<T8__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T2__>, T3__,
  T6__, stan::base_type_t<T7__>,
  stan::promote_args_t<stan::base_type_t<T8__>>>
glm_lpdf(const T0__& y_real_arg__, const std::vector<int>& y_integer,
         const T2__& eta_arg__, const std::vector<T3__>& aux, const int&
         family, const int& link, const T6__& sum_log_y, const T7__&
         sqrt_y_arg__, const T8__& log_y_arg__, std::ostream* pstream__);
template <bool propto__, typename T0__, typename T2__, typename T3__,
          typename T4__, typename T5__, typename T6__, typename T7__,
          typename T8__, typename T9__, typename T10__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_stan_scalar<T4__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_stan_scalar<T7__>,
                              stan::is_stan_scalar<T8__>,
                              stan::is_stan_scalar<T9__>,
                              stan::is_stan_scalar<T10__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T2__>,
  stan::base_type_t<T3__>, T4__, T5__,
  stan::promote_args_t<T6__, T7__, T8__, T9__, T10__>>
beta_custom_lpdf(const T0__& z_beta_arg__, const int& prior_dist, const T2__&
                 prior_scale_arg__, const T3__& prior_df_arg__, const T4__&
                 global_prior_df,
                 const std::vector<Eigen::Matrix<T5__,-1,1>>& local,
                 const std::vector<T6__>& global,
                 const std::vector<Eigen::Matrix<T7__,-1,1>>& mix,
                 const std::vector<T8__>& one_over_lambda, const T9__&
                 slab_df, const std::vector<T10__>& caux, std::ostream*
                 pstream__);
template <bool propto__, typename T0__, typename T2__, typename T3__,
          typename T4__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T4__>>* = nullptr>
stan::promote_args_t<T0__, T2__, T3__, T4__>
gamma_custom_lpdf(const T0__& gamma, const int& dist, const T2__& mean_,
                  const T3__& scale, const T4__& df, std::ostream* pstream__);
template <bool propto__, typename T0__, typename T2__, typename T3__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>>* = nullptr>
stan::promote_args_t<T0__, T2__, T3__>
aux_lpdf(const T0__& aux_unscaled, const int& dist, const T2__& scale,
         const T3__& df, std::ostream* pstream__);
template <typename T0__, typename T1__, typename RNG,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, T1__>
mean_PPD_rng(const T0__& mu_arg__, const std::vector<T1__>& aux, const int&
             family, RNG& base_rng__, std::ostream* pstream__);
template <typename T0__, typename T2__, typename T3__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T2__>, stan::base_type_t<T3__>>,-1,1>
make_basehaz_coef(const T0__& aux_unscaled_arg__, const int& prior_dist,
                  const T2__& prior_mean_arg__, const T3__&
                  prior_scale_arg__, std::ostream* pstream__);
template <bool propto__, typename T0__, typename T2__, typename T3__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T2__>,
  stan::base_type_t<T3__>>
basehaz_lpdf(const T0__& aux_unscaled_arg__, const int& dist, const T2__&
             scale_arg__, const T3__& df_arg__, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
collapse_within_groups(const T0__& eta_arg__,
                       const std::vector<std::vector<int>>& grp_idx,
                       const int& grp_assoc, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,-1>
make_x_assoc_shared_b(const T0__& b_arg__, const std::vector<int>& l,
                      const std::vector<int>& p,
                      const std::vector<std::vector<int>>& pmat, const int&
                      Npat, const int& qnodes, const std::vector<int>&
                      which_b, const int& sum_size_which_b,
                      const std::vector<int>& size_which_b, const int& t_i,
                      const int& M, std::ostream* pstream__);
template <typename T0__, typename T1__, typename T18__, typename T19__,
          typename T20__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T18__>,
                              stan::is_stan_scalar<T19__>,
                              stan::is_stan_scalar<T20__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T18__, T19__, T20__>,-1,-1>
make_x_assoc_shared_coef(const T0__& b_arg__, const T1__& beta_arg__,
                         const std::vector<int>& KM, const int& M, const int&
                         t_i, const std::vector<int>& l,
                         const std::vector<int>& p,
                         const std::vector<std::vector<int>>& pmat,
                         const int& Npat, const int& qnodes, const int&
                         sum_size_which_coef, const std::vector<int>&
                         size_which_coef, const std::vector<int>&
                         which_coef_zindex, const std::vector<int>&
                         which_coef_xindex, const std::vector<int>&
                         has_intercept, const std::vector<int>&
                         has_intercept_nob, const std::vector<int>&
                         has_intercept_lob, const std::vector<int>&
                         has_intercept_upb, const std::vector<T18__>&
                         gamma_nob, const std::vector<T19__>& gamma_lob,
                         const std::vector<T20__>& gamma_upb, std::ostream*
                         pstream__);
template <typename T2__, typename T3__, typename T4__, typename T5__,
          typename T6__, typename T7__,
          stan::require_all_t<stan::is_stan_scalar<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>,
                              stan::is_col_vector<T5__>,
                              stan::is_vt_not_complex<T5__>,
                              stan::is_col_vector<T6__>,
                              stan::is_vt_not_complex<T6__>,
                              stan::is_col_vector<T7__>,
                              stan::is_vt_not_complex<T7__>>*>
Eigen::Matrix<stan::promote_args_t<T2__, stan::base_type_t<T3__>,
                stan::base_type_t<T4__>, stan::base_type_t<T5__>,
                stan::base_type_t<T6__>,
                stan::promote_args_t<stan::base_type_t<T7__>>>,-1,1>
make_theta_L(const int& len_theta_L, const std::vector<int>& p, const T2__&
             dispersion, const T3__& tau_arg__, const T4__& scale_arg__,
             const T5__& zeta_arg__, const T6__& rho_arg__, const T7__&
             z_T_arg__, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<T2__,
                             stan::base_type_t<T3__>,
                             stan::base_type_t<T4__>,
                             stan::base_type_t<T5__>,
                             stan::base_type_t<T6__>,
                             stan::promote_args_t<stan::base_type_t<T7__>>>;
  int current_statement__ = 0;
  const auto& tau = stan::math::to_ref(tau_arg__);
  const auto& scale = stan::math::to_ref(scale_arg__);
  const auto& zeta = stan::math::to_ref(zeta_arg__);
  const auto& rho = stan::math::to_ref(rho_arg__);
  const auto& z_T = stan::math::to_ref(z_T_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1147;
    stan::math::validate_non_negative_index("theta_L", "len_theta_L",
      len_theta_L);
    Eigen::Matrix<local_scalar_t__,-1,1> theta_L =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(len_theta_L,
        DUMMY_VAR__);
    int zeta_mark = std::numeric_limits<int>::min();
    current_statement__ = 1149;
    zeta_mark = 1;
    int rho_mark = std::numeric_limits<int>::min();
    current_statement__ = 1150;
    rho_mark = 1;
    int z_T_mark = std::numeric_limits<int>::min();
    current_statement__ = 1151;
    z_T_mark = 1;
    int theta_L_mark = std::numeric_limits<int>::min();
    current_statement__ = 1152;
    theta_L_mark = 1;
    current_statement__ = 1194;
    for (int i = 1; i <= stan::math::size(p); ++i) {
      int nc = std::numeric_limits<int>::min();
      current_statement__ = 1153;
      nc = stan::model::rvalue(p, "p", stan::model::index_uni(i));
      current_statement__ = 1192;
      if (stan::math::logical_eq(nc, 1)) {
        current_statement__ = 1189;
        stan::model::assign(theta_L,
          ((stan::model::rvalue(tau, "tau", stan::model::index_uni(i)) *
          stan::model::rvalue(scale, "scale", stan::model::index_uni(i))) *
          dispersion), "assigning variable theta_L",
          stan::model::index_uni(theta_L_mark));
        current_statement__ = 1190;
        theta_L_mark = (theta_L_mark + 1);
      } else {
        current_statement__ = 1154;
        stan::math::validate_non_negative_index("T_i", "nc", nc);
        current_statement__ = 1155;
        stan::math::validate_non_negative_index("T_i", "nc", nc);
        Eigen::Matrix<local_scalar_t__,-1,-1> T_i =
          Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(nc, nc,
            DUMMY_VAR__);
        local_scalar_t__ std_dev = DUMMY_VAR__;
        local_scalar_t__ T21 = DUMMY_VAR__;
        local_scalar_t__ trace_T_i = DUMMY_VAR__;
        current_statement__ = 1159;
        trace_T_i = (stan::math::square(
                       ((stan::model::rvalue(tau, "tau",
                           stan::model::index_uni(i)) *
                       stan::model::rvalue(scale, "scale",
                         stan::model::index_uni(i))) * dispersion))
          * nc);
        current_statement__ = 1160;
        stan::math::validate_non_negative_index("pi", "nc", nc);
        Eigen::Matrix<local_scalar_t__,-1,1> pi =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nc, DUMMY_VAR__);
        current_statement__ = 1161;
        stan::model::assign(pi, stan::math::segment(zeta, zeta_mark, nc),
          "assigning variable pi");
        current_statement__ = 1162;
        stan::model::assign(pi,
          stan::math::divide(stan::model::deep_copy(pi), stan::math::sum(pi)),
          "assigning variable pi");
        current_statement__ = 1163;
        zeta_mark = (zeta_mark + nc);
        current_statement__ = 1164;
        std_dev = stan::math::sqrt(
                    (stan::model::rvalue(pi, "pi", stan::model::index_uni(1))
                    * trace_T_i));
        current_statement__ = 1165;
        stan::model::assign(T_i, std_dev, "assigning variable T_i",
          stan::model::index_uni(1), stan::model::index_uni(1));
        current_statement__ = 1166;
        std_dev = stan::math::sqrt(
                    (stan::model::rvalue(pi, "pi", stan::model::index_uni(2))
                    * trace_T_i));
        current_statement__ = 1167;
        T21 = ((2.0 *
          stan::model::rvalue(rho, "rho", stan::model::index_uni(rho_mark)))
          - 1.0);
        current_statement__ = 1168;
        rho_mark = (rho_mark + 1);
        current_statement__ = 1169;
        stan::model::assign(T_i, (std_dev *
          stan::math::sqrt((1.0 - stan::math::square(T21)))),
          "assigning variable T_i", stan::model::index_uni(2),
          stan::model::index_uni(2));
        current_statement__ = 1170;
        stan::model::assign(T_i, (std_dev * T21), "assigning variable T_i",
          stan::model::index_uni(2), stan::model::index_uni(1));
        current_statement__ = 1182;
        for (int r = 2; r <= (nc - 1); ++r) {
          int rp1 = std::numeric_limits<int>::min();
          current_statement__ = 1171;
          rp1 = (r + 1);
          current_statement__ = 1172;
          stan::math::validate_non_negative_index("T_row", "r", r);
          Eigen::Matrix<local_scalar_t__,-1,1> T_row =
            Eigen::Matrix<local_scalar_t__,-1,1>::Constant(r, DUMMY_VAR__);
          current_statement__ = 1173;
          stan::model::assign(T_row, stan::math::segment(z_T, z_T_mark, r),
            "assigning variable T_row");
          local_scalar_t__ scale_factor = DUMMY_VAR__;
          current_statement__ = 1174;
          scale_factor = (stan::math::sqrt(
                            (stan::model::rvalue(rho, "rho",
                               stan::model::index_uni(rho_mark)) /
                            stan::math::dot_self(T_row)))
            * std_dev);
          current_statement__ = 1175;
          z_T_mark = (z_T_mark + r);
          current_statement__ = 1176;
          std_dev = stan::math::sqrt(
                      (stan::model::rvalue(pi, "pi",
                         stan::model::index_uni(rp1)) * trace_T_i));
          current_statement__ = 1178;
          for (int c = 1; c <= r; ++c) {
            current_statement__ = 1177;
            stan::model::assign(T_i,
              (stan::model::rvalue(T_row, "T_row", stan::model::index_uni(c))
              * scale_factor), "assigning variable T_i",
              stan::model::index_uni(rp1), stan::model::index_uni(c));
          }
          current_statement__ = 1179;
          stan::model::assign(T_i,
            (stan::math::sqrt((1.0 -
               stan::model::rvalue(rho, "rho",
                 stan::model::index_uni(rho_mark)))) * std_dev),
            "assigning variable T_i", stan::model::index_uni(rp1),
            stan::model::index_uni(rp1));
          current_statement__ = 1180;
          rho_mark = (rho_mark + 1);
        }
        current_statement__ = 1187;
        for (int c = 1; c <= nc; ++c) {
          current_statement__ = 1186;
          for (int r = c; r <= nc; ++r) {
            current_statement__ = 1183;
            stan::model::assign(theta_L,
              stan::model::rvalue(T_i, "T_i", stan::model::index_uni(r),
                stan::model::index_uni(c)), "assigning variable theta_L",
              stan::model::index_uni(theta_L_mark));
            current_statement__ = 1184;
            theta_L_mark = (theta_L_mark + 1);
          }
        }
      }
    }
    current_statement__ = 1195;
    return theta_L;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>>,-1,1>
make_b(const T0__& z_b_arg__, const T1__& theta_L_arg__,
       const std::vector<int>& p, const std::vector<int>& l, std::ostream*
       pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>>;
  int current_statement__ = 0;
  const auto& z_b = stan::math::to_ref(z_b_arg__);
  const auto& theta_L = stan::math::to_ref(theta_L_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1197;
    stan::math::validate_non_negative_index("b", "rows(z_b)",
      stan::math::rows(z_b));
    Eigen::Matrix<local_scalar_t__,-1,1> b =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(z_b),
        DUMMY_VAR__);
    int b_mark = std::numeric_limits<int>::min();
    current_statement__ = 1199;
    b_mark = 1;
    int theta_L_mark = std::numeric_limits<int>::min();
    current_statement__ = 1200;
    theta_L_mark = 1;
    current_statement__ = 1230;
    for (int i = 1; i <= stan::math::size(p); ++i) {
      int nc = std::numeric_limits<int>::min();
      current_statement__ = 1201;
      nc = stan::model::rvalue(p, "p", stan::model::index_uni(i));
      current_statement__ = 1228;
      if (stan::math::logical_eq(nc, 1)) {
        local_scalar_t__ theta_L_start = DUMMY_VAR__;
        current_statement__ = 1222;
        theta_L_start = stan::model::rvalue(theta_L, "theta_L",
                          stan::model::index_uni(theta_L_mark));
        current_statement__ = 1224;
        for (int s = b_mark; s <= ((b_mark +
             stan::model::rvalue(l, "l", stan::model::index_uni(i))) -
             1); ++s) {
          current_statement__ = 1223;
          stan::model::assign(b, (theta_L_start *
            stan::model::rvalue(z_b, "z_b", stan::model::index_uni(s))),
            "assigning variable b", stan::model::index_uni(s));
        }
        current_statement__ = 1225;
        b_mark = (b_mark +
          stan::model::rvalue(l, "l", stan::model::index_uni(i)));
        current_statement__ = 1226;
        theta_L_mark = (theta_L_mark + 1);
      } else {
        current_statement__ = 1202;
        stan::math::validate_non_negative_index("T_i", "nc", nc);
        current_statement__ = 1203;
        stan::math::validate_non_negative_index("T_i", "nc", nc);
        Eigen::Matrix<local_scalar_t__,-1,-1> T_i =
          Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(nc, nc,
            DUMMY_VAR__);
        current_statement__ = 1204;
        stan::model::assign(T_i, stan::math::rep_matrix(0, nc, nc),
          "assigning variable T_i");
        current_statement__ = 1212;
        for (int c = 1; c <= nc; ++c) {
          current_statement__ = 1205;
          stan::model::assign(T_i,
            stan::model::rvalue(theta_L, "theta_L",
              stan::model::index_uni(theta_L_mark)),
            "assigning variable T_i", stan::model::index_uni(c),
            stan::model::index_uni(c));
          current_statement__ = 1206;
          theta_L_mark = (theta_L_mark + 1);
          current_statement__ = 1210;
          for (int r = (c + 1); r <= nc; ++r) {
            current_statement__ = 1207;
            stan::model::assign(T_i,
              stan::model::rvalue(theta_L, "theta_L",
                stan::model::index_uni(theta_L_mark)),
              "assigning variable T_i", stan::model::index_uni(r),
              stan::model::index_uni(c));
            current_statement__ = 1208;
            theta_L_mark = (theta_L_mark + 1);
          }
        }
        current_statement__ = 1220;
        for (int j = 1; j <=
             stan::model::rvalue(l, "l", stan::model::index_uni(i)); ++j) {
          current_statement__ = 1213;
          stan::math::validate_non_negative_index("temp", "nc", nc);
          Eigen::Matrix<local_scalar_t__,-1,1> temp =
            Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nc, DUMMY_VAR__);
          current_statement__ = 1214;
          stan::model::assign(temp,
            stan::math::multiply(T_i, stan::math::segment(z_b, b_mark, nc)),
            "assigning variable temp");
          current_statement__ = 1215;
          b_mark = (b_mark - 1);
          current_statement__ = 1217;
          for (int s = 1; s <= nc; ++s) {
            current_statement__ = 1216;
            stan::model::assign(b,
              stan::model::rvalue(temp, "temp", stan::model::index_uni(s)),
              "assigning variable b", stan::model::index_uni((b_mark + s)));
          }
          current_statement__ = 1218;
          b_mark = (b_mark + (nc + 1));
        }
      }
    }
    current_statement__ = 1231;
    return b;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T1__, typename T2__,
          typename T3__, typename T4__, typename T5__, typename T6__,
          typename T7__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_col_vector<T7__>,
                              stan::is_vt_not_complex<T7__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>,
  stan::base_type_t<T2__>, stan::base_type_t<T3__>, stan::base_type_t<T4__>,
  stan::promote_args_t<T5__, T6__, stan::base_type_t<T7__>>>
decov_lpdf(const T0__& z_b_arg__, const T1__& z_T_arg__, const T2__&
           rho_arg__, const T3__& zeta_arg__, const T4__& tau_arg__,
           const std::vector<T5__>& regularization, const std::vector<T6__>&
           delta, const T7__& shape_arg__, const int& t,
           const std::vector<int>& p, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>,
                             stan::base_type_t<T2__>,
                             stan::base_type_t<T3__>,
                             stan::base_type_t<T4__>,
                             stan::promote_args_t<T5__, T6__,
                               stan::base_type_t<T7__>>>;
  int current_statement__ = 0;
  const auto& z_b = stan::math::to_ref(z_b_arg__);
  const auto& z_T = stan::math::to_ref(z_T_arg__);
  const auto& rho = stan::math::to_ref(rho_arg__);
  const auto& zeta = stan::math::to_ref(zeta_arg__);
  const auto& tau = stan::math::to_ref(tau_arg__);
  const auto& shape = stan::math::to_ref(shape_arg__);
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 1233;
    lp = 0;
    int pos_reg = std::numeric_limits<int>::min();
    current_statement__ = 1234;
    pos_reg = 1;
    int pos_rho = std::numeric_limits<int>::min();
    current_statement__ = 1235;
    pos_rho = 1;
    current_statement__ = 1236;
    lp = (lp + stan::math::normal_lpdf<false>(z_b, 0, 1));
    current_statement__ = 1237;
    lp = (lp + stan::math::normal_lpdf<false>(z_T, 0, 1));
    current_statement__ = 1255;
    for (int i = 1; i <= t; ++i) {
      current_statement__ = 1254;
      if (stan::math::logical_gt(
            stan::model::rvalue(p, "p", stan::model::index_uni(i)), 1)) {
        current_statement__ = 1238;
        stan::math::validate_non_negative_index("shape1", "p[i] - 1",
          (stan::model::rvalue(p, "p", stan::model::index_uni(i)) - 1));
        Eigen::Matrix<local_scalar_t__,-1,1> shape1 =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant((stan::model::rvalue(
                                                            p, "p",
                                                            stan::model::index_uni(
                                                              i)) - 1),
            DUMMY_VAR__);
        current_statement__ = 1240;
        stan::math::validate_non_negative_index("shape2", "p[i] - 1",
          (stan::model::rvalue(p, "p", stan::model::index_uni(i)) - 1));
        Eigen::Matrix<local_scalar_t__,-1,1> shape2 =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant((stan::model::rvalue(
                                                            p, "p",
                                                            stan::model::index_uni(
                                                              i)) - 1),
            DUMMY_VAR__);
        local_scalar_t__ nu = DUMMY_VAR__;
        current_statement__ = 1242;
        nu = (stan::model::rvalue(regularization, "regularization",
                stan::model::index_uni(pos_reg))
          + (0.5 * (stan::model::rvalue(p, "p", stan::model::index_uni(i)) -
          2)));
        current_statement__ = 1243;
        pos_reg = (pos_reg + 1);
        current_statement__ = 1244;
        stan::model::assign(shape1, nu, "assigning variable shape1",
          stan::model::index_uni(1));
        current_statement__ = 1245;
        stan::model::assign(shape2, nu, "assigning variable shape2",
          stan::model::index_uni(1));
        current_statement__ = 1250;
        for (int j = 2; j <=
             (stan::model::rvalue(p, "p", stan::model::index_uni(i)) -
             1); ++j) {
          current_statement__ = 1246;
          nu = (nu - 0.5);
          current_statement__ = 1247;
          stan::model::assign(shape1, (0.5 * j), "assigning variable shape1",
            stan::model::index_uni(j));
          current_statement__ = 1248;
          stan::model::assign(shape2, nu, "assigning variable shape2",
            stan::model::index_uni(j));
        }
        current_statement__ = 1251;
        lp = (lp +
          stan::math::beta_lpdf<false>(
            stan::model::rvalue(rho, "rho",
              stan::model::index_min_max(pos_rho, ((pos_rho +
                stan::model::rvalue(p, "p", stan::model::index_uni(i))) - 2))),
            shape1, shape2));
        current_statement__ = 1252;
        pos_rho = (pos_rho +
          (stan::model::rvalue(p, "p", stan::model::index_uni(i)) - 1));
      }
    }
    current_statement__ = 1256;
    lp = (lp + stan::math::gamma_lpdf<false>(zeta, delta, 1));
    current_statement__ = 1257;
    lp = (lp + stan::math::gamma_lpdf<false>(tau, shape, 1));
    current_statement__ = 1258;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename T2__, typename T3__,
          typename T4__, typename T5__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T4__>,
                              stan::is_stan_scalar<T5__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>, T1__, T2__, T3__,
                T4__, stan::promote_args_t<T5__>>,-1,1>
hs_prior(const T0__& z_beta_arg__, const std::vector<T1__>& global,
         const std::vector<Eigen::Matrix<T2__,-1,1>>& local, const T3__&
         global_prior_scale, const T4__& error_scale, const T5__& c2,
         std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             T1__, T2__, T3__, T4__,
                             stan::promote_args_t<T5__>>;
  int current_statement__ = 0;
  const auto& z_beta = stan::math::to_ref(z_beta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int K = std::numeric_limits<int>::min();
    current_statement__ = 1260;
    K = stan::math::rows(z_beta);
    current_statement__ = 1261;
    stan::math::validate_non_negative_index("lambda", "K", K);
    Eigen::Matrix<local_scalar_t__,-1,1> lambda =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__);
    current_statement__ = 1262;
    stan::model::assign(lambda,
      stan::math::elt_multiply(
        stan::model::rvalue(local, "local", stan::model::index_uni(1)),
        stan::math::sqrt(
          stan::model::rvalue(local, "local", stan::model::index_uni(2)))),
      "assigning variable lambda");
    local_scalar_t__ tau = DUMMY_VAR__;
    current_statement__ = 1263;
    tau = (((stan::model::rvalue(global, "global", stan::model::index_uni(1))
      *
      stan::math::sqrt(
        stan::model::rvalue(global, "global", stan::model::index_uni(2))))
      * global_prior_scale) * error_scale);
    current_statement__ = 1264;
    stan::math::validate_non_negative_index("lambda2", "K", K);
    Eigen::Matrix<local_scalar_t__,-1,1> lambda2 =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__);
    current_statement__ = 1265;
    stan::model::assign(lambda2, stan::math::square(lambda),
      "assigning variable lambda2");
    current_statement__ = 1266;
    stan::math::validate_non_negative_index("lambda_tilde", "K", K);
    Eigen::Matrix<local_scalar_t__,-1,1> lambda_tilde =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__);
    current_statement__ = 1267;
    stan::model::assign(lambda_tilde,
      stan::math::sqrt(
        stan::math::elt_divide(stan::math::multiply(c2, lambda2),
          stan::math::add(c2,
            stan::math::multiply(stan::math::square(tau), lambda2)))),
      "assigning variable lambda_tilde");
    current_statement__ = 1268;
    return stan::math::multiply(
             stan::math::elt_multiply(z_beta, lambda_tilde), tau);
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename T2__, typename T3__,
          typename T4__, typename T5__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T4__>,
                              stan::is_stan_scalar<T5__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>, T1__, T2__, T3__,
                T4__, stan::promote_args_t<T5__>>,-1,1>
hsplus_prior(const T0__& z_beta_arg__, const std::vector<T1__>& global,
             const std::vector<Eigen::Matrix<T2__,-1,1>>& local, const T3__&
             global_prior_scale, const T4__& error_scale, const T5__& c2,
             std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             T1__, T2__, T3__, T4__,
                             stan::promote_args_t<T5__>>;
  int current_statement__ = 0;
  const auto& z_beta = stan::math::to_ref(z_beta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int K = std::numeric_limits<int>::min();
    current_statement__ = 1270;
    K = stan::math::rows(z_beta);
    current_statement__ = 1271;
    stan::math::validate_non_negative_index("lambda", "K", K);
    Eigen::Matrix<local_scalar_t__,-1,1> lambda =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__);
    current_statement__ = 1272;
    stan::model::assign(lambda,
      stan::math::elt_multiply(
        stan::model::rvalue(local, "local", stan::model::index_uni(1)),
        stan::math::sqrt(
          stan::model::rvalue(local, "local", stan::model::index_uni(2)))),
      "assigning variable lambda");
    current_statement__ = 1273;
    stan::math::validate_non_negative_index("eta", "K", K);
    Eigen::Matrix<local_scalar_t__,-1,1> eta =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__);
    current_statement__ = 1274;
    stan::model::assign(eta,
      stan::math::elt_multiply(
        stan::model::rvalue(local, "local", stan::model::index_uni(3)),
        stan::math::sqrt(
          stan::model::rvalue(local, "local", stan::model::index_uni(4)))),
      "assigning variable eta");
    local_scalar_t__ tau = DUMMY_VAR__;
    current_statement__ = 1275;
    tau = (((stan::model::rvalue(global, "global", stan::model::index_uni(1))
      *
      stan::math::sqrt(
        stan::model::rvalue(global, "global", stan::model::index_uni(2))))
      * global_prior_scale) * error_scale);
    current_statement__ = 1276;
    stan::math::validate_non_negative_index("lambda_eta2", "K", K);
    Eigen::Matrix<local_scalar_t__,-1,1> lambda_eta2 =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__);
    current_statement__ = 1277;
    stan::model::assign(lambda_eta2,
      stan::math::square(stan::math::elt_multiply(lambda, eta)),
      "assigning variable lambda_eta2");
    current_statement__ = 1278;
    stan::math::validate_non_negative_index("lambda_tilde", "K", K);
    Eigen::Matrix<local_scalar_t__,-1,1> lambda_tilde =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__);
    current_statement__ = 1279;
    stan::model::assign(lambda_tilde,
      stan::math::sqrt(
        stan::math::elt_divide(stan::math::multiply(c2, lambda_eta2),
          stan::math::add(c2,
            stan::math::multiply(stan::math::square(tau), lambda_eta2)))),
      "assigning variable lambda_tilde");
    current_statement__ = 1280;
    return stan::math::multiply(
             stan::math::elt_multiply(z_beta, lambda_tilde), tau);
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T1__>>*>
stan::promote_args_t<T0__, T1__>
CFt(const T0__& z, const T1__& df, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<T0__, T1__>;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ z2 = DUMMY_VAR__;
    current_statement__ = 1282;
    z2 = stan::math::square(z);
    local_scalar_t__ z3 = DUMMY_VAR__;
    current_statement__ = 1283;
    z3 = (z2 * z);
    local_scalar_t__ z5 = DUMMY_VAR__;
    current_statement__ = 1284;
    z5 = (z2 * z3);
    local_scalar_t__ z7 = DUMMY_VAR__;
    current_statement__ = 1285;
    z7 = (z2 * z5);
    local_scalar_t__ z9 = DUMMY_VAR__;
    current_statement__ = 1286;
    z9 = (z2 * z7);
    local_scalar_t__ df2 = DUMMY_VAR__;
    current_statement__ = 1287;
    df2 = stan::math::square(df);
    local_scalar_t__ df3 = DUMMY_VAR__;
    current_statement__ = 1288;
    df3 = (df2 * df);
    local_scalar_t__ df4 = DUMMY_VAR__;
    current_statement__ = 1289;
    df4 = (df2 * df2);
    current_statement__ = 1290;
    return ((((z + ((z3 + z) / (4 * df))) + ((((5 * z5) + (16 * z3)) + (3 *
           z)) / (96 * df2))) + (((((3 * z7) + (19 * z5)) + (17 * z3)) - (15
           * z)) / (384 * df3))) + ((((((79 * z9) + (776 * z7)) + (1482 *
           z5)) - (1920 * z3)) - (945 * z)) / (92160 * df4)));
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
std::vector<std::vector<int>>
make_V(const int& N, const int& t, const std::vector<int>& v, std::ostream*
       pstream__) {
  using local_scalar_t__ = double;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1292;
    stan::math::validate_non_negative_index("V", "t", t);
    current_statement__ = 1293;
    stan::math::validate_non_negative_index("V", "N", N);
    std::vector<std::vector<int>> V =
      std::vector<std::vector<int>>(t,
        std::vector<int>(N, std::numeric_limits<int>::min()));
    int pos = std::numeric_limits<int>::min();
    current_statement__ = 1295;
    pos = 1;
    current_statement__ = 1301;
    if (stan::math::logical_gt(t, 0)) {
      current_statement__ = 1300;
      for (int j = 1; j <= N; ++j) {
        current_statement__ = 1299;
        for (int i = 1; i <= t; ++i) {
          current_statement__ = 1296;
          stan::model::assign(V,
            stan::model::rvalue(v, "v", stan::model::index_uni(pos)),
            "assigning variable V", stan::model::index_uni(i),
            stan::model::index_uni(j));
          current_statement__ = 1297;
          pos = (pos + 1);
        }
      }
    }
    current_statement__ = 1302;
    return V;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
double
make_lower(const int& family, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = double;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1305;
    if (stan::math::logical_eq(family, 1)) {
      current_statement__ = 1304;
      return stan::math::negative_infinity();
    }
    current_statement__ = 1310;
    if (stan::math::logical_lte(family, 3)) {
      current_statement__ = 1307;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 1306;
        return stan::math::negative_infinity();
      }
      current_statement__ = 1308;
      return 0;
    }
    current_statement__ = 1311;
    return stan::math::negative_infinity();
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
double
make_upper(const int& family, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = double;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1314;
    if ((stan::math::primitive_value(stan::math::logical_eq(family, 4)) &&
        stan::math::primitive_value(stan::math::logical_eq(link, 5)))) {
      current_statement__ = 1313;
      return 0;
    }
    current_statement__ = 1315;
    return stan::math::positive_infinity();
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_bern(const T0__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1327;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1326;
      return stan::math::inv_logit(eta);
    } else {
      current_statement__ = 1325;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 1324;
        return stan::math::Phi(eta);
      } else {
        current_statement__ = 1323;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 1322;
          return stan::math::add(
                   stan::math::divide(stan::math::atan(eta), stan::math::pi()),
                   0.5);
        } else {
          current_statement__ = 1321;
          if (stan::math::logical_eq(link, 4)) {
            current_statement__ = 1320;
            return stan::math::exp(eta);
          } else {
            current_statement__ = 1319;
            if (stan::math::logical_eq(link, 5)) {
              current_statement__ = 1318;
              return stan::math::inv_cloglog(eta);
            } else {
              current_statement__ = 1317;
              std::stringstream errmsg_stream__;
              stan::math::stan_print(&errmsg_stream__, "Invalid link");
              throw std::domain_error(errmsg_stream__.str());
            }
          }
        }
      }
    }
    current_statement__ = 1328;
    return eta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>>
bern_lpdf(const T0__& eta0_arg__, const T1__& eta1_arg__, const int& link,
          const std::vector<int>& N, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>>;
  int current_statement__ = 0;
  const auto& eta0 = stan::math::to_ref(eta0_arg__);
  const auto& eta1 = stan::math::to_ref(eta1_arg__);
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 1330;
    lp = 0;
    current_statement__ = 1351;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1348;
      lp = (lp + stan::math::logistic_lccdf(eta0, 0, 1));
      current_statement__ = 1349;
      lp = (lp + stan::math::logistic_lcdf(eta1, 0, 1));
    } else {
      current_statement__ = 1347;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 1344;
        lp = (lp + stan::math::normal_lccdf(eta0, 0, 1));
        current_statement__ = 1345;
        lp = (lp + stan::math::normal_lcdf(eta1, 0, 1));
      } else {
        current_statement__ = 1343;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 1340;
          lp = (lp + stan::math::cauchy_lccdf(eta0, 0, 1));
          current_statement__ = 1341;
          lp = (lp + stan::math::cauchy_lcdf(eta1, 0, 1));
        } else {
          current_statement__ = 1339;
          if (stan::math::logical_eq(link, 4)) {
            current_statement__ = 1336;
            lp = (lp + stan::math::sum(stan::math::log1m_exp(eta0)));
            current_statement__ = 1337;
            lp = (lp + stan::math::sum(eta1));
          } else {
            current_statement__ = 1335;
            if (stan::math::logical_eq(link, 5)) {
              current_statement__ = 1332;
              lp = (lp +
                stan::math::sum(
                  stan::math::log1m_exp(
                    stan::math::minus(stan::math::exp(eta1)))));
              current_statement__ = 1333;
              lp = (lp +
                stan::math::sum(stan::math::minus(stan::math::exp(eta0))));
            } else {
              current_statement__ = 1331;
              std::stringstream errmsg_stream__;
              stan::math::stan_print(&errmsg_stream__, "Invalid link");
              throw std::domain_error(errmsg_stream__.str());
            }
          }
        }
      }
    }
    current_statement__ = 1352;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T1__,
          stan::require_all_t<stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T1__>>,-1,1>
pw_bern(const int& y, const T1__& eta_arg__, const int& link, std::ostream*
        pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T1__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 1354;
    N = stan::math::rows(eta);
    current_statement__ = 1355;
    stan::math::validate_non_negative_index("ll", "N", N);
    Eigen::Matrix<local_scalar_t__,-1,1> ll =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
    current_statement__ = 1367;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1365;
      for (int n = 1; n <= N; ++n) {
        current_statement__ = 1364;
        stan::model::assign(ll,
          stan::math::bernoulli_logit_lpmf<false>(y,
            stan::model::rvalue(eta, "eta", stan::model::index_uni(n))),
          "assigning variable ll", stan::model::index_uni(n));
      }
    } else {
      current_statement__ = 1363;
      if (stan::math::logical_lte(link, 5)) {
        current_statement__ = 1358;
        stan::math::validate_non_negative_index("pi", "N", N);
        Eigen::Matrix<local_scalar_t__,-1,1> pi =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
        current_statement__ = 1359;
        stan::model::assign(pi, linkinv_bern(eta, link, pstream__),
          "assigning variable pi");
        current_statement__ = 1361;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 1360;
          stan::model::assign(ll,
            stan::math::bernoulli_lpmf<false>(y,
              stan::model::rvalue(pi, "pi", stan::model::index_uni(n))),
            "assigning variable ll", stan::model::index_uni(n));
        }
      } else {
        current_statement__ = 1357;
        std::stringstream errmsg_stream__;
        stan::math::stan_print(&errmsg_stream__, "Invalid link");
        throw std::domain_error(errmsg_stream__.str());
      }
    }
    current_statement__ = 1368;
    return ll;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T2__,
          stan::require_all_t<stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>*>
stan::promote_args_t<stan::base_type_t<T2__>>
log_clogit_denom(const int& N_j, const int& D_j, const T2__& eta_j_arg__,
                 std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T2__>>;
  int current_statement__ = 0;
  const auto& eta_j = stan::math::to_ref(eta_j_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1371;
    if ((stan::math::primitive_value(stan::math::logical_eq(D_j, 1)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(N_j, stan::math::rows(eta_j))))) {
      current_statement__ = 1370;
      return stan::math::log_sum_exp(eta_j);
    }
    current_statement__ = 1373;
    if (stan::math::logical_eq(D_j, 0)) {
      current_statement__ = 1372;
      return 0;
    }
    current_statement__ = 1381;
    if (stan::math::logical_eq(N_j, D_j)) {
      current_statement__ = 1378;
      if (stan::math::logical_eq(D_j, 1)) {
        current_statement__ = 1377;
        return stan::model::rvalue(eta_j, "eta_j",
                 stan::model::index_uni(N_j));
      }
      current_statement__ = 1379;
      return stan::math::sum(stan::math::segment(eta_j, (N_j - 1), 2));
    } else {
      int N_jm1 = std::numeric_limits<int>::min();
      current_statement__ = 1374;
      N_jm1 = (N_j - 1);
      current_statement__ = 1375;
      return stan::math::log_sum_exp(
               log_clogit_denom(N_jm1, D_j, stan::math::eval(eta_j),
                 pstream__),
               (log_clogit_denom(N_jm1, (D_j - 1), stan::math::eval(eta_j),
                  pstream__) +
               stan::model::rvalue(eta_j, "eta_j",
                 stan::model::index_uni(N_j))));
    }
    current_statement__ = 1382;
    return stan::math::not_a_number();
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>>
clogit_lpdf(const T0__& eta0_arg__, const T1__& eta1_arg__,
            const std::vector<int>& successes, const std::vector<int>&
            failures, const std::vector<int>& observations, std::ostream*
            pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>>;
  int current_statement__ = 0;
  const auto& eta0 = stan::math::to_ref(eta0_arg__);
  const auto& eta1 = stan::math::to_ref(eta1_arg__);
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int J = std::numeric_limits<int>::min();
    current_statement__ = 1384;
    J = stan::math::num_elements(observations);
    int pos0 = std::numeric_limits<int>::min();
    current_statement__ = 1385;
    pos0 = 1;
    int pos1 = std::numeric_limits<int>::min();
    current_statement__ = 1386;
    pos1 = 1;
    current_statement__ = 1387;
    stan::math::validate_non_negative_index("summands", "J", J);
    Eigen::Matrix<local_scalar_t__,-1,1> summands =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(J, DUMMY_VAR__);
    current_statement__ = 1398;
    for (int j = 1; j <= J; ++j) {
      int D_g = std::numeric_limits<int>::min();
      current_statement__ = 1389;
      D_g = stan::model::rvalue(successes, "successes",
              stan::model::index_uni(j));
      int N_g = std::numeric_limits<int>::min();
      current_statement__ = 1390;
      N_g = stan::model::rvalue(observations, "observations",
              stan::model::index_uni(j));
      int F_g = std::numeric_limits<int>::min();
      current_statement__ = 1391;
      F_g = stan::model::rvalue(failures, "failures",
              stan::model::index_uni(j));
      current_statement__ = 1392;
      stan::math::validate_non_negative_index("eta_g", "N_g", N_g);
      Eigen::Matrix<local_scalar_t__,-1,1> eta_g =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_g, DUMMY_VAR__);
      current_statement__ = 1393;
      stan::model::assign(eta_g,
        stan::math::append_row(stan::math::segment(eta1, pos1, D_g),
          stan::math::segment(eta0, pos0, F_g)), "assigning variable eta_g");
      current_statement__ = 1394;
      stan::model::assign(summands,
        log_clogit_denom(N_g, D_g, eta_g, pstream__),
        "assigning variable summands", stan::model::index_uni(j));
      current_statement__ = 1395;
      pos0 = (pos0 + F_g);
      current_statement__ = 1396;
      pos1 = (pos1 + D_g);
    }
    current_statement__ = 1399;
    return (stan::math::sum(eta1) - stan::math::sum(summands));
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_binom(const T0__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1411;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1410;
      return stan::math::inv_logit(eta);
    } else {
      current_statement__ = 1409;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 1408;
        return stan::math::Phi(eta);
      } else {
        current_statement__ = 1407;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 1406;
          return stan::math::add(
                   stan::math::divide(stan::math::atan(eta), stan::math::pi()),
                   0.5);
        } else {
          current_statement__ = 1405;
          if (stan::math::logical_eq(link, 4)) {
            current_statement__ = 1404;
            return stan::math::exp(eta);
          } else {
            current_statement__ = 1403;
            if (stan::math::logical_eq(link, 5)) {
              current_statement__ = 1402;
              return stan::math::inv_cloglog(eta);
            } else {
              current_statement__ = 1401;
              std::stringstream errmsg_stream__;
              stan::math::stan_print(&errmsg_stream__, "Invalid link");
              throw std::domain_error(errmsg_stream__.str());
            }
          }
        }
      }
    }
    current_statement__ = 1412;
    return eta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>*>
stan::promote_args_t<stan::base_type_t<T2__>>
binom_lpmf(const std::vector<int>& y, const std::vector<int>& trials,
           const T2__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T2__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 1414;
    lp = 0;
    current_statement__ = 1434;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1433;
      lp = (lp + stan::math::binomial_logit_lpmf<false>(y, trials, eta));
    } else {
      current_statement__ = 1432;
      if (stan::math::logical_lt(link, 4)) {
        current_statement__ = 1431;
        lp = (lp +
          stan::math::binomial_lpmf<false>(y, trials,
            linkinv_binom(eta, link, pstream__)));
      } else {
        current_statement__ = 1430;
        if (stan::math::logical_eq(link, 4)) {
          current_statement__ = 1428;
          for (int n = 1; n <= stan::math::num_elements(y); ++n) {
            current_statement__ = 1424;
            lp = (lp +
              (stan::model::rvalue(y, "y", stan::model::index_uni(n)) *
              stan::model::rvalue(eta, "eta", stan::model::index_uni(n))));
            current_statement__ = 1425;
            lp = (lp +
              ((stan::model::rvalue(trials, "trials",
                  stan::model::index_uni(n))
              - stan::model::rvalue(y, "y", stan::model::index_uni(n))) *
              stan::math::log1m_exp(
                stan::model::rvalue(eta, "eta", stan::model::index_uni(n)))));
            current_statement__ = 1426;
            lp = (lp +
              stan::math::binomial_coefficient_log(
                stan::model::rvalue(trials, "trials",
                  stan::model::index_uni(n)),
                stan::model::rvalue(y, "y", stan::model::index_uni(n))));
          }
        } else {
          current_statement__ = 1423;
          if (stan::math::logical_eq(link, 5)) {
            current_statement__ = 1421;
            for (int n = 1; n <= stan::math::num_elements(y); ++n) {
              local_scalar_t__ neg_exp_eta = DUMMY_VAR__;
              current_statement__ = 1416;
              neg_exp_eta = -stan::math::exp(
                               stan::model::rvalue(eta, "eta",
                                 stan::model::index_uni(n)));
              current_statement__ = 1417;
              lp = (lp +
                (stan::model::rvalue(y, "y", stan::model::index_uni(n)) *
                stan::math::log1m_exp(neg_exp_eta)));
              current_statement__ = 1418;
              lp = (lp +
                ((stan::model::rvalue(trials, "trials",
                    stan::model::index_uni(n))
                - stan::model::rvalue(y, "y", stan::model::index_uni(n))) *
                neg_exp_eta));
              current_statement__ = 1419;
              lp = (lp +
                stan::math::binomial_coefficient_log(
                  stan::model::rvalue(trials, "trials",
                    stan::model::index_uni(n)),
                  stan::model::rvalue(y, "y", stan::model::index_uni(n))));
            }
          } else {
            current_statement__ = 1415;
            std::stringstream errmsg_stream__;
            stan::math::stan_print(&errmsg_stream__, "Invalid link");
            throw std::domain_error(errmsg_stream__.str());
          }
        }
      }
    }
    current_statement__ = 1435;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T2__,
          stan::require_all_t<stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T2__>>,-1,1>
pw_binom(const std::vector<int>& y, const std::vector<int>& trials,
         const T2__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T2__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 1437;
    N = stan::math::rows(eta);
    current_statement__ = 1438;
    stan::math::validate_non_negative_index("ll", "N", N);
    Eigen::Matrix<local_scalar_t__,-1,1> ll =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
    current_statement__ = 1450;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1448;
      for (int n = 1; n <= N; ++n) {
        current_statement__ = 1447;
        stan::model::assign(ll,
          stan::math::binomial_logit_lpmf<false>(
            stan::model::rvalue(y, "y", stan::model::index_uni(n)),
            stan::model::rvalue(trials, "trials", stan::model::index_uni(n)),
            stan::model::rvalue(eta, "eta", stan::model::index_uni(n))),
          "assigning variable ll", stan::model::index_uni(n));
      }
    } else {
      current_statement__ = 1446;
      if (stan::math::logical_lte(link, 5)) {
        current_statement__ = 1441;
        stan::math::validate_non_negative_index("pi", "N", N);
        Eigen::Matrix<local_scalar_t__,-1,1> pi =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
        current_statement__ = 1442;
        stan::model::assign(pi, linkinv_binom(eta, link, pstream__),
          "assigning variable pi");
        current_statement__ = 1444;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 1443;
          stan::model::assign(ll,
            stan::math::binomial_lpmf<false>(
              stan::model::rvalue(y, "y", stan::model::index_uni(n)),
              stan::model::rvalue(trials, "trials", stan::model::index_uni(n)),
              stan::model::rvalue(pi, "pi", stan::model::index_uni(n))),
            "assigning variable ll", stan::model::index_uni(n));
        }
      } else {
        current_statement__ = 1440;
        std::stringstream errmsg_stream__;
        stan::math::stan_print(&errmsg_stream__, "Invalid link");
        throw std::domain_error(errmsg_stream__.str());
      }
    }
    current_statement__ = 1451;
    return ll;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_gauss(const T0__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1459;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1458;
      return eta;
    } else {
      current_statement__ = 1457;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 1456;
        return stan::math::exp(eta);
      } else {
        current_statement__ = 1455;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 1454;
          return stan::math::inv(eta);
        } else {
          current_statement__ = 1453;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 1460;
    return eta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T2__>,-1,1>
pw_gauss(const T0__& y_arg__, const T1__& eta_arg__, const T2__& sigma,
         const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>, T2__>;
  int current_statement__ = 0;
  const auto& y = stan::math::to_ref(y_arg__);
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1462;
    return stan::math::subtract((-0.5 *
             stan::math::log((6.283185307179586232 * sigma))),
             stan::math::multiply(0.5,
               stan::math::square(
                 stan::math::divide(
                   stan::math::subtract(y,
                     linkinv_gauss(eta, link, pstream__)), sigma))));
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_gamma(const T0__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1470;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1469;
      return eta;
    } else {
      current_statement__ = 1468;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 1467;
        return stan::math::exp(eta);
      } else {
        current_statement__ = 1466;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 1465;
          return stan::math::inv(eta);
        } else {
          current_statement__ = 1464;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 1471;
    return eta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename T2__, typename T4__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T4__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>, T2__,
  T4__>
GammaReg(const T0__& y_arg__, const T1__& eta_arg__, const T2__& shape,
         const int& link, const T4__& sum_log_y, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>, T2__, T4__>;
  int current_statement__ = 0;
  const auto& y = stan::math::to_ref(y_arg__);
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ ret = DUMMY_VAR__;
    current_statement__ = 1473;
    ret = ((stan::math::rows(y) * ((shape * stan::math::log(shape)) -
      stan::math::lgamma(shape))) + ((shape - 1) * sum_log_y));
    current_statement__ = 1480;
    if (stan::math::logical_eq(link, 2)) {
      current_statement__ = 1479;
      ret = (ret - ((shape * stan::math::sum(eta)) + (shape *
        stan::math::sum(stan::math::elt_divide(y, stan::math::exp(eta))))));
    } else {
      current_statement__ = 1478;
      if (stan::math::logical_eq(link, 1)) {
        current_statement__ = 1477;
        ret = (ret - ((shape * stan::math::sum(stan::math::log(eta))) +
          (shape * stan::math::sum(stan::math::elt_divide(y, eta)))));
      } else {
        current_statement__ = 1476;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 1475;
          ret = (ret + ((shape * stan::math::sum(stan::math::log(eta))) -
            (shape * stan::math::dot_product(eta, y))));
        } else {
          current_statement__ = 1474;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 1481;
    return ret;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T2__>,-1,1>
pw_gamma(const T0__& y_arg__, const T1__& eta_arg__, const T2__& shape,
         const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>, T2__>;
  int current_statement__ = 0;
  const auto& y = stan::math::to_ref(y_arg__);
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 1483;
    N = stan::math::rows(eta);
    current_statement__ = 1484;
    stan::math::validate_non_negative_index("ll", "N", N);
    Eigen::Matrix<local_scalar_t__,-1,1> ll =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
    current_statement__ = 1501;
    if (stan::math::logical_eq(link, 3)) {
      current_statement__ = 1499;
      for (int n = 1; n <= N; ++n) {
        current_statement__ = 1497;
        stan::model::assign(ll,
          stan::math::gamma_lpdf<false>(
            stan::model::rvalue(y, "y", stan::model::index_uni(n)), shape,
            (shape *
            stan::model::rvalue(eta, "eta", stan::model::index_uni(n)))),
          "assigning variable ll", stan::model::index_uni(n));
      }
    } else {
      current_statement__ = 1496;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 1494;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 1492;
          stan::model::assign(ll,
            stan::math::gamma_lpdf<false>(
              stan::model::rvalue(y, "y", stan::model::index_uni(n)), shape,
              (shape /
              stan::math::exp(
                stan::model::rvalue(eta, "eta", stan::model::index_uni(n))))),
            "assigning variable ll", stan::model::index_uni(n));
        }
      } else {
        current_statement__ = 1491;
        if (stan::math::logical_eq(link, 1)) {
          current_statement__ = 1489;
          for (int n = 1; n <= N; ++n) {
            current_statement__ = 1487;
            stan::model::assign(ll,
              stan::math::gamma_lpdf<false>(
                stan::model::rvalue(y, "y", stan::model::index_uni(n)),
                shape, (shape /
                stan::model::rvalue(eta, "eta", stan::model::index_uni(n)))),
              "assigning variable ll", stan::model::index_uni(n));
          }
        } else {
          current_statement__ = 1486;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 1502;
    return ll;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_inv_gaussian(const T0__& eta_arg__, const int& link, std::ostream*
                     pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1512;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1511;
      return eta;
    } else {
      current_statement__ = 1510;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 1509;
        return stan::math::exp(eta);
      } else {
        current_statement__ = 1508;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 1507;
          return stan::math::inv(eta);
        } else {
          current_statement__ = 1506;
          if (stan::math::logical_eq(link, 4)) {
            current_statement__ = 1505;
            return stan::math::inv_sqrt(eta);
          } else {
            current_statement__ = 1504;
            std::stringstream errmsg_stream__;
            stan::math::stan_print(&errmsg_stream__, "Invalid link");
            throw std::domain_error(errmsg_stream__.str());
          }
        }
      }
    }
    current_statement__ = 1513;
    return eta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename T2__, typename T3__,
          typename T4__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>, T2__,
  T3__, stan::base_type_t<T4__>>
inv_gaussian(const T0__& y_arg__, const T1__& mu_arg__, const T2__& lambda,
             const T3__& sum_log_y, const T4__& sqrt_y_arg__, std::ostream*
             pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>, T2__, T3__,
                             stan::base_type_t<T4__>>;
  int current_statement__ = 0;
  const auto& y = stan::math::to_ref(y_arg__);
  const auto& mu = stan::math::to_ref(mu_arg__);
  const auto& sqrt_y = stan::math::to_ref(sqrt_y_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1515;
    return ((((0.5 * stan::math::rows(y)) *
           stan::math::log((lambda / 6.283185307179586232))) - (1.5 *
           sum_log_y)) - ((0.5 * lambda) *
           stan::math::dot_self(
             stan::math::elt_divide(stan::math::subtract(y, mu),
               stan::math::elt_multiply(mu, sqrt_y)))));
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename T2__, typename T4__,
          typename T5__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>,
                              stan::is_col_vector<T5__>,
                              stan::is_vt_not_complex<T5__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T2__, stan::base_type_t<T4__>,
                stan::base_type_t<T5__>>,-1,1>
pw_inv_gaussian(const T0__& y_arg__, const T1__& eta_arg__, const T2__&
                lambda, const int& link, const T4__& log_y_arg__, const T5__&
                sqrt_y_arg__, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>, T2__,
                             stan::base_type_t<T4__>,
                             stan::base_type_t<T5__>>;
  int current_statement__ = 0;
  const auto& y = stan::math::to_ref(y_arg__);
  const auto& eta = stan::math::to_ref(eta_arg__);
  const auto& log_y = stan::math::to_ref(log_y_arg__);
  const auto& sqrt_y = stan::math::to_ref(sqrt_y_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1517;
    stan::math::validate_non_negative_index("mu", "rows(y)",
      stan::math::rows(y));
    Eigen::Matrix<local_scalar_t__,-1,1> mu =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(y),
        DUMMY_VAR__);
    current_statement__ = 1518;
    stan::model::assign(mu, linkinv_inv_gaussian(eta, link, pstream__),
      "assigning variable mu");
    current_statement__ = 1519;
    return stan::math::subtract(
             stan::math::add(
               stan::math::multiply((-0.5 * lambda),
                 stan::math::square(
                   stan::math::elt_divide(stan::math::subtract(y, mu),
                     stan::math::elt_multiply(mu, sqrt_y)))), (0.5 *
               stan::math::log((lambda / 6.283185307179586232)))),
             stan::math::multiply(1.5, log_y));
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename RNG,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T1__>>*>
stan::promote_args_t<T0__, T1__>
inv_gaussian_rng(const T0__& mu, const T1__& lambda, RNG& base_rng__,
                 std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<T0__, T1__>;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ mu2 = DUMMY_VAR__;
    current_statement__ = 1521;
    mu2 = stan::math::square(mu);
    local_scalar_t__ z = DUMMY_VAR__;
    current_statement__ = 1522;
    z = stan::math::uniform_rng(0, 1, base_rng__);
    local_scalar_t__ y = DUMMY_VAR__;
    current_statement__ = 1523;
    y = stan::math::square(stan::math::normal_rng(0, 1, base_rng__));
    local_scalar_t__ x = DUMMY_VAR__;
    current_statement__ = 1524;
    x = (mu + (((mu2 * y) - (mu *
      stan::math::sqrt(((((4 * mu) * lambda) * y) + (mu2 *
        stan::math::square(y))))))
      / (2 * lambda)));
    current_statement__ = 1527;
    if (stan::math::logical_lte(z, (mu / (mu + x)))) {
      current_statement__ = 1526;
      return x;
    } else {
      current_statement__ = 1525;
      return (mu2 / x);
    }
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_beta(const T0__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1541;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1540;
      return stan::math::inv_logit(eta);
    } else {
      current_statement__ = 1539;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 1538;
        return stan::math::Phi(eta);
      } else {
        current_statement__ = 1537;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 1536;
          return stan::math::inv_cloglog(eta);
        } else {
          current_statement__ = 1535;
          if (stan::math::logical_eq(link, 4)) {
            current_statement__ = 1534;
            return stan::math::add(0.5,
                     stan::math::divide(stan::math::atan(eta),
                       stan::math::pi()));
          } else {
            current_statement__ = 1533;
            if (stan::math::logical_eq(link, 5)) {
              current_statement__ = 1532;
              return stan::math::exp(eta);
            } else {
              current_statement__ = 1531;
              if (stan::math::logical_eq(link, 6)) {
                current_statement__ = 1530;
                return stan::math::subtract(1,
                         stan::math::inv_cloglog(stan::math::minus(eta)));
              } else {
                current_statement__ = 1529;
                std::stringstream errmsg_stream__;
                stan::math::stan_print(&errmsg_stream__, "invalid link");
                throw std::domain_error(errmsg_stream__.str());
              }
            }
          }
        }
      }
    }
    current_statement__ = 1542;
    return eta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_beta_z(const T0__& eta_arg__, const int& link, std::ostream*
               pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1550;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1549;
      return stan::math::exp(eta);
    } else {
      current_statement__ = 1548;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 1547;
        return eta;
      } else {
        current_statement__ = 1546;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 1545;
          return stan::math::square(eta);
        } else {
          current_statement__ = 1544;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 1551;
    return eta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T2__>,-1,1>
pw_beta(const T0__& y_arg__, const T1__& eta_arg__, const T2__& dispersion,
        const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>, T2__>;
  int current_statement__ = 0;
  const auto& y = stan::math::to_ref(y_arg__);
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1553;
    stan::math::validate_non_negative_index("ll", "rows(y)",
      stan::math::rows(y));
    Eigen::Matrix<local_scalar_t__,-1,1> ll =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(y),
        DUMMY_VAR__);
    current_statement__ = 1555;
    stan::math::validate_non_negative_index("mu", "rows(y)",
      stan::math::rows(y));
    Eigen::Matrix<local_scalar_t__,-1,1> mu =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(y),
        DUMMY_VAR__);
    current_statement__ = 1556;
    stan::model::assign(mu, linkinv_beta(eta, link, pstream__),
      "assigning variable mu");
    current_statement__ = 1559;
    for (int n = 1; n <= stan::math::rows(y); ++n) {
      current_statement__ = 1557;
      stan::model::assign(ll,
        stan::math::beta_lpdf<false>(
          stan::model::rvalue(y, "y", stan::model::index_uni(n)),
          (stan::model::rvalue(mu, "mu", stan::model::index_uni(n)) *
          dispersion), ((1 -
          stan::model::rvalue(mu, "mu", stan::model::index_uni(n))) *
          dispersion)), "assigning variable ll", stan::model::index_uni(n));
    }
    current_statement__ = 1560;
    return ll;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, stan::base_type_t<T2__>>,-1,1>
pw_beta_z(const T0__& y_arg__, const T1__& eta_arg__, const T2__&
          eta_z_arg__, const int& link, const int& link_phi, std::ostream*
          pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>,
                             stan::base_type_t<T2__>>;
  int current_statement__ = 0;
  const auto& y = stan::math::to_ref(y_arg__);
  const auto& eta = stan::math::to_ref(eta_arg__);
  const auto& eta_z = stan::math::to_ref(eta_z_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1562;
    stan::math::validate_non_negative_index("ll", "rows(y)",
      stan::math::rows(y));
    Eigen::Matrix<local_scalar_t__,-1,1> ll =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(y),
        DUMMY_VAR__);
    current_statement__ = 1564;
    stan::math::validate_non_negative_index("mu", "rows(y)",
      stan::math::rows(y));
    Eigen::Matrix<local_scalar_t__,-1,1> mu =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(y),
        DUMMY_VAR__);
    current_statement__ = 1565;
    stan::model::assign(mu, linkinv_beta(eta, link, pstream__),
      "assigning variable mu");
    current_statement__ = 1566;
    stan::math::validate_non_negative_index("mu_z", "rows(y)",
      stan::math::rows(y));
    Eigen::Matrix<local_scalar_t__,-1,1> mu_z =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(y),
        DUMMY_VAR__);
    current_statement__ = 1567;
    stan::model::assign(mu_z, linkinv_beta_z(eta_z, link_phi, pstream__),
      "assigning variable mu_z");
    current_statement__ = 1570;
    for (int n = 1; n <= stan::math::rows(y); ++n) {
      current_statement__ = 1568;
      stan::model::assign(ll,
        stan::math::beta_lpdf<false>(
          stan::model::rvalue(y, "y", stan::model::index_uni(n)),
          (stan::model::rvalue(mu, "mu", stan::model::index_uni(n)) *
          stan::model::rvalue(mu_z, "mu_z", stan::model::index_uni(n))), ((1
          - stan::model::rvalue(mu, "mu", stan::model::index_uni(n))) *
          stan::model::rvalue(mu_z, "mu_z", stan::model::index_uni(n)))),
        "assigning variable ll", stan::model::index_uni(n));
    }
    current_statement__ = 1571;
    return ll;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_count(const T0__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1579;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1578;
      return stan::math::exp(eta);
    } else {
      current_statement__ = 1577;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 1576;
        return eta;
      } else {
        current_statement__ = 1575;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 1574;
          return stan::math::square(eta);
        } else {
          current_statement__ = 1573;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 1580;
    return eta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T1__,
          stan::require_all_t<stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T1__>>,-1,1>
pw_pois(const std::vector<int>& y, const T1__& eta_arg__, const int& link,
        std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T1__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 1582;
    N = stan::math::rows(eta);
    current_statement__ = 1583;
    stan::math::validate_non_negative_index("ll", "N", N);
    Eigen::Matrix<local_scalar_t__,-1,1> ll =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
    current_statement__ = 1594;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1593;
      for (int n = 1; n <= N; ++n) {
        current_statement__ = 1592;
        stan::model::assign(ll,
          stan::math::poisson_log_lpmf<false>(
            stan::model::rvalue(y, "y", stan::model::index_uni(n)),
            stan::model::rvalue(eta, "eta", stan::model::index_uni(n))),
          "assigning variable ll", stan::model::index_uni(n));
      }
    } else {
      current_statement__ = 1591;
      if (stan::math::logical_lte(link, 3)) {
        current_statement__ = 1586;
        stan::math::validate_non_negative_index("phi", "N", N);
        Eigen::Matrix<local_scalar_t__,-1,1> phi =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
        current_statement__ = 1587;
        stan::model::assign(phi, linkinv_count(eta, link, pstream__),
          "assigning variable phi");
        current_statement__ = 1589;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 1588;
          stan::model::assign(ll,
            stan::math::poisson_lpmf<false>(
              stan::model::rvalue(y, "y", stan::model::index_uni(n)),
              stan::model::rvalue(phi, "phi", stan::model::index_uni(n))),
            "assigning variable ll", stan::model::index_uni(n));
        }
      } else {
        current_statement__ = 1585;
        std::stringstream errmsg_stream__;
        stan::math::stan_print(&errmsg_stream__, "Invalid link");
        throw std::domain_error(errmsg_stream__.str());
      }
    }
    current_statement__ = 1595;
    return ll;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T1__>, T2__>,-1,1>
pw_nb(const std::vector<int>& y, const T1__& eta_arg__, const T2__& theta,
      const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T1__>,
                             T2__>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 1597;
    N = stan::math::rows(eta);
    current_statement__ = 1598;
    stan::math::validate_non_negative_index("rho", "N", N);
    Eigen::Matrix<local_scalar_t__,-1,1> rho =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
    current_statement__ = 1599;
    stan::model::assign(rho, linkinv_count(eta, link, pstream__),
      "assigning variable rho");
    current_statement__ = 1600;
    stan::math::validate_non_negative_index("ll", "N", N);
    Eigen::Matrix<local_scalar_t__,-1,1> ll =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
    current_statement__ = 1603;
    for (int n = 1; n <= N; ++n) {
      current_statement__ = 1602;
      stan::model::assign(ll,
        stan::math::neg_binomial_2_lpmf<false>(
          stan::model::rvalue(y, "y", stan::model::index_uni(n)),
          stan::model::rvalue(rho, "rho", stan::model::index_uni(n)), theta),
        "assigning variable ll", stan::model::index_uni(n));
    }
    current_statement__ = 1604;
    return ll;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
int get_nvars_for_hs(const int& prior_dist, std::ostream* pstream__) {
  using local_scalar_t__ = double;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int hs = std::numeric_limits<int>::min();
    current_statement__ = 1606;
    hs = 0;
    current_statement__ = 1610;
    if (stan::math::logical_eq(prior_dist, 3)) {
      current_statement__ = 1609;
      hs = 2;
    } else {
      current_statement__ = 1608;
      if (stan::math::logical_eq(prior_dist, 4)) {
        current_statement__ = 1607;
        hs = 4;
      }
    }
    current_statement__ = 1611;
    return hs;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
double lb(const int& intercept_type, std::ostream* pstream__) {
  using local_scalar_t__ = double;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1613;
    return (stan::math::logical_eq(intercept_type, 2) ? 0 : stan::math::negative_infinity(
                                                              ));
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
double ub(const int& intercept_type, std::ostream* pstream__) {
  using local_scalar_t__ = double;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1615;
    return (stan::math::logical_eq(intercept_type, 3) ? 0 : stan::math::positive_infinity(
                                                              ));
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
std::vector<int> lower_tri_indices(const int& dim, std::ostream* pstream__) {
  using local_scalar_t__ = double;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1617;
    stan::math::validate_non_negative_index("indices",
      "dim + choose(dim, 2)", (dim + stan::math::choose(dim, 2)));
    std::vector<int> indices =
      std::vector<int>((dim + stan::math::choose(dim, 2)),
        std::numeric_limits<int>::min());
    int mark = std::numeric_limits<int>::min();
    current_statement__ = 1619;
    mark = 1;
    current_statement__ = 1625;
    for (int r = 1; r <= dim; ++r) {
      current_statement__ = 1623;
      for (int c = r; c <= dim; ++c) {
        current_statement__ = 1620;
        stan::model::assign(indices, (((r - 1) * dim) + c),
          "assigning variable indices", stan::model::index_uni(mark));
        current_statement__ = 1621;
        mark = (mark + 1);
      }
    }
    current_statement__ = 1626;
    return indices;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T2__, typename T3__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>>*>
stan::promote_args_t<T0__, T2__, T3__>
make_aux(const T0__& aux_unscaled, const int& prior_dist, const T2__&
         prior_mean, const T3__& prior_scale, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<T0__, T2__, T3__>;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ aux = DUMMY_VAR__;
    current_statement__ = 1634;
    if (stan::math::logical_eq(prior_dist, 0)) {
      current_statement__ = 1633;
      aux = aux_unscaled;
    } else {
      current_statement__ = 1629;
      aux = (prior_scale * aux_unscaled);
      current_statement__ = 1631;
      if (stan::math::logical_lte(prior_dist, 2)) {
        current_statement__ = 1630;
        aux = (aux + prior_mean);
      }
    }
    current_statement__ = 1635;
    return aux;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T2__, typename T3__, typename T4__,
          typename T5__, typename T6__, typename T7__, typename T8__,
          typename T9__, typename T10__, typename T12__, typename T13__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_stan_scalar<T7__>,
                              stan::is_stan_scalar<T8__>,
                              stan::is_stan_scalar<T9__>,
                              stan::is_stan_scalar<T10__>,
                              stan::is_stan_scalar<T12__>,
                              stan::is_stan_scalar<T13__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T2__>, stan::base_type_t<T3__>,
                stan::base_type_t<T4__>, T5__,
                stan::promote_args_t<T6__, T7__, T8__, T9__, T10__,
                  stan::promote_args_t<T12__, T13__>>>,-1,1>
make_beta(const T0__& z_beta_arg__, const int& prior_dist, const T2__&
          prior_mean_arg__, const T3__& prior_scale_arg__, const T4__&
          prior_df_arg__, const T5__& global_prior_scale,
          const std::vector<T6__>& global,
          const std::vector<Eigen::Matrix<T7__,-1,1>>& local,
          const std::vector<T8__>& ool,
          const std::vector<Eigen::Matrix<T9__,-1,1>>& mix,
          const std::vector<T10__>& aux, const int& family, const T12__&
          slab_scale, const std::vector<T13__>& caux, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T2__>,
                             stan::base_type_t<T3__>,
                             stan::base_type_t<T4__>, T5__,
                             stan::promote_args_t<T6__, T7__, T8__, T9__,
                               T10__, stan::promote_args_t<T12__, T13__>>>;
  int current_statement__ = 0;
  const auto& z_beta = stan::math::to_ref(z_beta_arg__);
  const auto& prior_mean = stan::math::to_ref(prior_mean_arg__);
  const auto& prior_scale = stan::math::to_ref(prior_scale_arg__);
  const auto& prior_df = stan::math::to_ref(prior_df_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1637;
    stan::math::validate_non_negative_index("beta", "rows(z_beta)",
      stan::math::rows(z_beta));
    Eigen::Matrix<local_scalar_t__,-1,1> beta =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(z_beta),
        DUMMY_VAR__);
    current_statement__ = 1662;
    if (stan::math::logical_eq(prior_dist, 0)) {
      current_statement__ = 1661;
      stan::model::assign(beta, z_beta, "assigning variable beta");
    } else {
      current_statement__ = 1660;
      if (stan::math::logical_eq(prior_dist, 1)) {
        current_statement__ = 1659;
        stan::model::assign(beta,
          stan::math::add(stan::math::elt_multiply(z_beta, prior_scale),
            prior_mean), "assigning variable beta");
      } else {
        current_statement__ = 1658;
        if (stan::math::logical_eq(prior_dist, 2)) {
          current_statement__ = 1657;
          for (int k = 1; k <= stan::math::rows(prior_mean); ++k) {
            current_statement__ = 1655;
            stan::model::assign(beta,
              ((CFt(
                  stan::model::rvalue(z_beta, "z_beta",
                    stan::model::index_uni(k)),
                  stan::model::rvalue(prior_df, "prior_df",
                    stan::model::index_uni(k)), pstream__) *
              stan::model::rvalue(prior_scale, "prior_scale",
                stan::model::index_uni(k))) +
              stan::model::rvalue(prior_mean, "prior_mean",
                stan::model::index_uni(k))), "assigning variable beta",
              stan::model::index_uni(k));
          }
        } else {
          current_statement__ = 1654;
          if (stan::math::logical_eq(prior_dist, 3)) {
            local_scalar_t__ c2 = DUMMY_VAR__;
            current_statement__ = 1649;
            c2 = (stan::math::square(slab_scale) *
              stan::model::rvalue(caux, "caux", stan::model::index_uni(1)));
            current_statement__ = 1652;
            if (stan::math::logical_eq(family, 1)) {
              current_statement__ = 1651;
              stan::model::assign(beta,
                hs_prior(z_beta, global, local, global_prior_scale,
                  stan::model::rvalue(aux, "aux", stan::model::index_uni(1)),
                  c2, pstream__), "assigning variable beta");
            } else {
              current_statement__ = 1650;
              stan::model::assign(beta,
                hs_prior(z_beta, global, local, global_prior_scale,
                  static_cast<double>(1), c2, pstream__),
                "assigning variable beta");
            }
          } else {
            current_statement__ = 1648;
            if (stan::math::logical_eq(prior_dist, 4)) {
              local_scalar_t__ c2 = DUMMY_VAR__;
              current_statement__ = 1643;
              c2 = (stan::math::square(slab_scale) *
                stan::model::rvalue(caux, "caux", stan::model::index_uni(1)));
              current_statement__ = 1646;
              if (stan::math::logical_eq(family, 1)) {
                current_statement__ = 1645;
                stan::model::assign(beta,
                  hsplus_prior(z_beta, global, local, global_prior_scale,
                    stan::model::rvalue(aux, "aux", stan::model::index_uni(1)),
                    c2, pstream__), "assigning variable beta");
              } else {
                current_statement__ = 1644;
                stan::model::assign(beta,
                  hsplus_prior(z_beta, global, local, global_prior_scale,
                    static_cast<double>(1), c2, pstream__),
                  "assigning variable beta");
              }
            } else {
              current_statement__ = 1642;
              if (stan::math::logical_eq(prior_dist, 5)) {
                current_statement__ = 1641;
                stan::model::assign(beta,
                  stan::math::add(prior_mean,
                    stan::math::elt_multiply(
                      stan::math::elt_multiply(prior_scale,
                        stan::math::sqrt(
                          stan::math::multiply(2,
                            stan::model::rvalue(mix, "mix",
                              stan::model::index_uni(1))))), z_beta)),
                  "assigning variable beta");
              } else {
                current_statement__ = 1640;
                if (stan::math::logical_eq(prior_dist, 6)) {
                  current_statement__ = 1639;
                  stan::model::assign(beta,
                    stan::math::add(prior_mean,
                      stan::math::elt_multiply(
                        stan::math::elt_multiply(
                          stan::math::multiply(
                            stan::model::rvalue(ool, "ool",
                              stan::model::index_uni(1)), prior_scale),
                          stan::math::sqrt(
                            stan::math::multiply(2,
                              stan::model::rvalue(mix, "mix",
                                stan::model::index_uni(1))))), z_beta)),
                    "assigning variable beta");
                }
              }
            }
          }
        }
      }
    }
    current_statement__ = 1663;
    return beta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>>,-1,-1>
make_b_matrix(const T0__& z_b_arg__, const T1__& theta_L_arg__,
              const std::vector<int>& p, const std::vector<int>& l,
              const int& i, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>>;
  int current_statement__ = 0;
  const auto& z_b = stan::math::to_ref(z_b_arg__);
  const auto& theta_L = stan::math::to_ref(theta_L_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1665;
    stan::math::validate_non_negative_index("b_matrix", "p[i]",
      stan::model::rvalue(p, "p", stan::model::index_uni(i)));
    current_statement__ = 1666;
    stan::math::validate_non_negative_index("b_matrix", "l[i]",
      stan::model::rvalue(l, "l", stan::model::index_uni(i)));
    Eigen::Matrix<local_scalar_t__,-1,-1> b_matrix =
      Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(stan::model::rvalue(p,
                                                        "p",
                                                        stan::model::index_uni(
                                                          i)),
        stan::model::rvalue(l, "l", stan::model::index_uni(i)), DUMMY_VAR__);
    int nc = std::numeric_limits<int>::min();
    current_statement__ = 1668;
    nc = stan::model::rvalue(p, "p", stan::model::index_uni(i));
    int b_mark = std::numeric_limits<int>::min();
    current_statement__ = 1669;
    b_mark = 1;
    int theta_L_mark = std::numeric_limits<int>::min();
    current_statement__ = 1670;
    theta_L_mark = 1;
    current_statement__ = 1676;
    if (stan::math::logical_gt(i, 1)) {
      current_statement__ = 1674;
      for (int j = 1; j <= (i - 1); ++j) {
        current_statement__ = 1671;
        theta_L_mark = (theta_L_mark +
          (stan::model::rvalue(p, "p", stan::model::index_uni(j)) +
          stan::math::choose(
            stan::model::rvalue(p, "p", stan::model::index_uni(j)), 2)));
        current_statement__ = 1672;
        b_mark = (b_mark +
          (stan::model::rvalue(p, "p", stan::model::index_uni(j)) *
          stan::model::rvalue(l, "l", stan::model::index_uni(j))));
      }
    }
    current_statement__ = 1699;
    if (stan::math::logical_eq(nc, 1)) {
      local_scalar_t__ theta_L_start = DUMMY_VAR__;
      current_statement__ = 1695;
      theta_L_start = stan::model::rvalue(theta_L, "theta_L",
                        stan::model::index_uni(theta_L_mark));
      current_statement__ = 1697;
      for (int s = b_mark; s <= ((b_mark +
           stan::model::rvalue(l, "l", stan::model::index_uni(i))) - 1); ++s) {
        current_statement__ = 1696;
        stan::model::assign(b_matrix, (theta_L_start *
          stan::model::rvalue(z_b, "z_b", stan::model::index_uni(s))),
          "assigning variable b_matrix", stan::model::index_uni(nc),
          stan::model::index_uni(s));
      }
    } else {
      current_statement__ = 1677;
      stan::math::validate_non_negative_index("T_i", "nc", nc);
      current_statement__ = 1678;
      stan::math::validate_non_negative_index("T_i", "nc", nc);
      Eigen::Matrix<local_scalar_t__,-1,-1> T_i =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(nc, nc, DUMMY_VAR__);
      current_statement__ = 1679;
      stan::model::assign(T_i, stan::math::rep_matrix(0, nc, nc),
        "assigning variable T_i");
      current_statement__ = 1687;
      for (int c = 1; c <= nc; ++c) {
        current_statement__ = 1680;
        stan::model::assign(T_i,
          stan::model::rvalue(theta_L, "theta_L",
            stan::model::index_uni(theta_L_mark)), "assigning variable T_i",
          stan::model::index_uni(c), stan::model::index_uni(c));
        current_statement__ = 1681;
        theta_L_mark = (theta_L_mark + 1);
        current_statement__ = 1685;
        for (int r = (c + 1); r <= nc; ++r) {
          current_statement__ = 1682;
          stan::model::assign(T_i,
            stan::model::rvalue(theta_L, "theta_L",
              stan::model::index_uni(theta_L_mark)),
            "assigning variable T_i", stan::model::index_uni(r),
            stan::model::index_uni(c));
          current_statement__ = 1683;
          theta_L_mark = (theta_L_mark + 1);
        }
      }
      current_statement__ = 1693;
      for (int j = 1; j <=
           stan::model::rvalue(l, "l", stan::model::index_uni(i)); ++j) {
        current_statement__ = 1688;
        stan::math::validate_non_negative_index("temp", "nc", nc);
        Eigen::Matrix<local_scalar_t__,-1,1> temp =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nc, DUMMY_VAR__);
        current_statement__ = 1689;
        stan::model::assign(temp,
          stan::math::multiply(T_i, stan::math::segment(z_b, b_mark, nc)),
          "assigning variable temp");
        current_statement__ = 1690;
        stan::model::assign(b_matrix, temp, "assigning variable b_matrix",
          stan::model::index_omni(), stan::model::index_uni(j));
        current_statement__ = 1691;
        b_mark = (b_mark + nc);
      }
    }
    current_statement__ = 1700;
    return stan::math::transpose(b_matrix);
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename T2__, typename T5__,
          typename T6__, typename T7__, typename T8__, typename T12__,
          stan::require_all_t<stan::is_eigen_matrix_dynamic<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_col_vector<T6__>,
                              stan::is_vt_not_complex<T6__>,
                              stan::is_eigen_matrix_dynamic<T7__>,
                              stan::is_vt_not_complex<T7__>,
                              stan::is_eigen_matrix_dynamic<T8__>,
                              stan::is_vt_not_complex<T8__>,
                              stan::is_col_vector<T12__>,
                              stan::is_vt_not_complex<T12__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>, T1__, T2__, T5__,
                stan::base_type_t<T6__>,
                stan::promote_args_t<stan::base_type_t<T7__>,
                  stan::base_type_t<T8__>, stan::base_type_t<T12__>>>,-1,1>
evaluate_eta(const T0__& X_arg__,
             const std::vector<Eigen::Matrix<T1__,-1,1>>& Z1,
             const std::vector<Eigen::Matrix<T2__,-1,1>>& Z2,
             const std::vector<int>& Z1_id, const std::vector<int>& Z2_id,
             const std::vector<T5__>& gamma, const T6__& beta_arg__,
             const T7__& b1Mat_arg__, const T8__& b2Mat_arg__, const int&
             b1Mat_colshift, const int& b2Mat_colshift, const int&
             intercept_type, const T12__& Ti_arg__, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             T1__, T2__, T5__, stan::base_type_t<T6__>,
                             stan::promote_args_t<stan::base_type_t<T7__>,
                               stan::base_type_t<T8__>,
                               stan::base_type_t<T12__>>>;
  int current_statement__ = 0;
  const auto& X = stan::math::to_ref(X_arg__);
  const auto& beta = stan::math::to_ref(beta_arg__);
  const auto& b1Mat = stan::math::to_ref(b1Mat_arg__);
  const auto& b2Mat = stan::math::to_ref(b2Mat_arg__);
  const auto& Ti = stan::math::to_ref(Ti_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 1702;
    N = stan::math::rows(X);
    int K = std::numeric_limits<int>::min();
    current_statement__ = 1703;
    K = stan::math::rows(beta);
    int p1 = std::numeric_limits<int>::min();
    current_statement__ = 1704;
    p1 = stan::math::size(Z1);
    int p2 = std::numeric_limits<int>::min();
    current_statement__ = 1705;
    p2 = stan::math::size(Z2);
    current_statement__ = 1706;
    stan::math::validate_non_negative_index("eta", "N", N);
    Eigen::Matrix<local_scalar_t__,-1,1> eta =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
    current_statement__ = 1710;
    if (stan::math::logical_gt(K, 0)) {
      current_statement__ = 1709;
      stan::model::assign(eta, stan::math::multiply(X, beta),
        "assigning variable eta");
    } else {
      current_statement__ = 1708;
      stan::model::assign(eta, stan::math::rep_vector(0.0, N),
        "assigning variable eta");
    }
    current_statement__ = 1718;
    if (stan::math::logical_gt(intercept_type, 0)) {
      current_statement__ = 1716;
      if (stan::math::logical_eq(intercept_type, 1)) {
        current_statement__ = 1715;
        stan::model::assign(eta,
          stan::math::add(stan::model::deep_copy(eta),
            stan::model::rvalue(gamma, "gamma", stan::model::index_uni(1))),
          "assigning variable eta");
      } else {
        current_statement__ = 1714;
        if (stan::math::logical_eq(intercept_type, 2)) {
          current_statement__ = 1713;
          stan::model::assign(eta,
            stan::math::add(stan::model::deep_copy(eta),
              (stan::model::rvalue(gamma, "gamma", stan::model::index_uni(1))
              - stan::math::max(eta))), "assigning variable eta");
        } else {
          current_statement__ = 1712;
          if (stan::math::logical_eq(intercept_type, 3)) {
            current_statement__ = 1711;
            stan::model::assign(eta,
              stan::math::add(stan::model::deep_copy(eta),
                (stan::model::rvalue(gamma, "gamma",
                   stan::model::index_uni(1)) - stan::math::min(eta))),
              "assigning variable eta");
          }
        }
      }
    }
    current_statement__ = 1723;
    if (stan::math::logical_gt(p1, 0)) {
      current_statement__ = 1721;
      for (int k = 1; k <= p1; ++k) {
        current_statement__ = 1720;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 1719;
          stan::model::assign(eta,
            (stan::model::rvalue(eta, "eta", stan::model::index_uni(n)) +
            (stan::model::rvalue(b1Mat, "b1Mat",
               stan::model::index_uni(
                 stan::model::rvalue(Z1_id, "Z1_id",
                   stan::model::index_uni(n))),
               stan::model::index_uni((k + b1Mat_colshift))) *
            stan::model::rvalue(Z1, "Z1", stan::model::index_uni(k),
              stan::model::index_uni(n)))), "assigning variable eta",
            stan::model::index_uni(n));
        }
      }
    }
    current_statement__ = 1728;
    if (stan::math::logical_gt(p2, 0)) {
      current_statement__ = 1726;
      for (int k = 1; k <= p2; ++k) {
        current_statement__ = 1725;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 1724;
          stan::model::assign(eta,
            (stan::model::rvalue(eta, "eta", stan::model::index_uni(n)) +
            (stan::model::rvalue(b2Mat, "b2Mat",
               stan::model::index_uni(
                 stan::model::rvalue(Z2_id, "Z2_id",
                   stan::model::index_uni(n))),
               stan::model::index_uni((k + b2Mat_colshift))) *
            stan::model::rvalue(Z2, "Z2", stan::model::index_uni(k),
              stan::model::index_uni(n)))), "assigning variable eta",
            stan::model::index_uni(n));
        }
      }
    }
    current_statement__ = 1730;
    if (stan::math::logical_gt(stan::math::rows(Ti), 0)) {
      current_statement__ = 1729;
      stan::model::assign(eta,
        stan::math::add(stan::model::deep_copy(eta), Ti),
        "assigning variable eta");
    }
    current_statement__ = 1731;
    return eta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
evaluate_mu(const T0__& eta_arg__, const int& family, const int& link,
            std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1733;
    stan::math::validate_non_negative_index("mu", "rows(eta)",
      stan::math::rows(eta));
    Eigen::Matrix<local_scalar_t__,-1,1> mu =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(eta),
        DUMMY_VAR__);
    current_statement__ = 1746;
    if (stan::math::logical_eq(family, 1)) {
      current_statement__ = 1745;
      stan::model::assign(mu, linkinv_gauss(eta, link, pstream__),
        "assigning variable mu");
    } else {
      current_statement__ = 1744;
      if (stan::math::logical_eq(family, 2)) {
        current_statement__ = 1743;
        stan::model::assign(mu, linkinv_gamma(eta, link, pstream__),
          "assigning variable mu");
      } else {
        current_statement__ = 1742;
        if (stan::math::logical_eq(family, 3)) {
          current_statement__ = 1741;
          stan::model::assign(mu, linkinv_inv_gaussian(eta, link, pstream__),
            "assigning variable mu");
        } else {
          current_statement__ = 1740;
          if (stan::math::logical_eq(family, 4)) {
            current_statement__ = 1739;
            stan::model::assign(mu, linkinv_bern(eta, link, pstream__),
              "assigning variable mu");
          } else {
            current_statement__ = 1738;
            if (stan::math::logical_eq(family, 5)) {
              current_statement__ = 1737;
              stan::model::assign(mu, linkinv_binom(eta, link, pstream__),
                "assigning variable mu");
            } else {
              current_statement__ = 1736;
              if ((stan::math::primitive_value(
                     (stan::math::primitive_value(
                        stan::math::logical_eq(family, 6)) ||
                     stan::math::primitive_value(
                       stan::math::logical_eq(family, 7))))
                  ||
                  stan::math::primitive_value(
                    stan::math::logical_eq(family, 8)))) {
                current_statement__ = 1735;
                stan::model::assign(mu, linkinv_count(eta, link, pstream__),
                  "assigning variable mu");
              }
            }
          }
        }
      }
    }
    current_statement__ = 1747;
    return mu;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T2__, typename T3__,
          typename T6__, typename T7__, typename T8__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_col_vector<T7__>,
                              stan::is_vt_not_complex<T7__>,
                              stan::is_col_vector<T8__>,
                              stan::is_vt_not_complex<T8__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T2__>, T3__,
  T6__, stan::base_type_t<T7__>,
  stan::promote_args_t<stan::base_type_t<T8__>>>
glm_lpdf(const T0__& y_real_arg__, const std::vector<int>& y_integer,
         const T2__& eta_arg__, const std::vector<T3__>& aux, const int&
         family, const int& link, const T6__& sum_log_y, const T7__&
         sqrt_y_arg__, const T8__& log_y_arg__, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T2__>, T3__, T6__,
                             stan::base_type_t<T7__>,
                             stan::promote_args_t<stan::base_type_t<T8__>>>;
  int current_statement__ = 0;
  const auto& y_real = stan::math::to_ref(y_real_arg__);
  const auto& eta = stan::math::to_ref(eta_arg__);
  const auto& sqrt_y = stan::math::to_ref(sqrt_y_arg__);
  const auto& log_y = stan::math::to_ref(log_y_arg__);
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 1749;
    lp = 0;
    current_statement__ = 1781;
    if (stan::math::logical_eq(family, 1)) {
      current_statement__ = 1779;
      if (stan::math::logical_eq(link, 1)) {
        current_statement__ = 1778;
        lp = (lp +
          stan::math::normal_lpdf<false>(y_real, eta,
            stan::model::rvalue(aux, "aux", stan::model::index_uni(1))));
      } else {
        current_statement__ = 1777;
        if (stan::math::logical_eq(link, 2)) {
          current_statement__ = 1776;
          lp = (lp +
            stan::math::lognormal_lpdf<false>(y_real, eta,
              stan::model::rvalue(aux, "aux", stan::model::index_uni(1))));
        } else {
          current_statement__ = 1775;
          lp = (lp +
            stan::math::normal_lpdf<false>(y_real, stan::math::inv(eta),
              stan::model::rvalue(aux, "aux", stan::model::index_uni(1))));
        }
      }
    } else {
      current_statement__ = 1774;
      if (stan::math::logical_eq(family, 2)) {
        current_statement__ = 1772;
        lp = (lp +
          GammaReg(y_real, eta,
            stan::model::rvalue(aux, "aux", stan::model::index_uni(1)), link,
            sum_log_y, pstream__));
      } else {
        current_statement__ = 1771;
        if (stan::math::logical_eq(family, 3)) {
          current_statement__ = 1769;
          lp = (lp +
            inv_gaussian(y_real, linkinv_inv_gaussian(eta, link, pstream__),
              stan::model::rvalue(aux, "aux", stan::model::index_uni(1)),
              sum_log_y, sqrt_y, pstream__));
        } else {
          current_statement__ = 1768;
          if (stan::math::logical_eq(family, 4)) {
            current_statement__ = 1766;
            if (stan::math::logical_eq(link, 1)) {
              current_statement__ = 1765;
              lp = (lp +
                stan::math::bernoulli_logit_lpmf<false>(y_integer, eta));
            } else {
              current_statement__ = 1764;
              lp = (lp +
                stan::math::bernoulli_lpmf<false>(y_integer,
                  linkinv_bern(eta, link, pstream__)));
            }
          } else {
            current_statement__ = 1763;
            if (stan::math::logical_eq(family, 5)) {
              current_statement__ = 1761;
              std::stringstream errmsg_stream__;
              stan::math::stan_print(&errmsg_stream__,
                "Binomial with >1 trials not allowed.");
              throw std::domain_error(errmsg_stream__.str());
            } else {
              current_statement__ = 1760;
              if ((stan::math::primitive_value(
                     stan::math::logical_eq(family, 6))
                  ||
                  stan::math::primitive_value(
                    stan::math::logical_eq(family, 8)))) {
                current_statement__ = 1758;
                if (stan::math::logical_eq(link, 1)) {
                  current_statement__ = 1757;
                  lp = (lp +
                    stan::math::poisson_log_lpmf<false>(y_integer, eta));
                } else {
                  current_statement__ = 1756;
                  lp = (lp +
                    stan::math::poisson_lpmf<false>(y_integer,
                      linkinv_count(eta, link, pstream__)));
                }
              } else {
                current_statement__ = 1755;
                if (stan::math::logical_eq(family, 7)) {
                  current_statement__ = 1753;
                  if (stan::math::logical_eq(link, 1)) {
                    current_statement__ = 1752;
                    lp = (lp +
                      stan::math::neg_binomial_2_log_lpmf<false>(y_integer,
                        eta,
                        stan::model::rvalue(aux, "aux",
                          stan::model::index_uni(1))));
                  } else {
                    current_statement__ = 1751;
                    lp = (lp +
                      stan::math::neg_binomial_2_lpmf<false>(y_integer,
                        linkinv_count(eta, link, pstream__),
                        stan::model::rvalue(aux, "aux",
                          stan::model::index_uni(1))));
                  }
                } else {
                  current_statement__ = 1750;
                  std::stringstream errmsg_stream__;
                  stan::math::stan_print(&errmsg_stream__, "Invalid family.");
                  throw std::domain_error(errmsg_stream__.str());
                }
              }
            }
          }
        }
      }
    }
    current_statement__ = 1782;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T2__, typename T3__,
          typename T4__, typename T5__, typename T6__, typename T7__,
          typename T8__, typename T9__, typename T10__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_stan_scalar<T4__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_stan_scalar<T7__>,
                              stan::is_stan_scalar<T8__>,
                              stan::is_stan_scalar<T9__>,
                              stan::is_stan_scalar<T10__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T2__>,
  stan::base_type_t<T3__>, T4__, T5__,
  stan::promote_args_t<T6__, T7__, T8__, T9__, T10__>>
beta_custom_lpdf(const T0__& z_beta_arg__, const int& prior_dist, const T2__&
                 prior_scale_arg__, const T3__& prior_df_arg__, const T4__&
                 global_prior_df,
                 const std::vector<Eigen::Matrix<T5__,-1,1>>& local,
                 const std::vector<T6__>& global,
                 const std::vector<Eigen::Matrix<T7__,-1,1>>& mix,
                 const std::vector<T8__>& one_over_lambda, const T9__&
                 slab_df, const std::vector<T10__>& caux, std::ostream*
                 pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T2__>,
                             stan::base_type_t<T3__>, T4__, T5__,
                             stan::promote_args_t<T6__, T7__, T8__, T9__,
                               T10__>>;
  int current_statement__ = 0;
  const auto& z_beta = stan::math::to_ref(z_beta_arg__);
  const auto& prior_scale = stan::math::to_ref(prior_scale_arg__);
  const auto& prior_df = stan::math::to_ref(prior_df_arg__);
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 1784;
    lp = 0;
    current_statement__ = 1818;
    if (stan::math::logical_eq(prior_dist, 1)) {
      current_statement__ = 1817;
      lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
    } else {
      current_statement__ = 1816;
      if (stan::math::logical_eq(prior_dist, 2)) {
        current_statement__ = 1815;
        lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
      } else {
        current_statement__ = 1814;
        if (stan::math::logical_eq(prior_dist, 3)) {
          current_statement__ = 1807;
          lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
          current_statement__ = 1808;
          lp = (lp +
            stan::math::normal_lpdf<false>(
              stan::model::rvalue(local, "local", stan::model::index_uni(1)),
              0, 1));
          current_statement__ = 1809;
          lp = (lp +
            stan::math::inv_gamma_lpdf<false>(
              stan::model::rvalue(local, "local", stan::model::index_uni(2)),
              stan::math::multiply(0.5, prior_df),
              stan::math::multiply(0.5, prior_df)));
          current_statement__ = 1810;
          lp = (lp +
            stan::math::normal_lpdf<false>(
              stan::model::rvalue(global, "global", stan::model::index_uni(1)),
              0, 1));
          current_statement__ = 1811;
          lp = (lp +
            stan::math::inv_gamma_lpdf<false>(
              stan::model::rvalue(global, "global", stan::model::index_uni(2)),
              (0.5 * global_prior_df), (0.5 * global_prior_df)));
          current_statement__ = 1812;
          lp = (lp +
            stan::math::inv_gamma_lpdf<false>(caux, (0.5 * slab_df), (0.5 *
              slab_df)));
        } else {
          current_statement__ = 1806;
          if (stan::math::logical_eq(prior_dist, 4)) {
            current_statement__ = 1797;
            lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
            current_statement__ = 1798;
            lp = (lp +
              stan::math::normal_lpdf<false>(
                stan::model::rvalue(local, "local", stan::model::index_uni(1)),
                0, 1));
            current_statement__ = 1799;
            lp = (lp +
              stan::math::inv_gamma_lpdf<false>(
                stan::model::rvalue(local, "local", stan::model::index_uni(2)),
                stan::math::multiply(0.5, prior_df),
                stan::math::multiply(0.5, prior_df)));
            current_statement__ = 1800;
            lp = (lp +
              stan::math::normal_lpdf<false>(
                stan::model::rvalue(local, "local", stan::model::index_uni(3)),
                0, 1));
            current_statement__ = 1801;
            lp = (lp +
              stan::math::inv_gamma_lpdf<false>(
                stan::model::rvalue(local, "local", stan::model::index_uni(4)),
                stan::math::multiply(0.5, prior_scale),
                stan::math::multiply(0.5, prior_scale)));
            current_statement__ = 1802;
            lp = (lp +
              stan::math::normal_lpdf<false>(
                stan::model::rvalue(global, "global",
                  stan::model::index_uni(1)), 0, 1));
            current_statement__ = 1803;
            lp = (lp +
              stan::math::inv_gamma_lpdf<false>(
                stan::model::rvalue(global, "global",
                  stan::model::index_uni(2)), (0.5 * global_prior_df), (0.5 *
                global_prior_df)));
            current_statement__ = 1804;
            lp = (lp +
              stan::math::inv_gamma_lpdf<false>(caux, (0.5 * slab_df), (0.5 *
                slab_df)));
          } else {
            current_statement__ = 1796;
            if (stan::math::logical_eq(prior_dist, 5)) {
              current_statement__ = 1793;
              lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
              current_statement__ = 1794;
              lp = (lp +
                stan::math::exponential_lpdf<false>(
                  stan::model::rvalue(mix, "mix", stan::model::index_uni(1)),
                  1));
            } else {
              current_statement__ = 1792;
              if (stan::math::logical_eq(prior_dist, 6)) {
                current_statement__ = 1788;
                lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
                current_statement__ = 1789;
                lp = (lp +
                  stan::math::exponential_lpdf<false>(
                    stan::model::rvalue(mix, "mix", stan::model::index_uni(1)),
                    1));
                current_statement__ = 1790;
                lp = (lp +
                  stan::math::chi_square_lpdf<false>(
                    stan::model::rvalue(one_over_lambda, "one_over_lambda",
                      stan::model::index_uni(1)),
                    stan::model::rvalue(prior_df, "prior_df",
                      stan::model::index_uni(1))));
              } else {
                current_statement__ = 1787;
                if (stan::math::logical_eq(prior_dist, 7)) {
                  current_statement__ = 1785;
                  lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
                }
              }
            }
          }
        }
      }
    }
    current_statement__ = 1819;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T2__, typename T3__,
          typename T4__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T4__>>*>
stan::promote_args_t<T0__, T2__, T3__, T4__>
gamma_custom_lpdf(const T0__& gamma, const int& dist, const T2__& mean_,
                  const T3__& scale, const T4__& df, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<T0__, T2__, T3__, T4__>;
  int current_statement__ = 0;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 1821;
    lp = 0;
    current_statement__ = 1825;
    if (stan::math::logical_eq(dist, 1)) {
      current_statement__ = 1824;
      lp = (lp + stan::math::normal_lpdf<false>(gamma, mean_, scale));
    } else {
      current_statement__ = 1823;
      if (stan::math::logical_eq(dist, 2)) {
        current_statement__ = 1822;
        lp = (lp +
          stan::math::student_t_lpdf<false>(gamma, df, mean_, scale));
      }
    }
    current_statement__ = 1826;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T2__, typename T3__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>>*>
stan::promote_args_t<T0__, T2__, T3__>
aux_lpdf(const T0__& aux_unscaled, const int& dist, const T2__& scale,
         const T3__& df, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<T0__, T2__, T3__>;
  int current_statement__ = 0;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 1828;
    lp = 0;
    current_statement__ = 1835;
    if ((stan::math::primitive_value(stan::math::logical_gt(dist, 0)) &&
        stan::math::primitive_value(stan::math::logical_gt(scale, 0)))) {
      current_statement__ = 1833;
      if (stan::math::logical_eq(dist, 1)) {
        current_statement__ = 1832;
        lp = (lp + stan::math::normal_lpdf<false>(aux_unscaled, 0, 1));
      } else {
        current_statement__ = 1831;
        if (stan::math::logical_eq(dist, 2)) {
          current_statement__ = 1830;
          lp = (lp +
            stan::math::student_t_lpdf<false>(aux_unscaled, df, 0, 1));
        } else {
          current_statement__ = 1829;
          lp = (lp + stan::math::exponential_lpdf<false>(aux_unscaled, 1));
        }
      }
    }
    current_statement__ = 1836;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename RNG,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, T1__>
mean_PPD_rng(const T0__& mu_arg__, const std::vector<T1__>& aux, const int&
             family, RNG& base_rng__, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             T1__>;
  int current_statement__ = 0;
  const auto& mu = stan::math::to_ref(mu_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 1838;
    N = stan::math::rows(mu);
    local_scalar_t__ mean_PPD = DUMMY_VAR__;
    current_statement__ = 1839;
    mean_PPD = 0;
    current_statement__ = 1878;
    if (stan::math::logical_eq(family, 1)) {
      current_statement__ = 1876;
      for (int n = 1; n <= N; ++n) {
        current_statement__ = 1875;
        mean_PPD = (mean_PPD +
          stan::math::normal_rng(
            stan::model::rvalue(mu, "mu", stan::model::index_uni(n)),
            stan::model::rvalue(aux, "aux", stan::model::index_uni(1)),
            base_rng__));
      }
    } else {
      current_statement__ = 1874;
      if (stan::math::logical_eq(family, 2)) {
        current_statement__ = 1872;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 1871;
          mean_PPD = (mean_PPD +
            stan::math::gamma_rng(
              stan::model::rvalue(aux, "aux", stan::model::index_uni(1)),
              (stan::model::rvalue(aux, "aux", stan::model::index_uni(1)) /
              stan::model::rvalue(mu, "mu", stan::model::index_uni(n))),
              base_rng__));
        }
      } else {
        current_statement__ = 1870;
        if (stan::math::logical_eq(family, 3)) {
          current_statement__ = 1868;
          for (int n = 1; n <= N; ++n) {
            current_statement__ = 1867;
            mean_PPD = (mean_PPD +
              inv_gaussian_rng(
                stan::model::rvalue(mu, "mu", stan::model::index_uni(n)),
                stan::model::rvalue(aux, "aux", stan::model::index_uni(1)),
                base_rng__, pstream__));
          }
        } else {
          current_statement__ = 1866;
          if (stan::math::logical_eq(family, 4)) {
            current_statement__ = 1864;
            for (int n = 1; n <= N; ++n) {
              current_statement__ = 1863;
              mean_PPD = (mean_PPD +
                stan::math::bernoulli_rng(
                  stan::model::rvalue(mu, "mu", stan::model::index_uni(n)),
                  base_rng__));
            }
          } else {
            current_statement__ = 1862;
            if (stan::math::logical_eq(family, 5)) {
              current_statement__ = 1860;
              std::stringstream errmsg_stream__;
              stan::math::stan_print(&errmsg_stream__,
                "Binomial with >1 trials not allowed.");
              throw std::domain_error(errmsg_stream__.str());
            } else {
              current_statement__ = 1859;
              if ((stan::math::primitive_value(
                     stan::math::logical_eq(family, 6))
                  ||
                  stan::math::primitive_value(
                    stan::math::logical_eq(family, 8)))) {
                local_scalar_t__ poisson_max = DUMMY_VAR__;
                current_statement__ = 1852;
                poisson_max = stan::math::pow(2.0, 30.0);
                current_statement__ = 1857;
                for (int n = 1; n <= N; ++n) {
                  current_statement__ = 1855;
                  if (stan::math::logical_lt(
                        stan::model::rvalue(mu, "mu",
                          stan::model::index_uni(n)), poisson_max)) {
                    current_statement__ = 1854;
                    mean_PPD = (mean_PPD +
                      stan::math::poisson_rng(
                        stan::model::rvalue(mu, "mu",
                          stan::model::index_uni(n)), base_rng__));
                  } else {
                    current_statement__ = 1853;
                    mean_PPD = (mean_PPD +
                      stan::math::normal_rng(
                        stan::model::rvalue(mu, "mu",
                          stan::model::index_uni(n)),
                        stan::math::sqrt(
                          stan::model::rvalue(mu, "mu",
                            stan::model::index_uni(n))), base_rng__));
                  }
                }
              } else {
                current_statement__ = 1851;
                if (stan::math::logical_eq(family, 7)) {
                  local_scalar_t__ poisson_max = DUMMY_VAR__;
                  current_statement__ = 1840;
                  poisson_max = stan::math::pow(2.0, 30.0);
                  current_statement__ = 1849;
                  for (int n = 1; n <= N; ++n) {
                    local_scalar_t__ gamma_temp = DUMMY_VAR__;
                    current_statement__ = 1844;
                    if (stan::math::is_inf(
                          stan::model::rvalue(aux, "aux",
                            stan::model::index_uni(1)))) {
                      current_statement__ = 1843;
                      gamma_temp = stan::model::rvalue(mu, "mu",
                                     stan::model::index_uni(n));
                    } else {
                      current_statement__ = 1842;
                      gamma_temp = stan::math::gamma_rng(
                                     stan::model::rvalue(aux, "aux",
                                       stan::model::index_uni(1)),
                                     (stan::model::rvalue(aux, "aux",
                                        stan::model::index_uni(1)) /
                                     stan::model::rvalue(mu, "mu",
                                       stan::model::index_uni(n))),
                                     base_rng__);
                    }
                    current_statement__ = 1847;
                    if (stan::math::logical_lt(gamma_temp, poisson_max)) {
                      current_statement__ = 1846;
                      mean_PPD = (mean_PPD +
                        stan::math::poisson_rng(gamma_temp, base_rng__));
                    } else {
                      current_statement__ = 1845;
                      mean_PPD = (mean_PPD +
                        stan::math::normal_rng(gamma_temp,
                          stan::math::sqrt(gamma_temp), base_rng__));
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    current_statement__ = 1879;
    mean_PPD = (mean_PPD / N);
    current_statement__ = 1880;
    return mean_PPD;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T2__, typename T3__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T2__>, stan::base_type_t<T3__>>,-1,1>
make_basehaz_coef(const T0__& aux_unscaled_arg__, const int& prior_dist,
                  const T2__& prior_mean_arg__, const T3__&
                  prior_scale_arg__, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T2__>,
                             stan::base_type_t<T3__>>;
  int current_statement__ = 0;
  const auto& aux_unscaled = stan::math::to_ref(aux_unscaled_arg__);
  const auto& prior_mean = stan::math::to_ref(prior_mean_arg__);
  const auto& prior_scale = stan::math::to_ref(prior_scale_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1882;
    stan::math::validate_non_negative_index("aux", "rows(aux_unscaled)",
      stan::math::rows(aux_unscaled));
    Eigen::Matrix<local_scalar_t__,-1,1> aux =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(
                                                       aux_unscaled),
        DUMMY_VAR__);
    current_statement__ = 1889;
    if (stan::math::logical_eq(prior_dist, 0)) {
      current_statement__ = 1888;
      stan::model::assign(aux, aux_unscaled, "assigning variable aux");
    } else {
      current_statement__ = 1884;
      stan::model::assign(aux,
        stan::math::elt_multiply(prior_scale, aux_unscaled),
        "assigning variable aux");
      current_statement__ = 1886;
      if (stan::math::logical_lte(prior_dist, 2)) {
        current_statement__ = 1885;
        stan::model::assign(aux,
          stan::math::add(stan::model::deep_copy(aux), prior_mean),
          "assigning variable aux");
      }
    }
    current_statement__ = 1890;
    return aux;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T2__, typename T3__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T2__>,
  stan::base_type_t<T3__>>
basehaz_lpdf(const T0__& aux_unscaled_arg__, const int& dist, const T2__&
             scale_arg__, const T3__& df_arg__, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T2__>,
                             stan::base_type_t<T3__>>;
  int current_statement__ = 0;
  const auto& aux_unscaled = stan::math::to_ref(aux_unscaled_arg__);
  const auto& scale = stan::math::to_ref(scale_arg__);
  const auto& df = stan::math::to_ref(df_arg__);
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 1892;
    lp = 0;
    current_statement__ = 1899;
    if (stan::math::logical_gt(dist, 0)) {
      current_statement__ = 1897;
      if (stan::math::logical_eq(dist, 1)) {
        current_statement__ = 1896;
        lp = (lp + stan::math::normal_lpdf<false>(aux_unscaled, 0, 1));
      } else {
        current_statement__ = 1895;
        if (stan::math::logical_eq(dist, 2)) {
          current_statement__ = 1894;
          lp = (lp +
            stan::math::student_t_lpdf<false>(aux_unscaled, df, 0, 1));
        } else {
          current_statement__ = 1893;
          lp = (lp + stan::math::exponential_lpdf<false>(aux_unscaled, 1));
        }
      }
    }
    current_statement__ = 1900;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
collapse_within_groups(const T0__& eta_arg__,
                       const std::vector<std::vector<int>>& grp_idx,
                       const int& grp_assoc, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 1902;
    N = stan::math::size(grp_idx);
    current_statement__ = 1903;
    stan::math::validate_non_negative_index("val", "N", N);
    Eigen::Matrix<local_scalar_t__,-1,1> val =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
    current_statement__ = 1920;
    if (stan::math::logical_eq(grp_assoc, 1)) {
      current_statement__ = 1918;
      for (int n = 1; n <= N; ++n) {
        current_statement__ = 1917;
        stan::model::assign(val,
          stan::math::sum(
            stan::model::rvalue(eta, "eta",
              stan::model::index_min_max(
                stan::model::rvalue(grp_idx, "grp_idx",
                  stan::model::index_uni(n), stan::model::index_uni(1)),
                stan::model::rvalue(grp_idx, "grp_idx",
                  stan::model::index_uni(n), stan::model::index_uni(2))))),
          "assigning variable val", stan::model::index_uni(n));
      }
    } else {
      current_statement__ = 1916;
      if (stan::math::logical_eq(grp_assoc, 2)) {
        current_statement__ = 1914;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 1913;
          stan::model::assign(val,
            stan::math::mean(
              stan::model::rvalue(eta, "eta",
                stan::model::index_min_max(
                  stan::model::rvalue(grp_idx, "grp_idx",
                    stan::model::index_uni(n), stan::model::index_uni(1)),
                  stan::model::rvalue(grp_idx, "grp_idx",
                    stan::model::index_uni(n), stan::model::index_uni(2))))),
            "assigning variable val", stan::model::index_uni(n));
        }
      } else {
        current_statement__ = 1912;
        if (stan::math::logical_eq(grp_assoc, 3)) {
          current_statement__ = 1910;
          for (int n = 1; n <= N; ++n) {
            current_statement__ = 1909;
            stan::model::assign(val,
              stan::math::min(
                stan::model::rvalue(eta, "eta",
                  stan::model::index_min_max(
                    stan::model::rvalue(grp_idx, "grp_idx",
                      stan::model::index_uni(n), stan::model::index_uni(1)),
                    stan::model::rvalue(grp_idx, "grp_idx",
                      stan::model::index_uni(n), stan::model::index_uni(2))))),
              "assigning variable val", stan::model::index_uni(n));
          }
        } else {
          current_statement__ = 1908;
          if (stan::math::logical_eq(grp_assoc, 4)) {
            current_statement__ = 1906;
            for (int n = 1; n <= N; ++n) {
              current_statement__ = 1905;
              stan::model::assign(val,
                stan::math::max(
                  stan::model::rvalue(eta, "eta",
                    stan::model::index_min_max(
                      stan::model::rvalue(grp_idx, "grp_idx",
                        stan::model::index_uni(n), stan::model::index_uni(1)),
                      stan::model::rvalue(grp_idx, "grp_idx",
                        stan::model::index_uni(n), stan::model::index_uni(2))))),
                "assigning variable val", stan::model::index_uni(n));
            }
          }
        }
      }
    }
    current_statement__ = 1921;
    return val;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,-1>
make_x_assoc_shared_b(const T0__& b_arg__, const std::vector<int>& l,
                      const std::vector<int>& p,
                      const std::vector<std::vector<int>>& pmat, const int&
                      Npat, const int& qnodes, const std::vector<int>&
                      which_b, const int& sum_size_which_b,
                      const std::vector<int>& size_which_b, const int& t_i,
                      const int& M, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& b = stan::math::to_ref(b_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int prior_shift = std::numeric_limits<int>::min();
    int start_store = std::numeric_limits<int>::min();
    int end_store = std::numeric_limits<int>::min();
    current_statement__ = 1926;
    stan::math::validate_non_negative_index("temp", "Npat", Npat);
    current_statement__ = 1927;
    stan::math::validate_non_negative_index("temp", "sum_size_which_b",
      sum_size_which_b);
    Eigen::Matrix<local_scalar_t__,-1,-1> temp =
      Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(Npat, sum_size_which_b,
        DUMMY_VAR__);
    current_statement__ = 1929;
    stan::math::validate_non_negative_index("x_assoc_shared_b",
      "(Npat * (qnodes + 1))", (Npat * (qnodes + 1)));
    current_statement__ = 1930;
    stan::math::validate_non_negative_index("x_assoc_shared_b",
      "sum_size_which_b", sum_size_which_b);
    Eigen::Matrix<local_scalar_t__,-1,-1> x_assoc_shared_b =
      Eigen::Matrix<local_scalar_t__,-1,-1>::Constant((Npat * (qnodes + 1)),
        sum_size_which_b, DUMMY_VAR__);
    current_statement__ = 1934;
    if (stan::math::logical_eq(t_i, 1)) {
      current_statement__ = 1933;
      prior_shift = 0;
    } else {
      current_statement__ = 1932;
      prior_shift = stan::math::sum(
                      stan::model::rvalue(l, "l",
                        stan::model::index_min_max(1, (t_i - 1))));
    }
    current_statement__ = 1959;
    for (int i = 1; i <= Npat; ++i) {
      int mark = std::numeric_limits<int>::min();
      int start_collect = std::numeric_limits<int>::min();
      current_statement__ = 1937;
      mark = 1;
      current_statement__ = 1938;
      start_collect = (prior_shift + ((i - 1) *
        stan::model::rvalue(p, "p", stan::model::index_uni(t_i))));
      current_statement__ = 1957;
      for (int m = 1; m <= M; ++m) {
        current_statement__ = 1955;
        if (stan::math::logical_gt(
              stan::model::rvalue(size_which_b, "size_which_b",
                stan::model::index_uni(m)), 0)) {
          int shift = std::numeric_limits<int>::min();
          int j_shift = std::numeric_limits<int>::min();
          current_statement__ = 1947;
          if (stan::math::logical_eq(m, 1)) {
            current_statement__ = 1944;
            shift = 0;
            current_statement__ = 1945;
            j_shift = 0;
          } else {
            current_statement__ = 1941;
            shift = stan::math::sum(
                      stan::model::rvalue(pmat, "pmat",
                        stan::model::index_uni(t_i),
                        stan::model::index_min_max(1, (m - 1))));
            current_statement__ = 1942;
            j_shift = stan::math::sum(
                        stan::model::rvalue(size_which_b, "size_which_b",
                          stan::model::index_min_max(1, (m - 1))));
          }
          current_statement__ = 1953;
          for (int j = 1; j <=
               stan::model::rvalue(size_which_b, "size_which_b",
                 stan::model::index_uni(m)); ++j) {
            int item_collect = std::numeric_limits<int>::min();
            current_statement__ = 1949;
            item_collect = ((start_collect + shift) +
              stan::model::rvalue(which_b, "which_b",
                stan::model::index_uni((j_shift + j))));
            current_statement__ = 1950;
            stan::model::assign(temp,
              stan::model::rvalue(b, "b",
                stan::model::index_uni(item_collect)),
              "assigning variable temp", stan::model::index_uni(i),
              stan::model::index_uni(mark));
            current_statement__ = 1951;
            mark = (mark + 1);
          }
        }
      }
    }
    current_statement__ = 1964;
    for (int i = 1; i <= (qnodes + 1); ++i) {
      current_statement__ = 1960;
      start_store = (((i - 1) * Npat) + 1);
      current_statement__ = 1961;
      end_store = (i * Npat);
      current_statement__ = 1962;
      stan::model::assign(x_assoc_shared_b, temp,
        "assigning variable x_assoc_shared_b",
        stan::model::index_min_max(start_store, end_store),
        stan::model::index_omni());
    }
    current_statement__ = 1965;
    return x_assoc_shared_b;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename T18__, typename T19__,
          typename T20__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T18__>,
                              stan::is_stan_scalar<T19__>,
                              stan::is_stan_scalar<T20__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T18__, T19__, T20__>,-1,-1>
make_x_assoc_shared_coef(const T0__& b_arg__, const T1__& beta_arg__,
                         const std::vector<int>& KM, const int& M, const int&
                         t_i, const std::vector<int>& l,
                         const std::vector<int>& p,
                         const std::vector<std::vector<int>>& pmat,
                         const int& Npat, const int& qnodes, const int&
                         sum_size_which_coef, const std::vector<int>&
                         size_which_coef, const std::vector<int>&
                         which_coef_zindex, const std::vector<int>&
                         which_coef_xindex, const std::vector<int>&
                         has_intercept, const std::vector<int>&
                         has_intercept_nob, const std::vector<int>&
                         has_intercept_lob, const std::vector<int>&
                         has_intercept_upb, const std::vector<T18__>&
                         gamma_nob, const std::vector<T19__>& gamma_lob,
                         const std::vector<T20__>& gamma_upb, std::ostream*
                         pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>, T18__, T19__, T20__>;
  int current_statement__ = 0;
  const auto& b = stan::math::to_ref(b_arg__);
  const auto& beta = stan::math::to_ref(beta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int t_shift = std::numeric_limits<int>::min();
    int start_store = std::numeric_limits<int>::min();
    int end_store = std::numeric_limits<int>::min();
    current_statement__ = 1970;
    stan::math::validate_non_negative_index("temp", "Npat", Npat);
    current_statement__ = 1971;
    stan::math::validate_non_negative_index("temp", "sum_size_which_coef",
      sum_size_which_coef);
    Eigen::Matrix<local_scalar_t__,-1,-1> temp =
      Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(Npat,
        sum_size_which_coef, DUMMY_VAR__);
    current_statement__ = 1973;
    stan::math::validate_non_negative_index("x_assoc_shared_coef",
      "(Npat * (qnodes + 1))", (Npat * (qnodes + 1)));
    current_statement__ = 1974;
    stan::math::validate_non_negative_index("x_assoc_shared_coef",
      "sum_size_which_coef", sum_size_which_coef);
    Eigen::Matrix<local_scalar_t__,-1,-1> x_assoc_shared_coef =
      Eigen::Matrix<local_scalar_t__,-1,-1>::Constant((Npat * (qnodes + 1)),
        sum_size_which_coef, DUMMY_VAR__);
    current_statement__ = 1978;
    if (stan::math::logical_eq(t_i, 1)) {
      current_statement__ = 1977;
      t_shift = 0;
    } else {
      current_statement__ = 1976;
      t_shift = stan::math::sum(
                  stan::model::rvalue(l, "l",
                    stan::model::index_min_max(1, (t_i - 1))));
    }
    current_statement__ = 2033;
    for (int i = 1; i <= Npat; ++i) {
      int mark = std::numeric_limits<int>::min();
      int i_shift = std::numeric_limits<int>::min();
      current_statement__ = 1981;
      mark = 1;
      current_statement__ = 1982;
      i_shift = ((i - 1) *
        stan::model::rvalue(p, "p", stan::model::index_uni(t_i)));
      current_statement__ = 2031;
      for (int m = 1; m <= M; ++m) {
        current_statement__ = 2029;
        if (stan::math::logical_gt(
              stan::model::rvalue(size_which_coef, "size_which_coef",
                stan::model::index_uni(m)), 0)) {
          int j_shift = std::numeric_limits<int>::min();
          int m_shift = std::numeric_limits<int>::min();
          int shift_nb = std::numeric_limits<int>::min();
          int shift_lb = std::numeric_limits<int>::min();
          int shift_ub = std::numeric_limits<int>::min();
          int shift_beta = std::numeric_limits<int>::min();
          current_statement__ = 2003;
          if (stan::math::logical_eq(m, 1)) {
            current_statement__ = 1996;
            j_shift = 0;
            current_statement__ = 1997;
            m_shift = 0;
            current_statement__ = 1998;
            shift_nb = 0;
            current_statement__ = 1999;
            shift_lb = 0;
            current_statement__ = 2000;
            shift_ub = 0;
            current_statement__ = 2001;
            shift_beta = 0;
          } else {
            current_statement__ = 1989;
            j_shift = stan::math::sum(
                        stan::model::rvalue(size_which_coef,
                          "size_which_coef",
                          stan::model::index_min_max(1, (m - 1))));
            current_statement__ = 1990;
            m_shift = stan::math::sum(
                        stan::model::rvalue(pmat, "pmat",
                          stan::model::index_uni(t_i),
                          stan::model::index_min_max(1, (m - 1))));
            current_statement__ = 1991;
            shift_nb = stan::math::sum(
                         stan::model::rvalue(has_intercept_nob,
                           "has_intercept_nob",
                           stan::model::index_min_max(1, (m - 1))));
            current_statement__ = 1992;
            shift_lb = stan::math::sum(
                         stan::model::rvalue(has_intercept_lob,
                           "has_intercept_lob",
                           stan::model::index_min_max(1, (m - 1))));
            current_statement__ = 1993;
            shift_ub = stan::math::sum(
                         stan::model::rvalue(has_intercept_upb,
                           "has_intercept_upb",
                           stan::model::index_min_max(1, (m - 1))));
            current_statement__ = 1994;
            shift_beta = stan::math::sum(
                           stan::model::rvalue(KM, "KM",
                             stan::model::index_min_max(1, (m - 1))));
          }
          current_statement__ = 2027;
          for (int j = 1; j <=
               stan::model::rvalue(size_which_coef, "size_which_coef",
                 stan::model::index_uni(m)); ++j) {
            int b_collect = std::numeric_limits<int>::min();
            int beta_collect_m = std::numeric_limits<int>::min();
            int beta_collect = std::numeric_limits<int>::min();
            local_scalar_t__ coef = DUMMY_VAR__;
            current_statement__ = 2008;
            b_collect = (((t_shift + i_shift) + m_shift) +
              stan::model::rvalue(which_coef_zindex, "which_coef_zindex",
                stan::model::index_uni((j_shift + j))));
            current_statement__ = 2009;
            beta_collect_m = stan::model::rvalue(which_coef_xindex,
                               "which_coef_xindex",
                               stan::model::index_uni((j_shift + j)));
            current_statement__ = 2010;
            beta_collect = (shift_beta + beta_collect_m);
            current_statement__ = 2011;
            coef = stan::model::rvalue(b, "b",
                     stan::model::index_uni(b_collect));
            current_statement__ = 2023;
            if ((stan::math::primitive_value(
                   stan::math::logical_eq(
                     stan::model::rvalue(has_intercept, "has_intercept",
                       stan::model::index_uni(m)), 1))
                &&
                stan::math::primitive_value(
                  stan::math::logical_eq(beta_collect, 1)))) {
              current_statement__ = 2021;
              if (stan::math::logical_eq(
                    stan::model::rvalue(has_intercept_nob,
                      "has_intercept_nob", stan::model::index_uni(m)), 1)) {
                current_statement__ = 2020;
                coef = (coef +
                  stan::model::rvalue(gamma_nob, "gamma_nob",
                    stan::model::index_uni(
                      stan::math::sum(
                        stan::model::rvalue(has_intercept_nob,
                          "has_intercept_nob",
                          stan::model::index_min_max(1, m))))));
              } else {
                current_statement__ = 2019;
                if (stan::math::logical_eq(
                      stan::model::rvalue(has_intercept_lob,
                        "has_intercept_lob", stan::model::index_uni(m)), 1)) {
                  current_statement__ = 2018;
                  coef = (coef +
                    stan::model::rvalue(gamma_lob, "gamma_lob",
                      stan::model::index_uni(
                        stan::math::sum(
                          stan::model::rvalue(has_intercept_lob,
                            "has_intercept_lob",
                            stan::model::index_min_max(1, m))))));
                } else {
                  current_statement__ = 2017;
                  if (stan::math::logical_eq(
                        stan::model::rvalue(has_intercept_upb,
                          "has_intercept_upb", stan::model::index_uni(m)), 1)) {
                    current_statement__ = 2016;
                    coef = (coef +
                      stan::model::rvalue(gamma_upb, "gamma_upb",
                        stan::model::index_uni(
                          stan::math::sum(
                            stan::model::rvalue(has_intercept_upb,
                              "has_intercept_upb",
                              stan::model::index_min_max(1, m))))));
                  }
                }
              }
            } else {
              current_statement__ = 2015;
              if (stan::math::logical_eq(
                    stan::model::rvalue(has_intercept, "has_intercept",
                      stan::model::index_uni(m)), 1)) {
                current_statement__ = 2013;
                coef = (coef +
                  stan::model::rvalue(beta, "beta",
                    stan::model::index_uni((beta_collect - 1))));
              } else {
                current_statement__ = 2012;
                coef = (coef +
                  stan::model::rvalue(beta, "beta",
                    stan::model::index_uni(beta_collect)));
              }
            }
            current_statement__ = 2024;
            stan::model::assign(temp, coef, "assigning variable temp",
              stan::model::index_uni(i), stan::model::index_uni(mark));
            current_statement__ = 2025;
            mark = (mark + 1);
          }
        }
      }
    }
    current_statement__ = 2038;
    for (int i = 1; i <= (qnodes + 1); ++i) {
      current_statement__ = 2034;
      start_store = (((i - 1) * Npat) + 1);
      current_statement__ = 2035;
      end_store = (i * Npat);
      current_statement__ = 2036;
      stan::model::assign(x_assoc_shared_coef, temp,
        "assigning variable x_assoc_shared_coef",
        stan::model::index_min_max(start_store, end_store),
        stan::model::index_omni());
    }
    current_statement__ = 2039;
    return x_assoc_shared_coef;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
#include <stan_meta_header.hpp>
class model_jm final : public model_base_crtp<model_jm> {
private:
  int M;
  std::vector<int> has_aux;
  int has_weights;
  std::vector<int> resp_type;
  std::vector<int> intercept_type;
  std::vector<int> yNobs;
  std::vector<int> yNeta;
  std::vector<int> yK;
  int t;
  std::vector<int> p;
  std::vector<int> l;
  int q;
  int len_theta_L;
  int bN1;
  int bK1;
  std::vector<int> bK1_len;
  std::vector<std::vector<int>> bK1_idx;
  int bN2;
  int bK2;
  std::vector<int> bK2_len;
  std::vector<std::vector<int>> bK2_idx;
  std::vector<int> yInt1;
  std::vector<int> yInt2;
  std::vector<int> yInt3;
  Eigen::Matrix<double,-1,1> yReal1_data__;
  Eigen::Matrix<double,-1,1> yReal2_data__;
  Eigen::Matrix<double,-1,1> yReal3_data__;
  Eigen::Matrix<double,-1,-1> yX1_data__;
  Eigen::Matrix<double,-1,-1> yX2_data__;
  Eigen::Matrix<double,-1,-1> yX3_data__;
  Eigen::Matrix<double,-1,1> yXbar1_data__;
  Eigen::Matrix<double,-1,1> yXbar2_data__;
  Eigen::Matrix<double,-1,1> yXbar3_data__;
  std::vector<int> family;
  std::vector<int> link;
  std::vector<Eigen::Matrix<double,-1,1>> y1_Z1;
  std::vector<Eigen::Matrix<double,-1,1>> y2_Z1;
  std::vector<Eigen::Matrix<double,-1,1>> y3_Z1;
  std::vector<int> y1_Z1_id;
  std::vector<int> y2_Z1_id;
  std::vector<int> y3_Z1_id;
  std::vector<Eigen::Matrix<double,-1,1>> y1_Z2;
  std::vector<Eigen::Matrix<double,-1,1>> y2_Z2;
  std::vector<Eigen::Matrix<double,-1,1>> y3_Z2;
  std::vector<int> y1_Z2_id;
  std::vector<int> y2_Z2_id;
  std::vector<int> y3_Z2_id;
  std::vector<int> y_prior_dist;
  std::vector<int> y_prior_dist_for_intercept;
  std::vector<int> y_prior_dist_for_aux;
  int prior_dist_for_cov;
  int prior_PD;
  std::vector<int> has_offset;
  Eigen::Matrix<double,-1,1> y1_offset_data__;
  Eigen::Matrix<double,-1,1> y2_offset_data__;
  Eigen::Matrix<double,-1,1> y3_offset_data__;
  int e_prior_dist;
  int e_prior_dist_for_intercept;
  int e_prior_dist_for_aux;
  double norm_const;
  int e_K;
  int Npat;
  int Nevents;
  int qnodes;
  int Npat_times_qnodes;
  int basehaz_type;
  int basehaz_df;
  int e_has_intercept;
  int nrow_e_Xq;
  Eigen::Matrix<double,-1,-1> e_Xq_data__;
  Eigen::Matrix<double,-1,1> e_times_data__;
  Eigen::Matrix<double,-1,-1> basehaz_X_data__;
  Eigen::Matrix<double,-1,1> e_xbar_data__;
  Eigen::Matrix<double,-1,1> e_weights_data__;
  Eigen::Matrix<double,-1,1> e_weights_rep_data__;
  Eigen::Matrix<double,-1,1> qwts_data__;
  int a_prior_dist;
  int a_K;
  Eigen::Matrix<double,-1,1> a_xbar_data__;
  Eigen::Matrix<double,-1,1> a_scale_data__;
  int assoc;
  std::vector<std::vector<int>> assoc_uses;
  std::vector<std::vector<int>> has_assoc;
  int sum_size_which_b;
  std::vector<int> size_which_b;
  std::vector<int> which_b_zindex;
  int sum_size_which_coef;
  std::vector<int> size_which_coef;
  std::vector<int> which_coef_zindex;
  std::vector<int> which_coef_xindex;
  int sum_size_which_interactions;
  std::vector<int> size_which_interactions;
  std::vector<int> which_interactions;
  std::vector<int> nrow_y_Xq;
  Eigen::Matrix<double,-1,-1> y1_xq_eta_data__;
  Eigen::Matrix<double,-1,-1> y2_xq_eta_data__;
  Eigen::Matrix<double,-1,-1> y3_xq_eta_data__;
  Eigen::Matrix<double,-1,1> y1_offset_eta_data__;
  Eigen::Matrix<double,-1,1> y2_offset_eta_data__;
  Eigen::Matrix<double,-1,1> y3_offset_eta_data__;
  std::vector<Eigen::Matrix<double,-1,1>> y1_z1q_eta;
  std::vector<Eigen::Matrix<double,-1,1>> y2_z1q_eta;
  std::vector<Eigen::Matrix<double,-1,1>> y3_z1q_eta;
  std::vector<int> y1_z1q_id_eta;
  std::vector<int> y2_z1q_id_eta;
  std::vector<int> y3_z1q_id_eta;
  std::vector<Eigen::Matrix<double,-1,1>> y1_z2q_eta;
  std::vector<Eigen::Matrix<double,-1,1>> y2_z2q_eta;
  std::vector<Eigen::Matrix<double,-1,1>> y3_z2q_eta;
  std::vector<int> y1_z2q_id_eta;
  std::vector<int> y2_z2q_id_eta;
  std::vector<int> y3_z2q_id_eta;
  Eigen::Matrix<double,-1,-1> y1_xq_eps_data__;
  Eigen::Matrix<double,-1,-1> y2_xq_eps_data__;
  Eigen::Matrix<double,-1,-1> y3_xq_eps_data__;
  Eigen::Matrix<double,-1,1> y1_offset_eps_data__;
  Eigen::Matrix<double,-1,1> y2_offset_eps_data__;
  Eigen::Matrix<double,-1,1> y3_offset_eps_data__;
  std::vector<Eigen::Matrix<double,-1,1>> y1_z1q_eps;
  std::vector<Eigen::Matrix<double,-1,1>> y2_z1q_eps;
  std::vector<Eigen::Matrix<double,-1,1>> y3_z1q_eps;
  std::vector<int> y1_z1q_id_eps;
  std::vector<int> y2_z1q_id_eps;
  std::vector<int> y3_z1q_id_eps;
  std::vector<Eigen::Matrix<double,-1,1>> y1_z2q_eps;
  std::vector<Eigen::Matrix<double,-1,1>> y2_z2q_eps;
  std::vector<Eigen::Matrix<double,-1,1>> y3_z2q_eps;
  std::vector<int> y1_z2q_id_eps;
  std::vector<int> y2_z2q_id_eps;
  std::vector<int> y3_z2q_id_eps;
  int auc_qnodes;
  int nrow_y_Xq_auc;
  Eigen::Matrix<double,-1,1> auc_qwts_data__;
  Eigen::Matrix<double,-1,-1> y1_xq_auc_data__;
  Eigen::Matrix<double,-1,-1> y2_xq_auc_data__;
  Eigen::Matrix<double,-1,-1> y3_xq_auc_data__;
  Eigen::Matrix<double,-1,1> y1_offset_auc_data__;
  Eigen::Matrix<double,-1,1> y2_offset_auc_data__;
  Eigen::Matrix<double,-1,1> y3_offset_auc_data__;
  std::vector<Eigen::Matrix<double,-1,1>> y1_z1q_auc;
  std::vector<Eigen::Matrix<double,-1,1>> y2_z1q_auc;
  std::vector<Eigen::Matrix<double,-1,1>> y3_z1q_auc;
  std::vector<int> y1_z1q_id_auc;
  std::vector<int> y2_z1q_id_auc;
  std::vector<int> y3_z1q_id_auc;
  std::vector<Eigen::Matrix<double,-1,1>> y1_z2q_auc;
  std::vector<Eigen::Matrix<double,-1,1>> y2_z2q_auc;
  std::vector<Eigen::Matrix<double,-1,1>> y3_z2q_auc;
  std::vector<int> y1_z2q_id_auc;
  std::vector<int> y2_z2q_id_auc;
  std::vector<int> y3_z2q_id_auc;
  std::vector<int> a_K_data;
  Eigen::Matrix<double,-1,-1> y_Xq_data_data__;
  std::vector<std::vector<int>> idx_q;
  std::vector<int> has_grp;
  int grp_assoc;
  std::vector<std::vector<int>> grp_idx;
  Eigen::Matrix<double,-1,1> y_prior_mean1_data__;
  Eigen::Matrix<double,-1,1> y_prior_mean2_data__;
  Eigen::Matrix<double,-1,1> y_prior_mean3_data__;
  Eigen::Matrix<double,-1,1> y_prior_scale1_data__;
  Eigen::Matrix<double,-1,1> y_prior_scale2_data__;
  Eigen::Matrix<double,-1,1> y_prior_scale3_data__;
  Eigen::Matrix<double,-1,1> y_prior_df1_data__;
  Eigen::Matrix<double,-1,1> y_prior_df2_data__;
  Eigen::Matrix<double,-1,1> y_prior_df3_data__;
  Eigen::Matrix<double,-1,1> y_global_prior_df_data__;
  Eigen::Matrix<double,-1,1> y_global_prior_scale_data__;
  Eigen::Matrix<double,-1,1> y_slab_df_data__;
  Eigen::Matrix<double,-1,1> y_slab_scale_data__;
  Eigen::Matrix<double,-1,1> y_prior_mean_for_intercept_data__;
  Eigen::Matrix<double,-1,1> y_prior_scale_for_intercept_data__;
  Eigen::Matrix<double,-1,1> y_prior_df_for_intercept_data__;
  Eigen::Matrix<double,-1,1> y_prior_mean_for_aux_data__;
  Eigen::Matrix<double,-1,1> y_prior_scale_for_aux_data__;
  Eigen::Matrix<double,-1,1> y_prior_df_for_aux_data__;
  int len_concentration;
  int len_regularization;
  Eigen::Matrix<double,-1,1> b_prior_shape_data__;
  Eigen::Matrix<double,-1,1> b_prior_scale_data__;
  std::vector<double> b_prior_concentration;
  std::vector<double> b_prior_regularization;
  Eigen::Matrix<double,-1,1> b1_prior_scale_data__;
  Eigen::Matrix<double,-1,1> b2_prior_scale_data__;
  Eigen::Matrix<double,-1,1> b1_prior_df_data__;
  Eigen::Matrix<double,-1,1> b2_prior_df_data__;
  double b1_prior_regularization;
  double b2_prior_regularization;
  Eigen::Matrix<double,-1,1> e_prior_mean_data__;
  double e_prior_mean_for_intercept;
  Eigen::Matrix<double,-1,1> e_prior_mean_for_aux_data__;
  Eigen::Matrix<double,-1,1> e_prior_scale_data__;
  double e_prior_scale_for_intercept;
  Eigen::Matrix<double,-1,1> e_prior_scale_for_aux_data__;
  Eigen::Matrix<double,-1,1> e_prior_df_data__;
  double e_prior_df_for_intercept;
  Eigen::Matrix<double,-1,1> e_prior_df_for_aux_data__;
  double e_global_prior_scale;
  double e_global_prior_df;
  double e_slab_df;
  double e_slab_scale;
  Eigen::Matrix<double,-1,1> a_prior_mean_data__;
  Eigen::Matrix<double,-1,1> a_prior_scale_data__;
  Eigen::Matrix<double,-1,1> a_prior_df_data__;
  double a_global_prior_scale;
  double a_global_prior_df;
  double a_slab_df;
  double a_slab_scale;
  int e_hs;
  int a_hs;
  int yHs1;
  int yHs2;
  int yHs3;
  int len_z_T;
  int len_var_group;
  int len_rho;
  int pos;
  std::vector<double> delta;
  std::vector<int> bCov1_idx;
  std::vector<int> bCov2_idx;
  double sum_log_y1;
  double sum_log_y2;
  double sum_log_y3;
  Eigen::Matrix<double,-1,1> sqrt_y1_data__;
  Eigen::Matrix<double,-1,1> sqrt_y2_data__;
  Eigen::Matrix<double,-1,1> sqrt_y3_data__;
  Eigen::Matrix<double,-1,1> log_y1_data__;
  Eigen::Matrix<double,-1,1> log_y2_data__;
  Eigen::Matrix<double,-1,1> log_y3_data__;
  int yGamma1_1dim__;
  int yGamma2_1dim__;
  int yGamma3_1dim__;
  int z_yBeta1_1dim__;
  int z_yBeta2_1dim__;
  int z_yBeta3_1dim__;
  int z_b_1dim__;
  int z_T_1dim__;
  int rho_1dim__;
  int zeta_1dim__;
  int tau_1dim__;
  int bSd1_1dim__;
  int z_bMat1_1dim__;
  int z_bMat1_2dim__;
  int bCholesky1_1dim__;
  int bCholesky1_2dim__;
  int bSd2_1dim__;
  int z_bMat2_1dim__;
  int z_bMat2_2dim__;
  int bCholesky2_1dim__;
  int bCholesky2_2dim__;
  int yAux1_unscaled_1dim__;
  int yAux2_unscaled_1dim__;
  int yAux3_unscaled_1dim__;
  int yLocal1_2dim__;
  int yLocal2_2dim__;
  int yLocal3_2dim__;
  int y_caux1_1dim__;
  int y_caux2_1dim__;
  int y_caux3_1dim__;
  int yOol1_1dim__;
  int yOol2_1dim__;
  int yOol3_1dim__;
  int yMix1_1dim__;
  int yMix1_2dim__;
  int yMix2_1dim__;
  int yMix2_2dim__;
  int yMix3_1dim__;
  int yMix3_2dim__;
  int e_local_2dim__;
  int e_caux_1dim__;
  int e_mix_1dim__;
  int e_ool_1dim__;
  int a_local_2dim__;
  int a_caux_1dim__;
  int a_mix_1dim__;
  int a_ool_1dim__;
  int yBeta1_1dim__;
  int yBeta2_1dim__;
  int yBeta3_1dim__;
  int yAux1_1dim__;
  int yAux2_1dim__;
  int yAux3_1dim__;
  int bMat1_1dim__;
  int bMat2_1dim__;
  int yAlpha1_1dim__;
  int yAlpha2_1dim__;
  int yAlpha3_1dim__;
  int bCov1_1dim__;
  int bCov2_1dim__;
  int b1_1dim__;
  int b2_1dim__;
  Eigen::Map<Eigen::Matrix<double,-1,1>> yReal1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> yReal2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> yReal3{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> yX1{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> yX2{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> yX3{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> yXbar1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> yXbar2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> yXbar3{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y1_offset{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y2_offset{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y3_offset{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> e_Xq{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> e_times{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> basehaz_X{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> e_xbar{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> e_weights{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> e_weights_rep{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> qwts{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> a_xbar{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> a_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> y1_xq_eta{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> y2_xq_eta{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> y3_xq_eta{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y1_offset_eta{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y2_offset_eta{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y3_offset_eta{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> y1_xq_eps{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> y2_xq_eps{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> y3_xq_eps{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y1_offset_eps{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y2_offset_eps{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y3_offset_eps{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> auc_qwts{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> y1_xq_auc{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> y2_xq_auc{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> y3_xq_auc{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y1_offset_auc{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y2_offset_auc{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y3_offset_auc{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> y_Xq_data{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_mean1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_mean2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_mean3{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_scale1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_scale2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_scale3{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_df1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_df2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_df3{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_global_prior_df{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_global_prior_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_slab_df{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_slab_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>>
    y_prior_mean_for_intercept{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>>
    y_prior_scale_for_intercept{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_df_for_intercept{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_mean_for_aux{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_scale_for_aux{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_df_for_aux{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> b_prior_shape{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> b_prior_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> b1_prior_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> b2_prior_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> b1_prior_df{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> b2_prior_df{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> e_prior_mean{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> e_prior_mean_for_aux{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> e_prior_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> e_prior_scale_for_aux{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> e_prior_df{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> e_prior_df_for_aux{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> a_prior_mean{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> a_prior_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> a_prior_df{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> sqrt_y1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> sqrt_y2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> sqrt_y3{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> log_y1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> log_y2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> log_y3{nullptr, 0};
public:
  ~model_jm() {}
  model_jm(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__ = "model_jm_namespace::model_jm";
    // 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__ = 612;
      context__.validate_dims("data initialization", "M", "int",
        std::vector<size_t>{});
      M = std::numeric_limits<int>::min();
      current_statement__ = 612;
      M = context__.vals_i("M")[(1 - 1)];
      current_statement__ = 612;
      stan::math::check_greater_or_equal(function__, "M", M, 1);
      current_statement__ = 612;
      stan::math::check_less_or_equal(function__, "M", M, 3);
      current_statement__ = 613;
      context__.validate_dims("data initialization", "has_aux", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      has_aux = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 613;
      has_aux = context__.vals_i("has_aux");
      current_statement__ = 613;
      stan::math::check_greater_or_equal(function__, "has_aux", has_aux, 0);
      current_statement__ = 613;
      stan::math::check_less_or_equal(function__, "has_aux", has_aux, 1);
      current_statement__ = 614;
      context__.validate_dims("data initialization", "has_weights", "int",
        std::vector<size_t>{});
      has_weights = std::numeric_limits<int>::min();
      current_statement__ = 614;
      has_weights = context__.vals_i("has_weights")[(1 - 1)];
      current_statement__ = 614;
      stan::math::check_greater_or_equal(function__, "has_weights",
        has_weights, 0);
      current_statement__ = 614;
      stan::math::check_less_or_equal(function__, "has_weights", has_weights,
        1);
      current_statement__ = 615;
      context__.validate_dims("data initialization", "resp_type", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      resp_type = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 615;
      resp_type = context__.vals_i("resp_type");
      current_statement__ = 615;
      stan::math::check_greater_or_equal(function__, "resp_type", resp_type,
        0);
      current_statement__ = 615;
      stan::math::check_less_or_equal(function__, "resp_type", resp_type, 2);
      current_statement__ = 616;
      context__.validate_dims("data initialization", "intercept_type", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      intercept_type = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 616;
      intercept_type = context__.vals_i("intercept_type");
      current_statement__ = 616;
      stan::math::check_greater_or_equal(function__, "intercept_type",
        intercept_type, 0);
      current_statement__ = 616;
      stan::math::check_less_or_equal(function__, "intercept_type",
        intercept_type, 3);
      current_statement__ = 617;
      context__.validate_dims("data initialization", "yNobs", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      yNobs = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 617;
      yNobs = context__.vals_i("yNobs");
      current_statement__ = 617;
      stan::math::check_greater_or_equal(function__, "yNobs", yNobs, 0);
      current_statement__ = 618;
      context__.validate_dims("data initialization", "yNeta", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      yNeta = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 618;
      yNeta = context__.vals_i("yNeta");
      current_statement__ = 618;
      stan::math::check_greater_or_equal(function__, "yNeta", yNeta, 0);
      current_statement__ = 619;
      context__.validate_dims("data initialization", "yK", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      yK = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 619;
      yK = context__.vals_i("yK");
      current_statement__ = 619;
      stan::math::check_greater_or_equal(function__, "yK", yK, 0);
      current_statement__ = 620;
      context__.validate_dims("data initialization", "t", "int",
        std::vector<size_t>{});
      t = std::numeric_limits<int>::min();
      current_statement__ = 620;
      t = context__.vals_i("t")[(1 - 1)];
      current_statement__ = 620;
      stan::math::check_greater_or_equal(function__, "t", t, 0);
      current_statement__ = 621;
      stan::math::validate_non_negative_index("p", "t", t);
      current_statement__ = 622;
      context__.validate_dims("data initialization", "p", "int",
        std::vector<size_t>{static_cast<size_t>(t)});
      p = std::vector<int>(t, std::numeric_limits<int>::min());
      current_statement__ = 622;
      p = context__.vals_i("p");
      current_statement__ = 622;
      stan::math::check_greater_or_equal(function__, "p", p, 1);
      current_statement__ = 623;
      stan::math::validate_non_negative_index("l", "t", t);
      current_statement__ = 624;
      context__.validate_dims("data initialization", "l", "int",
        std::vector<size_t>{static_cast<size_t>(t)});
      l = std::vector<int>(t, std::numeric_limits<int>::min());
      current_statement__ = 624;
      l = context__.vals_i("l");
      current_statement__ = 624;
      stan::math::check_greater_or_equal(function__, "l", l, 1);
      current_statement__ = 625;
      context__.validate_dims("data initialization", "q", "int",
        std::vector<size_t>{});
      q = std::numeric_limits<int>::min();
      current_statement__ = 625;
      q = context__.vals_i("q")[(1 - 1)];
      current_statement__ = 625;
      stan::math::check_greater_or_equal(function__, "q", q, 0);
      current_statement__ = 626;
      context__.validate_dims("data initialization", "len_theta_L", "int",
        std::vector<size_t>{});
      len_theta_L = std::numeric_limits<int>::min();
      current_statement__ = 626;
      len_theta_L = context__.vals_i("len_theta_L")[(1 - 1)];
      current_statement__ = 626;
      stan::math::check_greater_or_equal(function__, "len_theta_L",
        len_theta_L, 0);
      current_statement__ = 627;
      context__.validate_dims("data initialization", "bN1", "int",
        std::vector<size_t>{});
      bN1 = std::numeric_limits<int>::min();
      current_statement__ = 627;
      bN1 = context__.vals_i("bN1")[(1 - 1)];
      current_statement__ = 627;
      stan::math::check_greater_or_equal(function__, "bN1", bN1, 0);
      current_statement__ = 628;
      context__.validate_dims("data initialization", "bK1", "int",
        std::vector<size_t>{});
      bK1 = std::numeric_limits<int>::min();
      current_statement__ = 628;
      bK1 = context__.vals_i("bK1")[(1 - 1)];
      current_statement__ = 628;
      stan::math::check_greater_or_equal(function__, "bK1", bK1, 0);
      current_statement__ = 629;
      context__.validate_dims("data initialization", "bK1_len", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      bK1_len = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 629;
      bK1_len = context__.vals_i("bK1_len");
      current_statement__ = 629;
      stan::math::check_greater_or_equal(function__, "bK1_len", bK1_len, 0);
      current_statement__ = 630;
      context__.validate_dims("data initialization", "bK1_idx", "int",
        std::vector<size_t>{static_cast<size_t>(3), static_cast<size_t>(2)});
      bK1_idx = std::vector<std::vector<int>>(3,
                  std::vector<int>(2, std::numeric_limits<int>::min()));
      {
        std::vector<int> bK1_idx_flat__;
        current_statement__ = 630;
        bK1_idx_flat__ = context__.vals_i("bK1_idx");
        current_statement__ = 630;
        pos__ = 1;
        current_statement__ = 630;
        for (int sym1__ = 1; sym1__ <= 2; ++sym1__) {
          current_statement__ = 630;
          for (int sym2__ = 1; sym2__ <= 3; ++sym2__) {
            current_statement__ = 630;
            stan::model::assign(bK1_idx, bK1_idx_flat__[(pos__ - 1)],
              "assigning variable bK1_idx", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 630;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 630;
      stan::math::check_greater_or_equal(function__, "bK1_idx", bK1_idx, 0);
      current_statement__ = 631;
      context__.validate_dims("data initialization", "bN2", "int",
        std::vector<size_t>{});
      bN2 = std::numeric_limits<int>::min();
      current_statement__ = 631;
      bN2 = context__.vals_i("bN2")[(1 - 1)];
      current_statement__ = 631;
      stan::math::check_greater_or_equal(function__, "bN2", bN2, 0);
      current_statement__ = 632;
      context__.validate_dims("data initialization", "bK2", "int",
        std::vector<size_t>{});
      bK2 = std::numeric_limits<int>::min();
      current_statement__ = 632;
      bK2 = context__.vals_i("bK2")[(1 - 1)];
      current_statement__ = 632;
      stan::math::check_greater_or_equal(function__, "bK2", bK2, 0);
      current_statement__ = 633;
      context__.validate_dims("data initialization", "bK2_len", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      bK2_len = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 633;
      bK2_len = context__.vals_i("bK2_len");
      current_statement__ = 633;
      stan::math::check_greater_or_equal(function__, "bK2_len", bK2_len, 0);
      current_statement__ = 634;
      context__.validate_dims("data initialization", "bK2_idx", "int",
        std::vector<size_t>{static_cast<size_t>(3), static_cast<size_t>(2)});
      bK2_idx = std::vector<std::vector<int>>(3,
                  std::vector<int>(2, std::numeric_limits<int>::min()));
      {
        std::vector<int> bK2_idx_flat__;
        current_statement__ = 634;
        bK2_idx_flat__ = context__.vals_i("bK2_idx");
        current_statement__ = 634;
        pos__ = 1;
        current_statement__ = 634;
        for (int sym1__ = 1; sym1__ <= 2; ++sym1__) {
          current_statement__ = 634;
          for (int sym2__ = 1; sym2__ <= 3; ++sym2__) {
            current_statement__ = 634;
            stan::model::assign(bK2_idx, bK2_idx_flat__[(pos__ - 1)],
              "assigning variable bK2_idx", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 634;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 634;
      stan::math::check_greater_or_equal(function__, "bK2_idx", bK2_idx, 0);
      current_statement__ = 635;
      stan::math::validate_non_negative_index("yInt1",
        "resp_type[1] == 2 ? yNobs[1] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(1)), 2) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(1)) : 0));
      current_statement__ = 636;
      context__.validate_dims("data initialization", "yInt1", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(resp_type, "resp_type",
                                   stan::model::index_uni(1)), 2) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    1)) : 0))});
      yInt1 = std::vector<int>((stan::math::logical_eq(
                                  stan::model::rvalue(resp_type, "resp_type",
                                    stan::model::index_uni(1)), 2) ? 
                stan::model::rvalue(yNobs, "yNobs", stan::model::index_uni(1)) : 0),
                std::numeric_limits<int>::min());
      current_statement__ = 636;
      yInt1 = context__.vals_i("yInt1");
      current_statement__ = 636;
      stan::math::check_greater_or_equal(function__, "yInt1", yInt1, 0);
      current_statement__ = 637;
      stan::math::validate_non_negative_index("yInt2",
        "resp_type[2] == 2 ? yNobs[2] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(2)), 2) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(2)) : 0));
      current_statement__ = 638;
      context__.validate_dims("data initialization", "yInt2", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(resp_type, "resp_type",
                                   stan::model::index_uni(2)), 2) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    2)) : 0))});
      yInt2 = std::vector<int>((stan::math::logical_eq(
                                  stan::model::rvalue(resp_type, "resp_type",
                                    stan::model::index_uni(2)), 2) ? 
                stan::model::rvalue(yNobs, "yNobs", stan::model::index_uni(2)) : 0),
                std::numeric_limits<int>::min());
      current_statement__ = 638;
      yInt2 = context__.vals_i("yInt2");
      current_statement__ = 638;
      stan::math::check_greater_or_equal(function__, "yInt2", yInt2, 0);
      current_statement__ = 639;
      stan::math::validate_non_negative_index("yInt3",
        "resp_type[3] == 2 ? yNobs[3] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(3)), 2) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(3)) : 0));
      current_statement__ = 640;
      context__.validate_dims("data initialization", "yInt3", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(resp_type, "resp_type",
                                   stan::model::index_uni(3)), 2) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    3)) : 0))});
      yInt3 = std::vector<int>((stan::math::logical_eq(
                                  stan::model::rvalue(resp_type, "resp_type",
                                    stan::model::index_uni(3)), 2) ? 
                stan::model::rvalue(yNobs, "yNobs", stan::model::index_uni(3)) : 0),
                std::numeric_limits<int>::min());
      current_statement__ = 640;
      yInt3 = context__.vals_i("yInt3");
      current_statement__ = 640;
      stan::math::check_greater_or_equal(function__, "yInt3", yInt3, 0);
      current_statement__ = 641;
      stan::math::validate_non_negative_index("yReal1",
        "resp_type[1] == 1 ? yNobs[1] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(1)), 1) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(1)) : 0));
      current_statement__ = 642;
      context__.validate_dims("data initialization", "yReal1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(resp_type, "resp_type",
                                   stan::model::index_uni(1)), 1) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    1)) : 0))});
      yReal1_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_eq(
                                                              stan::model::rvalue(
                                                                resp_type,
                                                                "resp_type",
                                                                stan::model::index_uni(
                                                                  1)), 1) ? 
                        stan::model::rvalue(yNobs, "yNobs",
                          stan::model::index_uni(1)) : 0),
                        std::numeric_limits<double>::quiet_NaN());
      new (&yReal1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(yReal1_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(1)), 1) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(1)) : 0));
      {
        std::vector<local_scalar_t__> yReal1_flat__;
        current_statement__ = 642;
        yReal1_flat__ = context__.vals_r("yReal1");
        current_statement__ = 642;
        pos__ = 1;
        current_statement__ = 642;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_eq(
                stan::model::rvalue(resp_type, "resp_type",
                  stan::model::index_uni(1)), 1) ? stan::model::rvalue(yNobs,
                                                     "yNobs",
                                                     stan::model::index_uni(1)) : 0); ++sym1__) {
          current_statement__ = 642;
          stan::model::assign(yReal1, yReal1_flat__[(pos__ - 1)],
            "assigning variable yReal1", stan::model::index_uni(sym1__));
          current_statement__ = 642;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 643;
      stan::math::validate_non_negative_index("yReal2",
        "resp_type[2] == 1 ? yNobs[2] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(2)), 1) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(2)) : 0));
      current_statement__ = 644;
      context__.validate_dims("data initialization", "yReal2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(resp_type, "resp_type",
                                   stan::model::index_uni(2)), 1) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    2)) : 0))});
      yReal2_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_eq(
                                                              stan::model::rvalue(
                                                                resp_type,
                                                                "resp_type",
                                                                stan::model::index_uni(
                                                                  2)), 1) ? 
                        stan::model::rvalue(yNobs, "yNobs",
                          stan::model::index_uni(2)) : 0),
                        std::numeric_limits<double>::quiet_NaN());
      new (&yReal2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(yReal2_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(2)), 1) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(2)) : 0));
      {
        std::vector<local_scalar_t__> yReal2_flat__;
        current_statement__ = 644;
        yReal2_flat__ = context__.vals_r("yReal2");
        current_statement__ = 644;
        pos__ = 1;
        current_statement__ = 644;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_eq(
                stan::model::rvalue(resp_type, "resp_type",
                  stan::model::index_uni(2)), 1) ? stan::model::rvalue(yNobs,
                                                     "yNobs",
                                                     stan::model::index_uni(2)) : 0); ++sym1__) {
          current_statement__ = 644;
          stan::model::assign(yReal2, yReal2_flat__[(pos__ - 1)],
            "assigning variable yReal2", stan::model::index_uni(sym1__));
          current_statement__ = 644;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 645;
      stan::math::validate_non_negative_index("yReal3",
        "resp_type[3] == 1 ? yNobs[3] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(3)), 1) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(3)) : 0));
      current_statement__ = 646;
      context__.validate_dims("data initialization", "yReal3", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(resp_type, "resp_type",
                                   stan::model::index_uni(3)), 1) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    3)) : 0))});
      yReal3_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_eq(
                                                              stan::model::rvalue(
                                                                resp_type,
                                                                "resp_type",
                                                                stan::model::index_uni(
                                                                  3)), 1) ? 
                        stan::model::rvalue(yNobs, "yNobs",
                          stan::model::index_uni(3)) : 0),
                        std::numeric_limits<double>::quiet_NaN());
      new (&yReal3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(yReal3_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(3)), 1) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(3)) : 0));
      {
        std::vector<local_scalar_t__> yReal3_flat__;
        current_statement__ = 646;
        yReal3_flat__ = context__.vals_r("yReal3");
        current_statement__ = 646;
        pos__ = 1;
        current_statement__ = 646;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_eq(
                stan::model::rvalue(resp_type, "resp_type",
                  stan::model::index_uni(3)), 1) ? stan::model::rvalue(yNobs,
                                                     "yNobs",
                                                     stan::model::index_uni(3)) : 0); ++sym1__) {
          current_statement__ = 646;
          stan::model::assign(yReal3, yReal3_flat__[(pos__ - 1)],
            "assigning variable yReal3", stan::model::index_uni(sym1__));
          current_statement__ = 646;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 647;
      stan::math::validate_non_negative_index("yX1", "yNeta[1]",
        stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)));
      current_statement__ = 648;
      stan::math::validate_non_negative_index("yX1", "yK[1]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      current_statement__ = 649;
      context__.validate_dims("data initialization", "yX1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yNeta, "yNeta",
                                stan::model::index_uni(1))),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(1)))});
      yX1_data__ = Eigen::Matrix<double,-1,-1>::Constant(stan::model::rvalue(
                                                           yNeta, "yNeta",
                                                           stan::model::index_uni(
                                                             1)),
                     stan::model::rvalue(yK, "yK", stan::model::index_uni(1)),
                     std::numeric_limits<double>::quiet_NaN());
      new (&yX1) Eigen::Map<Eigen::Matrix<double,-1,-1>>(yX1_data__.data(),
        stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      {
        std::vector<local_scalar_t__> yX1_flat__;
        current_statement__ = 649;
        yX1_flat__ = context__.vals_r("yX1");
        current_statement__ = 649;
        pos__ = 1;
        current_statement__ = 649;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(1)); ++sym1__) {
          current_statement__ = 649;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)); ++sym2__) {
            current_statement__ = 649;
            stan::model::assign(yX1, yX1_flat__[(pos__ - 1)],
              "assigning variable yX1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 649;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 650;
      stan::math::validate_non_negative_index("yX2", "yNeta[2]",
        stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)));
      current_statement__ = 651;
      stan::math::validate_non_negative_index("yX2", "yK[2]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      current_statement__ = 652;
      context__.validate_dims("data initialization", "yX2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yNeta, "yNeta",
                                stan::model::index_uni(2))),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(2)))});
      yX2_data__ = Eigen::Matrix<double,-1,-1>::Constant(stan::model::rvalue(
                                                           yNeta, "yNeta",
                                                           stan::model::index_uni(
                                                             2)),
                     stan::model::rvalue(yK, "yK", stan::model::index_uni(2)),
                     std::numeric_limits<double>::quiet_NaN());
      new (&yX2) Eigen::Map<Eigen::Matrix<double,-1,-1>>(yX2_data__.data(),
        stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      {
        std::vector<local_scalar_t__> yX2_flat__;
        current_statement__ = 652;
        yX2_flat__ = context__.vals_r("yX2");
        current_statement__ = 652;
        pos__ = 1;
        current_statement__ = 652;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(2)); ++sym1__) {
          current_statement__ = 652;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)); ++sym2__) {
            current_statement__ = 652;
            stan::model::assign(yX2, yX2_flat__[(pos__ - 1)],
              "assigning variable yX2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 652;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 653;
      stan::math::validate_non_negative_index("yX3", "yNeta[3]",
        stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)));
      current_statement__ = 654;
      stan::math::validate_non_negative_index("yX3", "yK[3]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      current_statement__ = 655;
      context__.validate_dims("data initialization", "yX3", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yNeta, "yNeta",
                                stan::model::index_uni(3))),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(3)))});
      yX3_data__ = Eigen::Matrix<double,-1,-1>::Constant(stan::model::rvalue(
                                                           yNeta, "yNeta",
                                                           stan::model::index_uni(
                                                             3)),
                     stan::model::rvalue(yK, "yK", stan::model::index_uni(3)),
                     std::numeric_limits<double>::quiet_NaN());
      new (&yX3) Eigen::Map<Eigen::Matrix<double,-1,-1>>(yX3_data__.data(),
        stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      {
        std::vector<local_scalar_t__> yX3_flat__;
        current_statement__ = 655;
        yX3_flat__ = context__.vals_r("yX3");
        current_statement__ = 655;
        pos__ = 1;
        current_statement__ = 655;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(3)); ++sym1__) {
          current_statement__ = 655;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)); ++sym2__) {
            current_statement__ = 655;
            stan::model::assign(yX3, yX3_flat__[(pos__ - 1)],
              "assigning variable yX3", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 655;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 656;
      stan::math::validate_non_negative_index("yXbar1", "yK[1]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      current_statement__ = 657;
      context__.validate_dims("data initialization", "yXbar1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(1)))});
      yXbar1_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                             yK, "yK",
                                                             stan::model::index_uni(
                                                               1)),
                        std::numeric_limits<double>::quiet_NaN());
      new (&yXbar1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(yXbar1_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      {
        std::vector<local_scalar_t__> yXbar1_flat__;
        current_statement__ = 657;
        yXbar1_flat__ = context__.vals_r("yXbar1");
        current_statement__ = 657;
        pos__ = 1;
        current_statement__ = 657;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(1)); ++sym1__) {
          current_statement__ = 657;
          stan::model::assign(yXbar1, yXbar1_flat__[(pos__ - 1)],
            "assigning variable yXbar1", stan::model::index_uni(sym1__));
          current_statement__ = 657;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 658;
      stan::math::validate_non_negative_index("yXbar2", "yK[2]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      current_statement__ = 659;
      context__.validate_dims("data initialization", "yXbar2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(2)))});
      yXbar2_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                             yK, "yK",
                                                             stan::model::index_uni(
                                                               2)),
                        std::numeric_limits<double>::quiet_NaN());
      new (&yXbar2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(yXbar2_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      {
        std::vector<local_scalar_t__> yXbar2_flat__;
        current_statement__ = 659;
        yXbar2_flat__ = context__.vals_r("yXbar2");
        current_statement__ = 659;
        pos__ = 1;
        current_statement__ = 659;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(2)); ++sym1__) {
          current_statement__ = 659;
          stan::model::assign(yXbar2, yXbar2_flat__[(pos__ - 1)],
            "assigning variable yXbar2", stan::model::index_uni(sym1__));
          current_statement__ = 659;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 660;
      stan::math::validate_non_negative_index("yXbar3", "yK[3]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      current_statement__ = 661;
      context__.validate_dims("data initialization", "yXbar3", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(3)))});
      yXbar3_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                             yK, "yK",
                                                             stan::model::index_uni(
                                                               3)),
                        std::numeric_limits<double>::quiet_NaN());
      new (&yXbar3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(yXbar3_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      {
        std::vector<local_scalar_t__> yXbar3_flat__;
        current_statement__ = 661;
        yXbar3_flat__ = context__.vals_r("yXbar3");
        current_statement__ = 661;
        pos__ = 1;
        current_statement__ = 661;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(3)); ++sym1__) {
          current_statement__ = 661;
          stan::model::assign(yXbar3, yXbar3_flat__[(pos__ - 1)],
            "assigning variable yXbar3", stan::model::index_uni(sym1__));
          current_statement__ = 661;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 662;
      stan::math::validate_non_negative_index("family", "M", M);
      current_statement__ = 663;
      context__.validate_dims("data initialization", "family", "int",
        std::vector<size_t>{static_cast<size_t>(M)});
      family = std::vector<int>(M, std::numeric_limits<int>::min());
      current_statement__ = 663;
      family = context__.vals_i("family");
      current_statement__ = 663;
      stan::math::check_greater_or_equal(function__, "family", family, 0);
      current_statement__ = 664;
      stan::math::validate_non_negative_index("link", "M", M);
      current_statement__ = 665;
      context__.validate_dims("data initialization", "link", "int",
        std::vector<size_t>{static_cast<size_t>(M)});
      link = std::vector<int>(M, std::numeric_limits<int>::min());
      current_statement__ = 665;
      link = context__.vals_i("link");
      current_statement__ = 665;
      stan::math::check_greater_or_equal(function__, "link", link, 0);
      current_statement__ = 666;
      stan::math::validate_non_negative_index("y1_Z1", "bK1_len[1]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)));
      current_statement__ = 667;
      stan::math::validate_non_negative_index("y1_Z1",
        "bK1_len[1] > 0 ? yNeta[1] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)) : 0));
      current_statement__ = 668;
      context__.validate_dims("data initialization", "y1_Z1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(1))),
          static_cast<size_t>(
            (stan::math::logical_gt(
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(1)), 0) ? stan::model::rvalue(yNeta,
                                                    "yNeta",
                                                    stan::model::index_uni(1)) : 0))});
      y1_Z1 = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                        bK1_len, "bK1_len",
                                                        stan::model::index_uni(
                                                          1)),
                Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                        stan::model::rvalue(
                                                          bK1_len, "bK1_len",
                                                          stan::model::index_uni(
                                                            1)), 0) ? 
                  stan::model::rvalue(yNeta, "yNeta",
                    stan::model::index_uni(1)) : 0),
                  std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y1_Z1_flat__;
        current_statement__ = 668;
        y1_Z1_flat__ = context__.vals_r("y1_Z1");
        current_statement__ = 668;
        pos__ = 1;
        current_statement__ = 668;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(1)), 0) ? stan::model::rvalue(yNeta,
                                                     "yNeta",
                                                     stan::model::index_uni(1)) : 0); ++sym1__) {
          current_statement__ = 668;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(1)); ++sym2__) {
            current_statement__ = 668;
            stan::model::assign(y1_Z1, y1_Z1_flat__[(pos__ - 1)],
              "assigning variable y1_Z1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 668;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 669;
      stan::math::validate_non_negative_index("y2_Z1", "bK1_len[2]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)));
      current_statement__ = 670;
      stan::math::validate_non_negative_index("y2_Z1",
        "bK1_len[2] > 0 ? yNeta[2] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)) : 0));
      current_statement__ = 671;
      context__.validate_dims("data initialization", "y2_Z1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(2))),
          static_cast<size_t>(
            (stan::math::logical_gt(
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(2)), 0) ? stan::model::rvalue(yNeta,
                                                    "yNeta",
                                                    stan::model::index_uni(2)) : 0))});
      y2_Z1 = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                        bK1_len, "bK1_len",
                                                        stan::model::index_uni(
                                                          2)),
                Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                        stan::model::rvalue(
                                                          bK1_len, "bK1_len",
                                                          stan::model::index_uni(
                                                            2)), 0) ? 
                  stan::model::rvalue(yNeta, "yNeta",
                    stan::model::index_uni(2)) : 0),
                  std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y2_Z1_flat__;
        current_statement__ = 671;
        y2_Z1_flat__ = context__.vals_r("y2_Z1");
        current_statement__ = 671;
        pos__ = 1;
        current_statement__ = 671;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(2)), 0) ? stan::model::rvalue(yNeta,
                                                     "yNeta",
                                                     stan::model::index_uni(2)) : 0); ++sym1__) {
          current_statement__ = 671;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(2)); ++sym2__) {
            current_statement__ = 671;
            stan::model::assign(y2_Z1, y2_Z1_flat__[(pos__ - 1)],
              "assigning variable y2_Z1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 671;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 672;
      stan::math::validate_non_negative_index("y3_Z1", "bK1_len[3]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)));
      current_statement__ = 673;
      stan::math::validate_non_negative_index("y3_Z1",
        "bK1_len[3] > 0 ? yNeta[3] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)) : 0));
      current_statement__ = 674;
      context__.validate_dims("data initialization", "y3_Z1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(3))),
          static_cast<size_t>(
            (stan::math::logical_gt(
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(3)), 0) ? stan::model::rvalue(yNeta,
                                                    "yNeta",
                                                    stan::model::index_uni(3)) : 0))});
      y3_Z1 = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                        bK1_len, "bK1_len",
                                                        stan::model::index_uni(
                                                          3)),
                Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                        stan::model::rvalue(
                                                          bK1_len, "bK1_len",
                                                          stan::model::index_uni(
                                                            3)), 0) ? 
                  stan::model::rvalue(yNeta, "yNeta",
                    stan::model::index_uni(3)) : 0),
                  std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y3_Z1_flat__;
        current_statement__ = 674;
        y3_Z1_flat__ = context__.vals_r("y3_Z1");
        current_statement__ = 674;
        pos__ = 1;
        current_statement__ = 674;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(3)), 0) ? stan::model::rvalue(yNeta,
                                                     "yNeta",
                                                     stan::model::index_uni(3)) : 0); ++sym1__) {
          current_statement__ = 674;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(3)); ++sym2__) {
            current_statement__ = 674;
            stan::model::assign(y3_Z1, y3_Z1_flat__[(pos__ - 1)],
              "assigning variable y3_Z1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 674;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 675;
      stan::math::validate_non_negative_index("y1_Z1_id",
        "bK1_len[1] > 0 ? yNeta[1] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)) : 0));
      current_statement__ = 676;
      context__.validate_dims("data initialization", "y1_Z1_id", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(
                                 stan::model::rvalue(bK1_len, "bK1_len",
                                   stan::model::index_uni(1)), 0) ? stan::model::rvalue(
                                                                    yNeta,
                                                                    "yNeta",
                                                                    stan::model::index_uni(
                                                                    1)) : 0))});
      y1_Z1_id = std::vector<int>((stan::math::logical_gt(
                                     stan::model::rvalue(bK1_len, "bK1_len",
                                       stan::model::index_uni(1)), 0) ? 
                   stan::model::rvalue(yNeta, "yNeta",
                     stan::model::index_uni(1)) : 0),
                   std::numeric_limits<int>::min());
      current_statement__ = 676;
      y1_Z1_id = context__.vals_i("y1_Z1_id");
      current_statement__ = 676;
      stan::math::check_greater_or_equal(function__, "y1_Z1_id", y1_Z1_id, 0);
      current_statement__ = 677;
      stan::math::validate_non_negative_index("y2_Z1_id",
        "bK1_len[2] > 0 ? yNeta[2] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)) : 0));
      current_statement__ = 678;
      context__.validate_dims("data initialization", "y2_Z1_id", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(
                                 stan::model::rvalue(bK1_len, "bK1_len",
                                   stan::model::index_uni(2)), 0) ? stan::model::rvalue(
                                                                    yNeta,
                                                                    "yNeta",
                                                                    stan::model::index_uni(
                                                                    2)) : 0))});
      y2_Z1_id = std::vector<int>((stan::math::logical_gt(
                                     stan::model::rvalue(bK1_len, "bK1_len",
                                       stan::model::index_uni(2)), 0) ? 
                   stan::model::rvalue(yNeta, "yNeta",
                     stan::model::index_uni(2)) : 0),
                   std::numeric_limits<int>::min());
      current_statement__ = 678;
      y2_Z1_id = context__.vals_i("y2_Z1_id");
      current_statement__ = 678;
      stan::math::check_greater_or_equal(function__, "y2_Z1_id", y2_Z1_id, 0);
      current_statement__ = 679;
      stan::math::validate_non_negative_index("y3_Z1_id",
        "bK1_len[3] > 0 ? yNeta[3] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)) : 0));
      current_statement__ = 680;
      context__.validate_dims("data initialization", "y3_Z1_id", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(
                                 stan::model::rvalue(bK1_len, "bK1_len",
                                   stan::model::index_uni(3)), 0) ? stan::model::rvalue(
                                                                    yNeta,
                                                                    "yNeta",
                                                                    stan::model::index_uni(
                                                                    3)) : 0))});
      y3_Z1_id = std::vector<int>((stan::math::logical_gt(
                                     stan::model::rvalue(bK1_len, "bK1_len",
                                       stan::model::index_uni(3)), 0) ? 
                   stan::model::rvalue(yNeta, "yNeta",
                     stan::model::index_uni(3)) : 0),
                   std::numeric_limits<int>::min());
      current_statement__ = 680;
      y3_Z1_id = context__.vals_i("y3_Z1_id");
      current_statement__ = 680;
      stan::math::check_greater_or_equal(function__, "y3_Z1_id", y3_Z1_id, 0);
      current_statement__ = 681;
      stan::math::validate_non_negative_index("y1_Z2", "bK2_len[1]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)));
      current_statement__ = 682;
      stan::math::validate_non_negative_index("y1_Z2",
        "bK2_len[1] > 0 ? yNeta[1] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)) : 0));
      current_statement__ = 683;
      context__.validate_dims("data initialization", "y1_Z2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(1))),
          static_cast<size_t>(
            (stan::math::logical_gt(
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(1)), 0) ? stan::model::rvalue(yNeta,
                                                    "yNeta",
                                                    stan::model::index_uni(1)) : 0))});
      y1_Z2 = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                        bK2_len, "bK2_len",
                                                        stan::model::index_uni(
                                                          1)),
                Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                        stan::model::rvalue(
                                                          bK2_len, "bK2_len",
                                                          stan::model::index_uni(
                                                            1)), 0) ? 
                  stan::model::rvalue(yNeta, "yNeta",
                    stan::model::index_uni(1)) : 0),
                  std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y1_Z2_flat__;
        current_statement__ = 683;
        y1_Z2_flat__ = context__.vals_r("y1_Z2");
        current_statement__ = 683;
        pos__ = 1;
        current_statement__ = 683;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(1)), 0) ? stan::model::rvalue(yNeta,
                                                     "yNeta",
                                                     stan::model::index_uni(1)) : 0); ++sym1__) {
          current_statement__ = 683;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(1)); ++sym2__) {
            current_statement__ = 683;
            stan::model::assign(y1_Z2, y1_Z2_flat__[(pos__ - 1)],
              "assigning variable y1_Z2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 683;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 684;
      stan::math::validate_non_negative_index("y2_Z2", "bK2_len[2]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)));
      current_statement__ = 685;
      stan::math::validate_non_negative_index("y2_Z2",
        "bK2_len[2] > 0 ? yNeta[2] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)) : 0));
      current_statement__ = 686;
      context__.validate_dims("data initialization", "y2_Z2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(2))),
          static_cast<size_t>(
            (stan::math::logical_gt(
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(2)), 0) ? stan::model::rvalue(yNeta,
                                                    "yNeta",
                                                    stan::model::index_uni(2)) : 0))});
      y2_Z2 = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                        bK2_len, "bK2_len",
                                                        stan::model::index_uni(
                                                          2)),
                Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                        stan::model::rvalue(
                                                          bK2_len, "bK2_len",
                                                          stan::model::index_uni(
                                                            2)), 0) ? 
                  stan::model::rvalue(yNeta, "yNeta",
                    stan::model::index_uni(2)) : 0),
                  std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y2_Z2_flat__;
        current_statement__ = 686;
        y2_Z2_flat__ = context__.vals_r("y2_Z2");
        current_statement__ = 686;
        pos__ = 1;
        current_statement__ = 686;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(2)), 0) ? stan::model::rvalue(yNeta,
                                                     "yNeta",
                                                     stan::model::index_uni(2)) : 0); ++sym1__) {
          current_statement__ = 686;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(2)); ++sym2__) {
            current_statement__ = 686;
            stan::model::assign(y2_Z2, y2_Z2_flat__[(pos__ - 1)],
              "assigning variable y2_Z2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 686;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 687;
      stan::math::validate_non_negative_index("y3_Z2", "bK2_len[3]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)));
      current_statement__ = 688;
      stan::math::validate_non_negative_index("y3_Z2",
        "bK2_len[3] > 0 ? yNeta[3] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)) : 0));
      current_statement__ = 689;
      context__.validate_dims("data initialization", "y3_Z2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(3))),
          static_cast<size_t>(
            (stan::math::logical_gt(
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(3)), 0) ? stan::model::rvalue(yNeta,
                                                    "yNeta",
                                                    stan::model::index_uni(3)) : 0))});
      y3_Z2 = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                        bK2_len, "bK2_len",
                                                        stan::model::index_uni(
                                                          3)),
                Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                        stan::model::rvalue(
                                                          bK2_len, "bK2_len",
                                                          stan::model::index_uni(
                                                            3)), 0) ? 
                  stan::model::rvalue(yNeta, "yNeta",
                    stan::model::index_uni(3)) : 0),
                  std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y3_Z2_flat__;
        current_statement__ = 689;
        y3_Z2_flat__ = context__.vals_r("y3_Z2");
        current_statement__ = 689;
        pos__ = 1;
        current_statement__ = 689;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(3)), 0) ? stan::model::rvalue(yNeta,
                                                     "yNeta",
                                                     stan::model::index_uni(3)) : 0); ++sym1__) {
          current_statement__ = 689;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(3)); ++sym2__) {
            current_statement__ = 689;
            stan::model::assign(y3_Z2, y3_Z2_flat__[(pos__ - 1)],
              "assigning variable y3_Z2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 689;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 690;
      stan::math::validate_non_negative_index("y1_Z2_id",
        "bK2_len[1] > 0 ? yNeta[1] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)) : 0));
      current_statement__ = 691;
      context__.validate_dims("data initialization", "y1_Z2_id", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(
                                 stan::model::rvalue(bK2_len, "bK2_len",
                                   stan::model::index_uni(1)), 0) ? stan::model::rvalue(
                                                                    yNeta,
                                                                    "yNeta",
                                                                    stan::model::index_uni(
                                                                    1)) : 0))});
      y1_Z2_id = std::vector<int>((stan::math::logical_gt(
                                     stan::model::rvalue(bK2_len, "bK2_len",
                                       stan::model::index_uni(1)), 0) ? 
                   stan::model::rvalue(yNeta, "yNeta",
                     stan::model::index_uni(1)) : 0),
                   std::numeric_limits<int>::min());
      current_statement__ = 691;
      y1_Z2_id = context__.vals_i("y1_Z2_id");
      current_statement__ = 691;
      stan::math::check_greater_or_equal(function__, "y1_Z2_id", y1_Z2_id, 0);
      current_statement__ = 692;
      stan::math::validate_non_negative_index("y2_Z2_id",
        "bK2_len[2] > 0 ? yNeta[2] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)) : 0));
      current_statement__ = 693;
      context__.validate_dims("data initialization", "y2_Z2_id", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(
                                 stan::model::rvalue(bK2_len, "bK2_len",
                                   stan::model::index_uni(2)), 0) ? stan::model::rvalue(
                                                                    yNeta,
                                                                    "yNeta",
                                                                    stan::model::index_uni(
                                                                    2)) : 0))});
      y2_Z2_id = std::vector<int>((stan::math::logical_gt(
                                     stan::model::rvalue(bK2_len, "bK2_len",
                                       stan::model::index_uni(2)), 0) ? 
                   stan::model::rvalue(yNeta, "yNeta",
                     stan::model::index_uni(2)) : 0),
                   std::numeric_limits<int>::min());
      current_statement__ = 693;
      y2_Z2_id = context__.vals_i("y2_Z2_id");
      current_statement__ = 693;
      stan::math::check_greater_or_equal(function__, "y2_Z2_id", y2_Z2_id, 0);
      current_statement__ = 694;
      stan::math::validate_non_negative_index("y3_Z2_id",
        "bK2_len[3] > 0 ? yNeta[3] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)) : 0));
      current_statement__ = 695;
      context__.validate_dims("data initialization", "y3_Z2_id", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(
                                 stan::model::rvalue(bK2_len, "bK2_len",
                                   stan::model::index_uni(3)), 0) ? stan::model::rvalue(
                                                                    yNeta,
                                                                    "yNeta",
                                                                    stan::model::index_uni(
                                                                    3)) : 0))});
      y3_Z2_id = std::vector<int>((stan::math::logical_gt(
                                     stan::model::rvalue(bK2_len, "bK2_len",
                                       stan::model::index_uni(3)), 0) ? 
                   stan::model::rvalue(yNeta, "yNeta",
                     stan::model::index_uni(3)) : 0),
                   std::numeric_limits<int>::min());
      current_statement__ = 695;
      y3_Z2_id = context__.vals_i("y3_Z2_id");
      current_statement__ = 695;
      stan::math::check_greater_or_equal(function__, "y3_Z2_id", y3_Z2_id, 0);
      current_statement__ = 696;
      context__.validate_dims("data initialization", "y_prior_dist", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      y_prior_dist = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 696;
      y_prior_dist = context__.vals_i("y_prior_dist");
      current_statement__ = 696;
      stan::math::check_greater_or_equal(function__, "y_prior_dist",
        y_prior_dist, 0);
      current_statement__ = 696;
      stan::math::check_less_or_equal(function__, "y_prior_dist",
        y_prior_dist, 7);
      current_statement__ = 697;
      stan::math::validate_non_negative_index("y_prior_dist_for_intercept",
        "M", M);
      current_statement__ = 698;
      context__.validate_dims("data initialization",
        "y_prior_dist_for_intercept", "int",
        std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_dist_for_intercept = std::vector<int>(M,
                                     std::numeric_limits<int>::min());
      current_statement__ = 698;
      y_prior_dist_for_intercept = context__.vals_i("y_prior_dist_for_intercept");
      current_statement__ = 698;
      stan::math::check_greater_or_equal(function__,
        "y_prior_dist_for_intercept", y_prior_dist_for_intercept, 0);
      current_statement__ = 698;
      stan::math::check_less_or_equal(function__,
        "y_prior_dist_for_intercept", y_prior_dist_for_intercept, 2);
      current_statement__ = 699;
      stan::math::validate_non_negative_index("y_prior_dist_for_aux", "M", M);
      current_statement__ = 700;
      context__.validate_dims("data initialization", "y_prior_dist_for_aux",
        "int", std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_dist_for_aux = std::vector<int>(M,
                               std::numeric_limits<int>::min());
      current_statement__ = 700;
      y_prior_dist_for_aux = context__.vals_i("y_prior_dist_for_aux");
      current_statement__ = 700;
      stan::math::check_greater_or_equal(function__, "y_prior_dist_for_aux",
        y_prior_dist_for_aux, 0);
      current_statement__ = 700;
      stan::math::check_less_or_equal(function__, "y_prior_dist_for_aux",
        y_prior_dist_for_aux, 3);
      current_statement__ = 701;
      context__.validate_dims("data initialization", "prior_dist_for_cov",
        "int", std::vector<size_t>{});
      prior_dist_for_cov = std::numeric_limits<int>::min();
      current_statement__ = 701;
      prior_dist_for_cov = context__.vals_i("prior_dist_for_cov")[(1 - 1)];
      current_statement__ = 701;
      stan::math::check_greater_or_equal(function__, "prior_dist_for_cov",
        prior_dist_for_cov, 1);
      current_statement__ = 701;
      stan::math::check_less_or_equal(function__, "prior_dist_for_cov",
        prior_dist_for_cov, 2);
      current_statement__ = 702;
      context__.validate_dims("data initialization", "prior_PD", "int",
        std::vector<size_t>{});
      prior_PD = std::numeric_limits<int>::min();
      current_statement__ = 702;
      prior_PD = context__.vals_i("prior_PD")[(1 - 1)];
      current_statement__ = 702;
      stan::math::check_greater_or_equal(function__, "prior_PD", prior_PD, 0);
      current_statement__ = 702;
      stan::math::check_less_or_equal(function__, "prior_PD", prior_PD, 1);
      current_statement__ = 703;
      context__.validate_dims("data initialization", "has_offset", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      has_offset = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 703;
      has_offset = context__.vals_i("has_offset");
      current_statement__ = 703;
      stan::math::check_greater_or_equal(function__, "has_offset",
        has_offset, 0);
      current_statement__ = 703;
      stan::math::check_less_or_equal(function__, "has_offset", has_offset, 1);
      current_statement__ = 704;
      stan::math::validate_non_negative_index("y1_offset",
        "has_offset[1] ? yNeta[1] : 0",
        (stan::model::rvalue(has_offset, "has_offset",
           stan::model::index_uni(1)) ? stan::model::rvalue(yNeta, "yNeta",
                                          stan::model::index_uni(1)) : 0));
      current_statement__ = 705;
      context__.validate_dims("data initialization", "y1_offset", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::model::rvalue(has_offset, "has_offset",
                                 stan::model::index_uni(1)) ? stan::model::rvalue(
                                                                yNeta,
                                                                "yNeta",
                                                                stan::model::index_uni(
                                                                  1)) : 0))});
      y1_offset_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::model::rvalue(
                                                                 has_offset,
                                                                 "has_offset",
                                                                 stan::model::index_uni(
                                                                   1)) ? 
                           stan::model::rvalue(yNeta, "yNeta",
                             stan::model::index_uni(1)) : 0),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y1_offset)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y1_offset_data__.data(),
        (stan::model::rvalue(has_offset, "has_offset",
           stan::model::index_uni(1)) ? stan::model::rvalue(yNeta, "yNeta",
                                          stan::model::index_uni(1)) : 0));
      {
        std::vector<local_scalar_t__> y1_offset_flat__;
        current_statement__ = 705;
        y1_offset_flat__ = context__.vals_r("y1_offset");
        current_statement__ = 705;
        pos__ = 1;
        current_statement__ = 705;
        for (int sym1__ = 1; sym1__ <=
             (stan::model::rvalue(has_offset, "has_offset",
                stan::model::index_uni(1)) ? stan::model::rvalue(yNeta,
                                               "yNeta",
                                               stan::model::index_uni(1)) : 0); ++sym1__) {
          current_statement__ = 705;
          stan::model::assign(y1_offset, y1_offset_flat__[(pos__ - 1)],
            "assigning variable y1_offset", stan::model::index_uni(sym1__));
          current_statement__ = 705;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 706;
      stan::math::validate_non_negative_index("y2_offset",
        "has_offset[2] ? yNeta[2] : 0",
        (stan::model::rvalue(has_offset, "has_offset",
           stan::model::index_uni(2)) ? stan::model::rvalue(yNeta, "yNeta",
                                          stan::model::index_uni(2)) : 0));
      current_statement__ = 707;
      context__.validate_dims("data initialization", "y2_offset", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::model::rvalue(has_offset, "has_offset",
                                 stan::model::index_uni(2)) ? stan::model::rvalue(
                                                                yNeta,
                                                                "yNeta",
                                                                stan::model::index_uni(
                                                                  2)) : 0))});
      y2_offset_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::model::rvalue(
                                                                 has_offset,
                                                                 "has_offset",
                                                                 stan::model::index_uni(
                                                                   2)) ? 
                           stan::model::rvalue(yNeta, "yNeta",
                             stan::model::index_uni(2)) : 0),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y2_offset)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y2_offset_data__.data(),
        (stan::model::rvalue(has_offset, "has_offset",
           stan::model::index_uni(2)) ? stan::model::rvalue(yNeta, "yNeta",
                                          stan::model::index_uni(2)) : 0));
      {
        std::vector<local_scalar_t__> y2_offset_flat__;
        current_statement__ = 707;
        y2_offset_flat__ = context__.vals_r("y2_offset");
        current_statement__ = 707;
        pos__ = 1;
        current_statement__ = 707;
        for (int sym1__ = 1; sym1__ <=
             (stan::model::rvalue(has_offset, "has_offset",
                stan::model::index_uni(2)) ? stan::model::rvalue(yNeta,
                                               "yNeta",
                                               stan::model::index_uni(2)) : 0); ++sym1__) {
          current_statement__ = 707;
          stan::model::assign(y2_offset, y2_offset_flat__[(pos__ - 1)],
            "assigning variable y2_offset", stan::model::index_uni(sym1__));
          current_statement__ = 707;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 708;
      stan::math::validate_non_negative_index("y3_offset",
        "has_offset[3] ? yNeta[3] : 0",
        (stan::model::rvalue(has_offset, "has_offset",
           stan::model::index_uni(3)) ? stan::model::rvalue(yNeta, "yNeta",
                                          stan::model::index_uni(3)) : 0));
      current_statement__ = 709;
      context__.validate_dims("data initialization", "y3_offset", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::model::rvalue(has_offset, "has_offset",
                                 stan::model::index_uni(3)) ? stan::model::rvalue(
                                                                yNeta,
                                                                "yNeta",
                                                                stan::model::index_uni(
                                                                  3)) : 0))});
      y3_offset_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::model::rvalue(
                                                                 has_offset,
                                                                 "has_offset",
                                                                 stan::model::index_uni(
                                                                   3)) ? 
                           stan::model::rvalue(yNeta, "yNeta",
                             stan::model::index_uni(3)) : 0),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y3_offset)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y3_offset_data__.data(),
        (stan::model::rvalue(has_offset, "has_offset",
           stan::model::index_uni(3)) ? stan::model::rvalue(yNeta, "yNeta",
                                          stan::model::index_uni(3)) : 0));
      {
        std::vector<local_scalar_t__> y3_offset_flat__;
        current_statement__ = 709;
        y3_offset_flat__ = context__.vals_r("y3_offset");
        current_statement__ = 709;
        pos__ = 1;
        current_statement__ = 709;
        for (int sym1__ = 1; sym1__ <=
             (stan::model::rvalue(has_offset, "has_offset",
                stan::model::index_uni(3)) ? stan::model::rvalue(yNeta,
                                               "yNeta",
                                               stan::model::index_uni(3)) : 0); ++sym1__) {
          current_statement__ = 709;
          stan::model::assign(y3_offset, y3_offset_flat__[(pos__ - 1)],
            "assigning variable y3_offset", stan::model::index_uni(sym1__));
          current_statement__ = 709;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 710;
      context__.validate_dims("data initialization", "e_prior_dist", "int",
        std::vector<size_t>{});
      e_prior_dist = std::numeric_limits<int>::min();
      current_statement__ = 710;
      e_prior_dist = context__.vals_i("e_prior_dist")[(1 - 1)];
      current_statement__ = 710;
      stan::math::check_greater_or_equal(function__, "e_prior_dist",
        e_prior_dist, 0);
      current_statement__ = 710;
      stan::math::check_less_or_equal(function__, "e_prior_dist",
        e_prior_dist, 6);
      current_statement__ = 711;
      context__.validate_dims("data initialization",
        "e_prior_dist_for_intercept", "int", std::vector<size_t>{});
      e_prior_dist_for_intercept = std::numeric_limits<int>::min();
      current_statement__ = 711;
      e_prior_dist_for_intercept = context__.vals_i("e_prior_dist_for_intercept")[(1
        - 1)];
      current_statement__ = 711;
      stan::math::check_greater_or_equal(function__,
        "e_prior_dist_for_intercept", e_prior_dist_for_intercept, 0);
      current_statement__ = 711;
      stan::math::check_less_or_equal(function__,
        "e_prior_dist_for_intercept", e_prior_dist_for_intercept, 2);
      current_statement__ = 712;
      context__.validate_dims("data initialization", "e_prior_dist_for_aux",
        "int", std::vector<size_t>{});
      e_prior_dist_for_aux = std::numeric_limits<int>::min();
      current_statement__ = 712;
      e_prior_dist_for_aux = context__.vals_i("e_prior_dist_for_aux")[(1 -
        1)];
      current_statement__ = 712;
      stan::math::check_greater_or_equal(function__, "e_prior_dist_for_aux",
        e_prior_dist_for_aux, 0);
      current_statement__ = 712;
      stan::math::check_less_or_equal(function__, "e_prior_dist_for_aux",
        e_prior_dist_for_aux, 3);
      current_statement__ = 713;
      context__.validate_dims("data initialization", "norm_const", "double",
        std::vector<size_t>{});
      norm_const = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 713;
      norm_const = context__.vals_r("norm_const")[(1 - 1)];
      current_statement__ = 714;
      context__.validate_dims("data initialization", "e_K", "int",
        std::vector<size_t>{});
      e_K = std::numeric_limits<int>::min();
      current_statement__ = 714;
      e_K = context__.vals_i("e_K")[(1 - 1)];
      current_statement__ = 714;
      stan::math::check_greater_or_equal(function__, "e_K", e_K, 0);
      current_statement__ = 715;
      context__.validate_dims("data initialization", "Npat", "int",
        std::vector<size_t>{});
      Npat = std::numeric_limits<int>::min();
      current_statement__ = 715;
      Npat = context__.vals_i("Npat")[(1 - 1)];
      current_statement__ = 715;
      stan::math::check_greater_or_equal(function__, "Npat", Npat, 0);
      current_statement__ = 716;
      context__.validate_dims("data initialization", "Nevents", "int",
        std::vector<size_t>{});
      Nevents = std::numeric_limits<int>::min();
      current_statement__ = 716;
      Nevents = context__.vals_i("Nevents")[(1 - 1)];
      current_statement__ = 716;
      stan::math::check_greater_or_equal(function__, "Nevents", Nevents, 0);
      current_statement__ = 717;
      context__.validate_dims("data initialization", "qnodes", "int",
        std::vector<size_t>{});
      qnodes = std::numeric_limits<int>::min();
      current_statement__ = 717;
      qnodes = context__.vals_i("qnodes")[(1 - 1)];
      current_statement__ = 717;
      stan::math::check_greater_or_equal(function__, "qnodes", qnodes, 0);
      current_statement__ = 718;
      context__.validate_dims("data initialization", "Npat_times_qnodes",
        "int", std::vector<size_t>{});
      Npat_times_qnodes = std::numeric_limits<int>::min();
      current_statement__ = 718;
      Npat_times_qnodes = context__.vals_i("Npat_times_qnodes")[(1 - 1)];
      current_statement__ = 718;
      stan::math::check_greater_or_equal(function__, "Npat_times_qnodes",
        Npat_times_qnodes, 0);
      current_statement__ = 719;
      context__.validate_dims("data initialization", "basehaz_type", "int",
        std::vector<size_t>{});
      basehaz_type = std::numeric_limits<int>::min();
      current_statement__ = 719;
      basehaz_type = context__.vals_i("basehaz_type")[(1 - 1)];
      current_statement__ = 719;
      stan::math::check_greater_or_equal(function__, "basehaz_type",
        basehaz_type, 1);
      current_statement__ = 719;
      stan::math::check_less_or_equal(function__, "basehaz_type",
        basehaz_type, 3);
      current_statement__ = 720;
      context__.validate_dims("data initialization", "basehaz_df", "int",
        std::vector<size_t>{});
      basehaz_df = std::numeric_limits<int>::min();
      current_statement__ = 720;
      basehaz_df = context__.vals_i("basehaz_df")[(1 - 1)];
      current_statement__ = 720;
      stan::math::check_greater_or_equal(function__, "basehaz_df",
        basehaz_df, 0);
      current_statement__ = 721;
      context__.validate_dims("data initialization", "e_has_intercept",
        "int", std::vector<size_t>{});
      e_has_intercept = std::numeric_limits<int>::min();
      current_statement__ = 721;
      e_has_intercept = context__.vals_i("e_has_intercept")[(1 - 1)];
      current_statement__ = 721;
      stan::math::check_greater_or_equal(function__, "e_has_intercept",
        e_has_intercept, 0);
      current_statement__ = 721;
      stan::math::check_less_or_equal(function__, "e_has_intercept",
        e_has_intercept, 1);
      current_statement__ = 722;
      context__.validate_dims("data initialization", "nrow_e_Xq", "int",
        std::vector<size_t>{});
      nrow_e_Xq = std::numeric_limits<int>::min();
      current_statement__ = 722;
      nrow_e_Xq = context__.vals_i("nrow_e_Xq")[(1 - 1)];
      current_statement__ = 722;
      stan::math::check_greater_or_equal(function__, "nrow_e_Xq", nrow_e_Xq,
        0);
      current_statement__ = 723;
      stan::math::validate_non_negative_index("e_Xq",
        "e_K > 0 ? nrow_e_Xq : 0",
        (stan::math::logical_gt(e_K, 0) ? nrow_e_Xq : 0));
      current_statement__ = 724;
      stan::math::validate_non_negative_index("e_Xq", "e_K", e_K);
      current_statement__ = 725;
      context__.validate_dims("data initialization", "e_Xq", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(e_K, 0) ? nrow_e_Xq : 0)),
          static_cast<size_t>(e_K)});
      e_Xq_data__ = Eigen::Matrix<double,-1,-1>::Constant((stan::math::logical_gt(
                                                             e_K, 0) ? nrow_e_Xq : 0),
                      e_K, std::numeric_limits<double>::quiet_NaN());
      new (&e_Xq) Eigen::Map<Eigen::Matrix<double,-1,-1>>(e_Xq_data__.data(),
        (stan::math::logical_gt(e_K, 0) ? nrow_e_Xq : 0), e_K);
      {
        std::vector<local_scalar_t__> e_Xq_flat__;
        current_statement__ = 725;
        e_Xq_flat__ = context__.vals_r("e_Xq");
        current_statement__ = 725;
        pos__ = 1;
        current_statement__ = 725;
        for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
          current_statement__ = 725;
          for (int sym2__ = 1; sym2__ <=
               (stan::math::logical_gt(e_K, 0) ? nrow_e_Xq : 0); ++sym2__) {
            current_statement__ = 725;
            stan::model::assign(e_Xq, e_Xq_flat__[(pos__ - 1)],
              "assigning variable e_Xq", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 725;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 726;
      stan::math::validate_non_negative_index("e_times", "nrow_e_Xq",
        nrow_e_Xq);
      current_statement__ = 727;
      context__.validate_dims("data initialization", "e_times", "double",
        std::vector<size_t>{static_cast<size_t>(nrow_e_Xq)});
      e_times_data__ = Eigen::Matrix<double,-1,1>::Constant(nrow_e_Xq,
                         std::numeric_limits<double>::quiet_NaN());
      new (&e_times)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(e_times_data__.data(),
        nrow_e_Xq);
      {
        std::vector<local_scalar_t__> e_times_flat__;
        current_statement__ = 727;
        e_times_flat__ = context__.vals_r("e_times");
        current_statement__ = 727;
        pos__ = 1;
        current_statement__ = 727;
        for (int sym1__ = 1; sym1__ <= nrow_e_Xq; ++sym1__) {
          current_statement__ = 727;
          stan::model::assign(e_times, e_times_flat__[(pos__ - 1)],
            "assigning variable e_times", stan::model::index_uni(sym1__));
          current_statement__ = 727;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 728;
      stan::math::validate_non_negative_index("basehaz_X", "nrow_e_Xq",
        nrow_e_Xq);
      current_statement__ = 729;
      stan::math::validate_non_negative_index("basehaz_X", "basehaz_df",
        basehaz_df);
      current_statement__ = 730;
      context__.validate_dims("data initialization", "basehaz_X", "double",
        std::vector<size_t>{static_cast<size_t>(nrow_e_Xq),
          static_cast<size_t>(basehaz_df)});
      basehaz_X_data__ = Eigen::Matrix<double,-1,-1>::Constant(nrow_e_Xq,
                           basehaz_df,
                           std::numeric_limits<double>::quiet_NaN());
      new (&basehaz_X)
        Eigen::Map<Eigen::Matrix<double,-1,-1>>(basehaz_X_data__.data(),
        nrow_e_Xq, basehaz_df);
      {
        std::vector<local_scalar_t__> basehaz_X_flat__;
        current_statement__ = 730;
        basehaz_X_flat__ = context__.vals_r("basehaz_X");
        current_statement__ = 730;
        pos__ = 1;
        current_statement__ = 730;
        for (int sym1__ = 1; sym1__ <= basehaz_df; ++sym1__) {
          current_statement__ = 730;
          for (int sym2__ = 1; sym2__ <= nrow_e_Xq; ++sym2__) {
            current_statement__ = 730;
            stan::model::assign(basehaz_X, basehaz_X_flat__[(pos__ - 1)],
              "assigning variable basehaz_X", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 730;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 731;
      stan::math::validate_non_negative_index("e_xbar", "e_K", e_K);
      current_statement__ = 732;
      context__.validate_dims("data initialization", "e_xbar", "double",
        std::vector<size_t>{static_cast<size_t>(e_K)});
      e_xbar_data__ = Eigen::Matrix<double,-1,1>::Constant(e_K,
                        std::numeric_limits<double>::quiet_NaN());
      new (&e_xbar)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(e_xbar_data__.data(), e_K);
      {
        std::vector<local_scalar_t__> e_xbar_flat__;
        current_statement__ = 732;
        e_xbar_flat__ = context__.vals_r("e_xbar");
        current_statement__ = 732;
        pos__ = 1;
        current_statement__ = 732;
        for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
          current_statement__ = 732;
          stan::model::assign(e_xbar, e_xbar_flat__[(pos__ - 1)],
            "assigning variable e_xbar", stan::model::index_uni(sym1__));
          current_statement__ = 732;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 733;
      stan::math::validate_non_negative_index("e_weights", "Npat", Npat);
      current_statement__ = 734;
      context__.validate_dims("data initialization", "e_weights", "double",
        std::vector<size_t>{static_cast<size_t>(Npat)});
      e_weights_data__ = Eigen::Matrix<double,-1,1>::Constant(Npat,
                           std::numeric_limits<double>::quiet_NaN());
      new (&e_weights)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(e_weights_data__.data(), Npat);
      {
        std::vector<local_scalar_t__> e_weights_flat__;
        current_statement__ = 734;
        e_weights_flat__ = context__.vals_r("e_weights");
        current_statement__ = 734;
        pos__ = 1;
        current_statement__ = 734;
        for (int sym1__ = 1; sym1__ <= Npat; ++sym1__) {
          current_statement__ = 734;
          stan::model::assign(e_weights, e_weights_flat__[(pos__ - 1)],
            "assigning variable e_weights", stan::model::index_uni(sym1__));
          current_statement__ = 734;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 735;
      stan::math::validate_non_negative_index("e_weights_rep",
        "Npat_times_qnodes", Npat_times_qnodes);
      current_statement__ = 736;
      context__.validate_dims("data initialization", "e_weights_rep",
        "double",
        std::vector<size_t>{static_cast<size_t>(Npat_times_qnodes)});
      e_weights_rep_data__ = Eigen::Matrix<double,-1,1>::Constant(Npat_times_qnodes,
                               std::numeric_limits<double>::quiet_NaN());
      new (&e_weights_rep)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(e_weights_rep_data__.data(),
        Npat_times_qnodes);
      {
        std::vector<local_scalar_t__> e_weights_rep_flat__;
        current_statement__ = 736;
        e_weights_rep_flat__ = context__.vals_r("e_weights_rep");
        current_statement__ = 736;
        pos__ = 1;
        current_statement__ = 736;
        for (int sym1__ = 1; sym1__ <= Npat_times_qnodes; ++sym1__) {
          current_statement__ = 736;
          stan::model::assign(e_weights_rep, e_weights_rep_flat__[(pos__ -
            1)], "assigning variable e_weights_rep",
            stan::model::index_uni(sym1__));
          current_statement__ = 736;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 737;
      stan::math::validate_non_negative_index("qwts", "Npat_times_qnodes",
        Npat_times_qnodes);
      current_statement__ = 738;
      context__.validate_dims("data initialization", "qwts", "double",
        std::vector<size_t>{static_cast<size_t>(Npat_times_qnodes)});
      qwts_data__ = Eigen::Matrix<double,-1,1>::Constant(Npat_times_qnodes,
                      std::numeric_limits<double>::quiet_NaN());
      new (&qwts) Eigen::Map<Eigen::Matrix<double,-1,1>>(qwts_data__.data(),
        Npat_times_qnodes);
      {
        std::vector<local_scalar_t__> qwts_flat__;
        current_statement__ = 738;
        qwts_flat__ = context__.vals_r("qwts");
        current_statement__ = 738;
        pos__ = 1;
        current_statement__ = 738;
        for (int sym1__ = 1; sym1__ <= Npat_times_qnodes; ++sym1__) {
          current_statement__ = 738;
          stan::model::assign(qwts, qwts_flat__[(pos__ - 1)],
            "assigning variable qwts", stan::model::index_uni(sym1__));
          current_statement__ = 738;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 739;
      context__.validate_dims("data initialization", "a_prior_dist", "int",
        std::vector<size_t>{});
      a_prior_dist = std::numeric_limits<int>::min();
      current_statement__ = 739;
      a_prior_dist = context__.vals_i("a_prior_dist")[(1 - 1)];
      current_statement__ = 739;
      stan::math::check_greater_or_equal(function__, "a_prior_dist",
        a_prior_dist, 0);
      current_statement__ = 739;
      stan::math::check_less_or_equal(function__, "a_prior_dist",
        a_prior_dist, 6);
      current_statement__ = 740;
      context__.validate_dims("data initialization", "a_K", "int",
        std::vector<size_t>{});
      a_K = std::numeric_limits<int>::min();
      current_statement__ = 740;
      a_K = context__.vals_i("a_K")[(1 - 1)];
      current_statement__ = 740;
      stan::math::check_greater_or_equal(function__, "a_K", a_K, 0);
      current_statement__ = 741;
      stan::math::validate_non_negative_index("a_xbar", "a_K", a_K);
      current_statement__ = 742;
      context__.validate_dims("data initialization", "a_xbar", "double",
        std::vector<size_t>{static_cast<size_t>(a_K)});
      a_xbar_data__ = Eigen::Matrix<double,-1,1>::Constant(a_K,
                        std::numeric_limits<double>::quiet_NaN());
      new (&a_xbar)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(a_xbar_data__.data(), a_K);
      {
        std::vector<local_scalar_t__> a_xbar_flat__;
        current_statement__ = 742;
        a_xbar_flat__ = context__.vals_r("a_xbar");
        current_statement__ = 742;
        pos__ = 1;
        current_statement__ = 742;
        for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
          current_statement__ = 742;
          stan::model::assign(a_xbar, a_xbar_flat__[(pos__ - 1)],
            "assigning variable a_xbar", stan::model::index_uni(sym1__));
          current_statement__ = 742;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 743;
      stan::math::validate_non_negative_index("a_scale", "a_K", a_K);
      current_statement__ = 744;
      context__.validate_dims("data initialization", "a_scale", "double",
        std::vector<size_t>{static_cast<size_t>(a_K)});
      a_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(a_K,
                         std::numeric_limits<double>::quiet_NaN());
      new (&a_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(a_scale_data__.data(), a_K);
      {
        std::vector<local_scalar_t__> a_scale_flat__;
        current_statement__ = 744;
        a_scale_flat__ = context__.vals_r("a_scale");
        current_statement__ = 744;
        pos__ = 1;
        current_statement__ = 744;
        for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
          current_statement__ = 744;
          stan::model::assign(a_scale, a_scale_flat__[(pos__ - 1)],
            "assigning variable a_scale", stan::model::index_uni(sym1__));
          current_statement__ = 744;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 745;
      context__.validate_dims("data initialization", "assoc", "int",
        std::vector<size_t>{});
      assoc = std::numeric_limits<int>::min();
      current_statement__ = 745;
      assoc = context__.vals_i("assoc")[(1 - 1)];
      current_statement__ = 745;
      stan::math::check_greater_or_equal(function__, "assoc", assoc, 0);
      current_statement__ = 745;
      stan::math::check_less_or_equal(function__, "assoc", assoc, 1);
      current_statement__ = 746;
      context__.validate_dims("data initialization", "assoc_uses", "int",
        std::vector<size_t>{static_cast<size_t>(6), static_cast<size_t>(3)});
      assoc_uses = std::vector<std::vector<int>>(6,
                     std::vector<int>(3, std::numeric_limits<int>::min()));
      {
        std::vector<int> assoc_uses_flat__;
        current_statement__ = 746;
        assoc_uses_flat__ = context__.vals_i("assoc_uses");
        current_statement__ = 746;
        pos__ = 1;
        current_statement__ = 746;
        for (int sym1__ = 1; sym1__ <= 3; ++sym1__) {
          current_statement__ = 746;
          for (int sym2__ = 1; sym2__ <= 6; ++sym2__) {
            current_statement__ = 746;
            stan::model::assign(assoc_uses, assoc_uses_flat__[(pos__ - 1)],
              "assigning variable assoc_uses",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 746;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 746;
      stan::math::check_greater_or_equal(function__, "assoc_uses",
        assoc_uses, 0);
      current_statement__ = 746;
      stan::math::check_less_or_equal(function__, "assoc_uses", assoc_uses, 1);
      current_statement__ = 747;
      stan::math::validate_non_negative_index("has_assoc", "M", M);
      current_statement__ = 748;
      context__.validate_dims("data initialization", "has_assoc", "int",
        std::vector<size_t>{static_cast<size_t>(16), static_cast<size_t>(M)});
      has_assoc = std::vector<std::vector<int>>(16,
                    std::vector<int>(M, std::numeric_limits<int>::min()));
      {
        std::vector<int> has_assoc_flat__;
        current_statement__ = 748;
        has_assoc_flat__ = context__.vals_i("has_assoc");
        current_statement__ = 748;
        pos__ = 1;
        current_statement__ = 748;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 748;
          for (int sym2__ = 1; sym2__ <= 16; ++sym2__) {
            current_statement__ = 748;
            stan::model::assign(has_assoc, has_assoc_flat__[(pos__ - 1)],
              "assigning variable has_assoc", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 748;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 748;
      stan::math::check_greater_or_equal(function__, "has_assoc", has_assoc,
        0);
      current_statement__ = 748;
      stan::math::check_less_or_equal(function__, "has_assoc", has_assoc, 1);
      current_statement__ = 749;
      context__.validate_dims("data initialization", "sum_size_which_b",
        "int", std::vector<size_t>{});
      sum_size_which_b = std::numeric_limits<int>::min();
      current_statement__ = 749;
      sum_size_which_b = context__.vals_i("sum_size_which_b")[(1 - 1)];
      current_statement__ = 749;
      stan::math::check_greater_or_equal(function__, "sum_size_which_b",
        sum_size_which_b, 0);
      current_statement__ = 750;
      stan::math::validate_non_negative_index("size_which_b", "M", M);
      current_statement__ = 751;
      context__.validate_dims("data initialization", "size_which_b", "int",
        std::vector<size_t>{static_cast<size_t>(M)});
      size_which_b = std::vector<int>(M, std::numeric_limits<int>::min());
      current_statement__ = 751;
      size_which_b = context__.vals_i("size_which_b");
      current_statement__ = 751;
      stan::math::check_greater_or_equal(function__, "size_which_b",
        size_which_b, 0);
      current_statement__ = 752;
      stan::math::validate_non_negative_index("which_b_zindex",
        "sum_size_which_b", sum_size_which_b);
      current_statement__ = 753;
      context__.validate_dims("data initialization", "which_b_zindex", "int",
        std::vector<size_t>{static_cast<size_t>(sum_size_which_b)});
      which_b_zindex = std::vector<int>(sum_size_which_b,
                         std::numeric_limits<int>::min());
      current_statement__ = 753;
      which_b_zindex = context__.vals_i("which_b_zindex");
      current_statement__ = 753;
      stan::math::check_greater_or_equal(function__, "which_b_zindex",
        which_b_zindex, 1);
      current_statement__ = 754;
      context__.validate_dims("data initialization", "sum_size_which_coef",
        "int", std::vector<size_t>{});
      sum_size_which_coef = std::numeric_limits<int>::min();
      current_statement__ = 754;
      sum_size_which_coef = context__.vals_i("sum_size_which_coef")[(1 - 1)];
      current_statement__ = 754;
      stan::math::check_greater_or_equal(function__, "sum_size_which_coef",
        sum_size_which_coef, 0);
      current_statement__ = 755;
      stan::math::validate_non_negative_index("size_which_coef", "M", M);
      current_statement__ = 756;
      context__.validate_dims("data initialization", "size_which_coef",
        "int", std::vector<size_t>{static_cast<size_t>(M)});
      size_which_coef = std::vector<int>(M, std::numeric_limits<int>::min());
      current_statement__ = 756;
      size_which_coef = context__.vals_i("size_which_coef");
      current_statement__ = 756;
      stan::math::check_greater_or_equal(function__, "size_which_coef",
        size_which_coef, 0);
      current_statement__ = 757;
      stan::math::validate_non_negative_index("which_coef_zindex",
        "sum_size_which_coef", sum_size_which_coef);
      current_statement__ = 758;
      context__.validate_dims("data initialization", "which_coef_zindex",
        "int", std::vector<size_t>{static_cast<size_t>(sum_size_which_coef)});
      which_coef_zindex = std::vector<int>(sum_size_which_coef,
                            std::numeric_limits<int>::min());
      current_statement__ = 758;
      which_coef_zindex = context__.vals_i("which_coef_zindex");
      current_statement__ = 758;
      stan::math::check_greater_or_equal(function__, "which_coef_zindex",
        which_coef_zindex, 1);
      current_statement__ = 759;
      stan::math::validate_non_negative_index("which_coef_xindex",
        "sum_size_which_coef", sum_size_which_coef);
      current_statement__ = 760;
      context__.validate_dims("data initialization", "which_coef_xindex",
        "int", std::vector<size_t>{static_cast<size_t>(sum_size_which_coef)});
      which_coef_xindex = std::vector<int>(sum_size_which_coef,
                            std::numeric_limits<int>::min());
      current_statement__ = 760;
      which_coef_xindex = context__.vals_i("which_coef_xindex");
      current_statement__ = 760;
      stan::math::check_greater_or_equal(function__, "which_coef_xindex",
        which_coef_xindex, 1);
      current_statement__ = 761;
      context__.validate_dims("data initialization",
        "sum_size_which_interactions", "int", std::vector<size_t>{});
      sum_size_which_interactions = std::numeric_limits<int>::min();
      current_statement__ = 761;
      sum_size_which_interactions = context__.vals_i("sum_size_which_interactions")[(1
        - 1)];
      current_statement__ = 761;
      stan::math::check_greater_or_equal(function__,
        "sum_size_which_interactions", sum_size_which_interactions, 0);
      current_statement__ = 762;
      stan::math::validate_non_negative_index("size_which_interactions",
        "M * 4", (M * 4));
      current_statement__ = 763;
      context__.validate_dims("data initialization",
        "size_which_interactions", "int",
        std::vector<size_t>{static_cast<size_t>((M * 4))});
      size_which_interactions = std::vector<int>((M * 4),
                                  std::numeric_limits<int>::min());
      current_statement__ = 763;
      size_which_interactions = context__.vals_i("size_which_interactions");
      current_statement__ = 763;
      stan::math::check_greater_or_equal(function__,
        "size_which_interactions", size_which_interactions, 0);
      current_statement__ = 763;
      stan::math::check_less_or_equal(function__, "size_which_interactions",
        size_which_interactions, sum_size_which_interactions);
      current_statement__ = 764;
      stan::math::validate_non_negative_index("which_interactions",
        "sum_size_which_interactions", sum_size_which_interactions);
      current_statement__ = 765;
      context__.validate_dims("data initialization", "which_interactions",
        "int",
        std::vector<size_t>{static_cast<size_t>(sum_size_which_interactions)});
      which_interactions = std::vector<int>(sum_size_which_interactions,
                             std::numeric_limits<int>::min());
      current_statement__ = 765;
      which_interactions = context__.vals_i("which_interactions");
      current_statement__ = 765;
      stan::math::check_greater_or_equal(function__, "which_interactions",
        which_interactions, 1);
      current_statement__ = 766;
      context__.validate_dims("data initialization", "nrow_y_Xq", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      nrow_y_Xq = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 766;
      nrow_y_Xq = context__.vals_i("nrow_y_Xq");
      current_statement__ = 766;
      stan::math::check_greater_or_equal(function__, "nrow_y_Xq", nrow_y_Xq,
        0);
      current_statement__ = 767;
      stan::math::validate_non_negative_index("y1_xq_eta",
        "assoc_uses[1, 1] == 1 ? nrow_y_Xq[1] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(1), stan::model::index_uni(1)), 1) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(1)) : 0));
      current_statement__ = 768;
      stan::math::validate_non_negative_index("y1_xq_eta", "yK[1]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      current_statement__ = 769;
      context__.validate_dims("data initialization", "y1_xq_eta", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(assoc_uses,
                                   "assoc_uses", stan::model::index_uni(1),
                                   stan::model::index_uni(1)), 1) ? stan::model::rvalue(
                                                                    nrow_y_Xq,
                                                                    "nrow_y_Xq",
                                                                    stan::model::index_uni(
                                                                    1)) : 0)),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(1)))});
      y1_xq_eta_data__ = Eigen::Matrix<double,-1,-1>::Constant((stan::math::logical_eq(
                                                                  stan::model::rvalue(
                                                                    assoc_uses,
                                                                    "assoc_uses",
                                                                    stan::model::index_uni(
                                                                    1),
                                                                    stan::model::index_uni(
                                                                    1)), 1) ? 
                           stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                             stan::model::index_uni(1)) : 0),
                           stan::model::rvalue(yK, "yK",
                             stan::model::index_uni(1)),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y1_xq_eta)
        Eigen::Map<Eigen::Matrix<double,-1,-1>>(y1_xq_eta_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(1), stan::model::index_uni(1)), 1) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(1)) : 0),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      {
        std::vector<local_scalar_t__> y1_xq_eta_flat__;
        current_statement__ = 769;
        y1_xq_eta_flat__ = context__.vals_r("y1_xq_eta");
        current_statement__ = 769;
        pos__ = 1;
        current_statement__ = 769;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(1)); ++sym1__) {
          current_statement__ = 769;
          for (int sym2__ = 1; sym2__ <=
               (stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(1), stan::model::index_uni(1)), 1) ? 
               stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                 stan::model::index_uni(1)) : 0); ++sym2__) {
            current_statement__ = 769;
            stan::model::assign(y1_xq_eta, y1_xq_eta_flat__[(pos__ - 1)],
              "assigning variable y1_xq_eta", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 769;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 770;
      stan::math::validate_non_negative_index("y2_xq_eta",
        "assoc_uses[1, 2] == 1 ? nrow_y_Xq[2] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(1), stan::model::index_uni(2)), 1) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(2)) : 0));
      current_statement__ = 771;
      stan::math::validate_non_negative_index("y2_xq_eta", "yK[2]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      current_statement__ = 772;
      context__.validate_dims("data initialization", "y2_xq_eta", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(assoc_uses,
                                   "assoc_uses", stan::model::index_uni(1),
                                   stan::model::index_uni(2)), 1) ? stan::model::rvalue(
                                                                    nrow_y_Xq,
                                                                    "nrow_y_Xq",
                                                                    stan::model::index_uni(
                                                                    2)) : 0)),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(2)))});
      y2_xq_eta_data__ = Eigen::Matrix<double,-1,-1>::Constant((stan::math::logical_eq(
                                                                  stan::model::rvalue(
                                                                    assoc_uses,
                                                                    "assoc_uses",
                                                                    stan::model::index_uni(
                                                                    1),
                                                                    stan::model::index_uni(
                                                                    2)), 1) ? 
                           stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                             stan::model::index_uni(2)) : 0),
                           stan::model::rvalue(yK, "yK",
                             stan::model::index_uni(2)),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y2_xq_eta)
        Eigen::Map<Eigen::Matrix<double,-1,-1>>(y2_xq_eta_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(1), stan::model::index_uni(2)), 1) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(2)) : 0),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      {
        std::vector<local_scalar_t__> y2_xq_eta_flat__;
        current_statement__ = 772;
        y2_xq_eta_flat__ = context__.vals_r("y2_xq_eta");
        current_statement__ = 772;
        pos__ = 1;
        current_statement__ = 772;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(2)); ++sym1__) {
          current_statement__ = 772;
          for (int sym2__ = 1; sym2__ <=
               (stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(1), stan::model::index_uni(2)), 1) ? 
               stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                 stan::model::index_uni(2)) : 0); ++sym2__) {
            current_statement__ = 772;
            stan::model::assign(y2_xq_eta, y2_xq_eta_flat__[(pos__ - 1)],
              "assigning variable y2_xq_eta", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 772;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 773;
      stan::math::validate_non_negative_index("y3_xq_eta",
        "assoc_uses[1, 3] == 1 ? nrow_y_Xq[3] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(1), stan::model::index_uni(3)), 1) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(3)) : 0));
      current_statement__ = 774;
      stan::math::validate_non_negative_index("y3_xq_eta", "yK[3]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      current_statement__ = 775;
      context__.validate_dims("data initialization", "y3_xq_eta", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(assoc_uses,
                                   "assoc_uses", stan::model::index_uni(1),
                                   stan::model::index_uni(3)), 1) ? stan::model::rvalue(
                                                                    nrow_y_Xq,
                                                                    "nrow_y_Xq",
                                                                    stan::model::index_uni(
                                                                    3)) : 0)),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(3)))});
      y3_xq_eta_data__ = Eigen::Matrix<double,-1,-1>::Constant((stan::math::logical_eq(
                                                                  stan::model::rvalue(
                                                                    assoc_uses,
                                                                    "assoc_uses",
                                                                    stan::model::index_uni(
                                                                    1),
                                                                    stan::model::index_uni(
                                                                    3)), 1) ? 
                           stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                             stan::model::index_uni(3)) : 0),
                           stan::model::rvalue(yK, "yK",
                             stan::model::index_uni(3)),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y3_xq_eta)
        Eigen::Map<Eigen::Matrix<double,-1,-1>>(y3_xq_eta_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(1), stan::model::index_uni(3)), 1) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(3)) : 0),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      {
        std::vector<local_scalar_t__> y3_xq_eta_flat__;
        current_statement__ = 775;
        y3_xq_eta_flat__ = context__.vals_r("y3_xq_eta");
        current_statement__ = 775;
        pos__ = 1;
        current_statement__ = 775;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(3)); ++sym1__) {
          current_statement__ = 775;
          for (int sym2__ = 1; sym2__ <=
               (stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(1), stan::model::index_uni(3)), 1) ? 
               stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                 stan::model::index_uni(3)) : 0); ++sym2__) {
            current_statement__ = 775;
            stan::model::assign(y3_xq_eta, y3_xq_eta_flat__[(pos__ - 1)],
              "assigning variable y3_xq_eta", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 775;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 776;
      stan::math::validate_non_negative_index("y1_offset_eta",
        "has_offset[1] && assoc_uses[1, 1] == 1 ? nrow_y_Xq[1] : 0",
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(1))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(1), stan::model::index_uni(1)), 1))) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(1)) : 0));
      current_statement__ = 777;
      context__.validate_dims("data initialization", "y1_offset_eta",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::model::rvalue(has_offset,
                                    "has_offset", stan::model::index_uni(1)))
                              &&
                              stan::math::primitive_value(
                                stan::math::logical_eq(
                                  stan::model::rvalue(assoc_uses,
                                    "assoc_uses", stan::model::index_uni(1),
                                    stan::model::index_uni(1)), 1))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(1)) : 0))});
      y1_offset_eta_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                    stan::model::rvalue(
                                                                    has_offset,
                                                                    "has_offset",
                                                                    stan::model::index_uni(
                                                                    1))) &&
                               stan::math::primitive_value(
                                 stan::math::logical_eq(
                                   stan::model::rvalue(assoc_uses,
                                     "assoc_uses", stan::model::index_uni(1),
                                     stan::model::index_uni(1)), 1))) ? 
                               stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                 stan::model::index_uni(1)) : 0),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y1_offset_eta)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y1_offset_eta_data__.data(),
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(1))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(1), stan::model::index_uni(1)), 1))) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(1)) : 0));
      {
        std::vector<local_scalar_t__> y1_offset_eta_flat__;
        current_statement__ = 777;
        y1_offset_eta_flat__ = context__.vals_r("y1_offset_eta");
        current_statement__ = 777;
        pos__ = 1;
        current_statement__ = 777;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::model::rvalue(has_offset, "has_offset",
                   stan::model::index_uni(1))) &&
             stan::math::primitive_value(
               stan::math::logical_eq(
                 stan::model::rvalue(assoc_uses, "assoc_uses",
                   stan::model::index_uni(1), stan::model::index_uni(1)), 1))) ? 
             stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
               stan::model::index_uni(1)) : 0); ++sym1__) {
          current_statement__ = 777;
          stan::model::assign(y1_offset_eta, y1_offset_eta_flat__[(pos__ -
            1)], "assigning variable y1_offset_eta",
            stan::model::index_uni(sym1__));
          current_statement__ = 777;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 778;
      stan::math::validate_non_negative_index("y2_offset_eta",
        "has_offset[2] && assoc_uses[1, 2] == 1 ? nrow_y_Xq[2] : 0",
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(2))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(1), stan::model::index_uni(2)), 1))) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(2)) : 0));
      current_statement__ = 779;
      context__.validate_dims("data initialization", "y2_offset_eta",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::model::rvalue(has_offset,
                                    "has_offset", stan::model::index_uni(2)))
                              &&
                              stan::math::primitive_value(
                                stan::math::logical_eq(
                                  stan::model::rvalue(assoc_uses,
                                    "assoc_uses", stan::model::index_uni(1),
                                    stan::model::index_uni(2)), 1))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(2)) : 0))});
      y2_offset_eta_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                    stan::model::rvalue(
                                                                    has_offset,
                                                                    "has_offset",
                                                                    stan::model::index_uni(
                                                                    2))) &&
                               stan::math::primitive_value(
                                 stan::math::logical_eq(
                                   stan::model::rvalue(assoc_uses,
                                     "assoc_uses", stan::model::index_uni(1),
                                     stan::model::index_uni(2)), 1))) ? 
                               stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                 stan::model::index_uni(2)) : 0),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y2_offset_eta)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y2_offset_eta_data__.data(),
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(2))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(1), stan::model::index_uni(2)), 1))) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(2)) : 0));
      {
        std::vector<local_scalar_t__> y2_offset_eta_flat__;
        current_statement__ = 779;
        y2_offset_eta_flat__ = context__.vals_r("y2_offset_eta");
        current_statement__ = 779;
        pos__ = 1;
        current_statement__ = 779;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::model::rvalue(has_offset, "has_offset",
                   stan::model::index_uni(2))) &&
             stan::math::primitive_value(
               stan::math::logical_eq(
                 stan::model::rvalue(assoc_uses, "assoc_uses",
                   stan::model::index_uni(1), stan::model::index_uni(2)), 1))) ? 
             stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
               stan::model::index_uni(2)) : 0); ++sym1__) {
          current_statement__ = 779;
          stan::model::assign(y2_offset_eta, y2_offset_eta_flat__[(pos__ -
            1)], "assigning variable y2_offset_eta",
            stan::model::index_uni(sym1__));
          current_statement__ = 779;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 780;
      stan::math::validate_non_negative_index("y3_offset_eta",
        "has_offset[3] && assoc_uses[1, 3] == 1 ? nrow_y_Xq[3] : 0",
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(3))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(1), stan::model::index_uni(3)), 1))) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(3)) : 0));
      current_statement__ = 781;
      context__.validate_dims("data initialization", "y3_offset_eta",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::model::rvalue(has_offset,
                                    "has_offset", stan::model::index_uni(3)))
                              &&
                              stan::math::primitive_value(
                                stan::math::logical_eq(
                                  stan::model::rvalue(assoc_uses,
                                    "assoc_uses", stan::model::index_uni(1),
                                    stan::model::index_uni(3)), 1))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(3)) : 0))});
      y3_offset_eta_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                    stan::model::rvalue(
                                                                    has_offset,
                                                                    "has_offset",
                                                                    stan::model::index_uni(
                                                                    3))) &&
                               stan::math::primitive_value(
                                 stan::math::logical_eq(
                                   stan::model::rvalue(assoc_uses,
                                     "assoc_uses", stan::model::index_uni(1),
                                     stan::model::index_uni(3)), 1))) ? 
                               stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                 stan::model::index_uni(3)) : 0),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y3_offset_eta)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y3_offset_eta_data__.data(),
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(3))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(1), stan::model::index_uni(3)), 1))) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(3)) : 0));
      {
        std::vector<local_scalar_t__> y3_offset_eta_flat__;
        current_statement__ = 781;
        y3_offset_eta_flat__ = context__.vals_r("y3_offset_eta");
        current_statement__ = 781;
        pos__ = 1;
        current_statement__ = 781;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::model::rvalue(has_offset, "has_offset",
                   stan::model::index_uni(3))) &&
             stan::math::primitive_value(
               stan::math::logical_eq(
                 stan::model::rvalue(assoc_uses, "assoc_uses",
                   stan::model::index_uni(1), stan::model::index_uni(3)), 1))) ? 
             stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
               stan::model::index_uni(3)) : 0); ++sym1__) {
          current_statement__ = 781;
          stan::model::assign(y3_offset_eta, y3_offset_eta_flat__[(pos__ -
            1)], "assigning variable y3_offset_eta",
            stan::model::index_uni(sym1__));
          current_statement__ = 781;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 782;
      stan::math::validate_non_negative_index("y1_z1q_eta", "bK1_len[1]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)));
      current_statement__ = 783;
      stan::math::validate_non_negative_index("y1_z1q_eta",
        "assoc_uses[1, 1] == 1 && bK1_len[1] > 0 ? nrow_y_Xq[1] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(1), stan::model::index_uni(1)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 784;
      context__.validate_dims("data initialization", "y1_z1q_eta", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(1))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(1), stan::model::index_uni(1)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                       nrow_y_Xq,
                                                       "nrow_y_Xq",
                                                       stan::model::index_uni(
                                                         1)) : 0))});
      y1_z1q_eta = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK1_len,
                                                             "bK1_len",
                                                             stan::model::index_uni(
                                                               1)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    1),
                                                                  stan::model::index_uni(
                                                                    1)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK1_len, "bK1_len",
                             stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                                  nrow_y_Xq,
                                                                  "nrow_y_Xq",
                                                                  stan::model::index_uni(
                                                                    1)) : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y1_z1q_eta_flat__;
        current_statement__ = 784;
        y1_z1q_eta_flat__ = context__.vals_r("y1_z1q_eta");
        current_statement__ = 784;
        pos__ = 1;
        current_statement__ = 784;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(1), stan::model::index_uni(1)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK1_len, "bK1_len",
                   stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                        nrow_y_Xq,
                                                        "nrow_y_Xq",
                                                        stan::model::index_uni(
                                                          1)) : 0); ++sym1__) {
          current_statement__ = 784;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(1)); ++sym2__) {
            current_statement__ = 784;
            stan::model::assign(y1_z1q_eta, y1_z1q_eta_flat__[(pos__ - 1)],
              "assigning variable y1_z1q_eta",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 784;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 785;
      stan::math::validate_non_negative_index("y2_z1q_eta", "bK1_len[2]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)));
      current_statement__ = 786;
      stan::math::validate_non_negative_index("y2_z1q_eta",
        "assoc_uses[1, 2] == 1 && bK1_len[2] > 0 ? nrow_y_Xq[2] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(1), stan::model::index_uni(2)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 787;
      context__.validate_dims("data initialization", "y2_z1q_eta", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(2))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(1), stan::model::index_uni(2)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                       nrow_y_Xq,
                                                       "nrow_y_Xq",
                                                       stan::model::index_uni(
                                                         2)) : 0))});
      y2_z1q_eta = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK1_len,
                                                             "bK1_len",
                                                             stan::model::index_uni(
                                                               2)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    1),
                                                                  stan::model::index_uni(
                                                                    2)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK1_len, "bK1_len",
                             stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                                  nrow_y_Xq,
                                                                  "nrow_y_Xq",
                                                                  stan::model::index_uni(
                                                                    2)) : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y2_z1q_eta_flat__;
        current_statement__ = 787;
        y2_z1q_eta_flat__ = context__.vals_r("y2_z1q_eta");
        current_statement__ = 787;
        pos__ = 1;
        current_statement__ = 787;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(1), stan::model::index_uni(2)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK1_len, "bK1_len",
                   stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                        nrow_y_Xq,
                                                        "nrow_y_Xq",
                                                        stan::model::index_uni(
                                                          2)) : 0); ++sym1__) {
          current_statement__ = 787;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(2)); ++sym2__) {
            current_statement__ = 787;
            stan::model::assign(y2_z1q_eta, y2_z1q_eta_flat__[(pos__ - 1)],
              "assigning variable y2_z1q_eta",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 787;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 788;
      stan::math::validate_non_negative_index("y3_z1q_eta", "bK1_len[3]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)));
      current_statement__ = 789;
      stan::math::validate_non_negative_index("y3_z1q_eta",
        "assoc_uses[1, 3] == 1 && bK1_len[3] > 0 ? nrow_y_Xq[3] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(1), stan::model::index_uni(3)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 790;
      context__.validate_dims("data initialization", "y3_z1q_eta", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(3))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(1), stan::model::index_uni(3)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                       nrow_y_Xq,
                                                       "nrow_y_Xq",
                                                       stan::model::index_uni(
                                                         3)) : 0))});
      y3_z1q_eta = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK1_len,
                                                             "bK1_len",
                                                             stan::model::index_uni(
                                                               3)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    1),
                                                                  stan::model::index_uni(
                                                                    3)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK1_len, "bK1_len",
                             stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                                  nrow_y_Xq,
                                                                  "nrow_y_Xq",
                                                                  stan::model::index_uni(
                                                                    3)) : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y3_z1q_eta_flat__;
        current_statement__ = 790;
        y3_z1q_eta_flat__ = context__.vals_r("y3_z1q_eta");
        current_statement__ = 790;
        pos__ = 1;
        current_statement__ = 790;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(1), stan::model::index_uni(3)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK1_len, "bK1_len",
                   stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                        nrow_y_Xq,
                                                        "nrow_y_Xq",
                                                        stan::model::index_uni(
                                                          3)) : 0); ++sym1__) {
          current_statement__ = 790;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(3)); ++sym2__) {
            current_statement__ = 790;
            stan::model::assign(y3_z1q_eta, y3_z1q_eta_flat__[(pos__ - 1)],
              "assigning variable y3_z1q_eta",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 790;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 791;
      stan::math::validate_non_negative_index("y1_z1q_id_eta",
        "assoc_uses[1, 1] == 1 && bK1_len[1] > 0 ? nrow_y_Xq[1] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(1), stan::model::index_uni(1)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 792;
      context__.validate_dims("data initialization", "y1_z1q_id_eta", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(1),
                                      stan::model::index_uni(1)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK1_len, "bK1_len",
                                    stan::model::index_uni(1)), 0))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(1)) : 0))});
      y1_z1q_id_eta = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(1),
                                               stan::model::index_uni(1)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK1_len, "bK1_len",
                              stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    1)) : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 792;
      y1_z1q_id_eta = context__.vals_i("y1_z1q_id_eta");
      current_statement__ = 792;
      stan::math::check_greater_or_equal(function__, "y1_z1q_id_eta",
        y1_z1q_id_eta, 0);
      current_statement__ = 793;
      stan::math::validate_non_negative_index("y2_z1q_id_eta",
        "assoc_uses[1, 2] == 1 && bK1_len[2] > 0 ? nrow_y_Xq[2] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(1), stan::model::index_uni(2)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 794;
      context__.validate_dims("data initialization", "y2_z1q_id_eta", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(1),
                                      stan::model::index_uni(2)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK1_len, "bK1_len",
                                    stan::model::index_uni(2)), 0))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(2)) : 0))});
      y2_z1q_id_eta = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(1),
                                               stan::model::index_uni(2)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK1_len, "bK1_len",
                              stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    2)) : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 794;
      y2_z1q_id_eta = context__.vals_i("y2_z1q_id_eta");
      current_statement__ = 794;
      stan::math::check_greater_or_equal(function__, "y2_z1q_id_eta",
        y2_z1q_id_eta, 0);
      current_statement__ = 795;
      stan::math::validate_non_negative_index("y3_z1q_id_eta",
        "assoc_uses[1, 3] == 1 && bK1_len[3] > 0 ? nrow_y_Xq[3] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(1), stan::model::index_uni(3)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 796;
      context__.validate_dims("data initialization", "y3_z1q_id_eta", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(1),
                                      stan::model::index_uni(3)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK1_len, "bK1_len",
                                    stan::model::index_uni(3)), 0))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(3)) : 0))});
      y3_z1q_id_eta = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(1),
                                               stan::model::index_uni(3)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK1_len, "bK1_len",
                              stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    3)) : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 796;
      y3_z1q_id_eta = context__.vals_i("y3_z1q_id_eta");
      current_statement__ = 796;
      stan::math::check_greater_or_equal(function__, "y3_z1q_id_eta",
        y3_z1q_id_eta, 0);
      current_statement__ = 797;
      stan::math::validate_non_negative_index("y1_z2q_eta", "bK2_len[1]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)));
      current_statement__ = 798;
      stan::math::validate_non_negative_index("y1_z2q_eta",
        "assoc_uses[1, 1] == 1 && bK2_len[1] > 0 ? nrow_y_Xq[1] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(1), stan::model::index_uni(1)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 799;
      context__.validate_dims("data initialization", "y1_z2q_eta", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(1))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(1), stan::model::index_uni(1)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                       nrow_y_Xq,
                                                       "nrow_y_Xq",
                                                       stan::model::index_uni(
                                                         1)) : 0))});
      y1_z2q_eta = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK2_len,
                                                             "bK2_len",
                                                             stan::model::index_uni(
                                                               1)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    1),
                                                                  stan::model::index_uni(
                                                                    1)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK2_len, "bK2_len",
                             stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                                  nrow_y_Xq,
                                                                  "nrow_y_Xq",
                                                                  stan::model::index_uni(
                                                                    1)) : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y1_z2q_eta_flat__;
        current_statement__ = 799;
        y1_z2q_eta_flat__ = context__.vals_r("y1_z2q_eta");
        current_statement__ = 799;
        pos__ = 1;
        current_statement__ = 799;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(1), stan::model::index_uni(1)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK2_len, "bK2_len",
                   stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                        nrow_y_Xq,
                                                        "nrow_y_Xq",
                                                        stan::model::index_uni(
                                                          1)) : 0); ++sym1__) {
          current_statement__ = 799;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(1)); ++sym2__) {
            current_statement__ = 799;
            stan::model::assign(y1_z2q_eta, y1_z2q_eta_flat__[(pos__ - 1)],
              "assigning variable y1_z2q_eta",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 799;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 800;
      stan::math::validate_non_negative_index("y2_z2q_eta", "bK2_len[2]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)));
      current_statement__ = 801;
      stan::math::validate_non_negative_index("y2_z2q_eta",
        "assoc_uses[1, 2] == 1 && bK2_len[2] > 0 ? nrow_y_Xq[2] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(1), stan::model::index_uni(2)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 802;
      context__.validate_dims("data initialization", "y2_z2q_eta", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(2))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(1), stan::model::index_uni(2)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                       nrow_y_Xq,
                                                       "nrow_y_Xq",
                                                       stan::model::index_uni(
                                                         2)) : 0))});
      y2_z2q_eta = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK2_len,
                                                             "bK2_len",
                                                             stan::model::index_uni(
                                                               2)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    1),
                                                                  stan::model::index_uni(
                                                                    2)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK2_len, "bK2_len",
                             stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                                  nrow_y_Xq,
                                                                  "nrow_y_Xq",
                                                                  stan::model::index_uni(
                                                                    2)) : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y2_z2q_eta_flat__;
        current_statement__ = 802;
        y2_z2q_eta_flat__ = context__.vals_r("y2_z2q_eta");
        current_statement__ = 802;
        pos__ = 1;
        current_statement__ = 802;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(1), stan::model::index_uni(2)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK2_len, "bK2_len",
                   stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                        nrow_y_Xq,
                                                        "nrow_y_Xq",
                                                        stan::model::index_uni(
                                                          2)) : 0); ++sym1__) {
          current_statement__ = 802;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(2)); ++sym2__) {
            current_statement__ = 802;
            stan::model::assign(y2_z2q_eta, y2_z2q_eta_flat__[(pos__ - 1)],
              "assigning variable y2_z2q_eta",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 802;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 803;
      stan::math::validate_non_negative_index("y3_z2q_eta", "bK2_len[3]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)));
      current_statement__ = 804;
      stan::math::validate_non_negative_index("y3_z2q_eta",
        "assoc_uses[1, 3] == 1 && bK2_len[3] > 0 ? nrow_y_Xq[3] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(1), stan::model::index_uni(3)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 805;
      context__.validate_dims("data initialization", "y3_z2q_eta", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(3))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(1), stan::model::index_uni(3)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                       nrow_y_Xq,
                                                       "nrow_y_Xq",
                                                       stan::model::index_uni(
                                                         3)) : 0))});
      y3_z2q_eta = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK2_len,
                                                             "bK2_len",
                                                             stan::model::index_uni(
                                                               3)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    1),
                                                                  stan::model::index_uni(
                                                                    3)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK2_len, "bK2_len",
                             stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                                  nrow_y_Xq,
                                                                  "nrow_y_Xq",
                                                                  stan::model::index_uni(
                                                                    3)) : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y3_z2q_eta_flat__;
        current_statement__ = 805;
        y3_z2q_eta_flat__ = context__.vals_r("y3_z2q_eta");
        current_statement__ = 805;
        pos__ = 1;
        current_statement__ = 805;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(1), stan::model::index_uni(3)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK2_len, "bK2_len",
                   stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                        nrow_y_Xq,
                                                        "nrow_y_Xq",
                                                        stan::model::index_uni(
                                                          3)) : 0); ++sym1__) {
          current_statement__ = 805;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(3)); ++sym2__) {
            current_statement__ = 805;
            stan::model::assign(y3_z2q_eta, y3_z2q_eta_flat__[(pos__ - 1)],
              "assigning variable y3_z2q_eta",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 805;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 806;
      stan::math::validate_non_negative_index("y1_z2q_id_eta",
        "assoc_uses[1, 1] == 1 && bK2_len[1] > 0 ? nrow_y_Xq[1] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(1), stan::model::index_uni(1)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 807;
      context__.validate_dims("data initialization", "y1_z2q_id_eta", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(1),
                                      stan::model::index_uni(1)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK2_len, "bK2_len",
                                    stan::model::index_uni(1)), 0))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(1)) : 0))});
      y1_z2q_id_eta = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(1),
                                               stan::model::index_uni(1)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK2_len, "bK2_len",
                              stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    1)) : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 807;
      y1_z2q_id_eta = context__.vals_i("y1_z2q_id_eta");
      current_statement__ = 807;
      stan::math::check_greater_or_equal(function__, "y1_z2q_id_eta",
        y1_z2q_id_eta, 0);
      current_statement__ = 808;
      stan::math::validate_non_negative_index("y2_z2q_id_eta",
        "assoc_uses[1, 2] == 1 && bK2_len[2] > 0 ? nrow_y_Xq[2] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(1), stan::model::index_uni(2)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 809;
      context__.validate_dims("data initialization", "y2_z2q_id_eta", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(1),
                                      stan::model::index_uni(2)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK2_len, "bK2_len",
                                    stan::model::index_uni(2)), 0))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(2)) : 0))});
      y2_z2q_id_eta = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(1),
                                               stan::model::index_uni(2)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK2_len, "bK2_len",
                              stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    2)) : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 809;
      y2_z2q_id_eta = context__.vals_i("y2_z2q_id_eta");
      current_statement__ = 809;
      stan::math::check_greater_or_equal(function__, "y2_z2q_id_eta",
        y2_z2q_id_eta, 0);
      current_statement__ = 810;
      stan::math::validate_non_negative_index("y3_z2q_id_eta",
        "assoc_uses[1, 3] == 1 && bK2_len[3] > 0 ? nrow_y_Xq[3] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(1), stan::model::index_uni(3)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 811;
      context__.validate_dims("data initialization", "y3_z2q_id_eta", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(1),
                                      stan::model::index_uni(3)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK2_len, "bK2_len",
                                    stan::model::index_uni(3)), 0))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(3)) : 0))});
      y3_z2q_id_eta = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(1),
                                               stan::model::index_uni(3)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK2_len, "bK2_len",
                              stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    3)) : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 811;
      y3_z2q_id_eta = context__.vals_i("y3_z2q_id_eta");
      current_statement__ = 811;
      stan::math::check_greater_or_equal(function__, "y3_z2q_id_eta",
        y3_z2q_id_eta, 0);
      current_statement__ = 812;
      stan::math::validate_non_negative_index("y1_xq_eps",
        "assoc_uses[2, 1] == 1 ? nrow_y_Xq[1] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(2), stan::model::index_uni(1)), 1) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(1)) : 0));
      current_statement__ = 813;
      stan::math::validate_non_negative_index("y1_xq_eps", "yK[1]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      current_statement__ = 814;
      context__.validate_dims("data initialization", "y1_xq_eps", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(assoc_uses,
                                   "assoc_uses", stan::model::index_uni(2),
                                   stan::model::index_uni(1)), 1) ? stan::model::rvalue(
                                                                    nrow_y_Xq,
                                                                    "nrow_y_Xq",
                                                                    stan::model::index_uni(
                                                                    1)) : 0)),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(1)))});
      y1_xq_eps_data__ = Eigen::Matrix<double,-1,-1>::Constant((stan::math::logical_eq(
                                                                  stan::model::rvalue(
                                                                    assoc_uses,
                                                                    "assoc_uses",
                                                                    stan::model::index_uni(
                                                                    2),
                                                                    stan::model::index_uni(
                                                                    1)), 1) ? 
                           stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                             stan::model::index_uni(1)) : 0),
                           stan::model::rvalue(yK, "yK",
                             stan::model::index_uni(1)),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y1_xq_eps)
        Eigen::Map<Eigen::Matrix<double,-1,-1>>(y1_xq_eps_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(2), stan::model::index_uni(1)), 1) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(1)) : 0),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      {
        std::vector<local_scalar_t__> y1_xq_eps_flat__;
        current_statement__ = 814;
        y1_xq_eps_flat__ = context__.vals_r("y1_xq_eps");
        current_statement__ = 814;
        pos__ = 1;
        current_statement__ = 814;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(1)); ++sym1__) {
          current_statement__ = 814;
          for (int sym2__ = 1; sym2__ <=
               (stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(2), stan::model::index_uni(1)), 1) ? 
               stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                 stan::model::index_uni(1)) : 0); ++sym2__) {
            current_statement__ = 814;
            stan::model::assign(y1_xq_eps, y1_xq_eps_flat__[(pos__ - 1)],
              "assigning variable y1_xq_eps", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 814;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 815;
      stan::math::validate_non_negative_index("y2_xq_eps",
        "assoc_uses[2, 2] == 1 ? nrow_y_Xq[2] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(2), stan::model::index_uni(2)), 1) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(2)) : 0));
      current_statement__ = 816;
      stan::math::validate_non_negative_index("y2_xq_eps", "yK[2]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      current_statement__ = 817;
      context__.validate_dims("data initialization", "y2_xq_eps", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(assoc_uses,
                                   "assoc_uses", stan::model::index_uni(2),
                                   stan::model::index_uni(2)), 1) ? stan::model::rvalue(
                                                                    nrow_y_Xq,
                                                                    "nrow_y_Xq",
                                                                    stan::model::index_uni(
                                                                    2)) : 0)),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(2)))});
      y2_xq_eps_data__ = Eigen::Matrix<double,-1,-1>::Constant((stan::math::logical_eq(
                                                                  stan::model::rvalue(
                                                                    assoc_uses,
                                                                    "assoc_uses",
                                                                    stan::model::index_uni(
                                                                    2),
                                                                    stan::model::index_uni(
                                                                    2)), 1) ? 
                           stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                             stan::model::index_uni(2)) : 0),
                           stan::model::rvalue(yK, "yK",
                             stan::model::index_uni(2)),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y2_xq_eps)
        Eigen::Map<Eigen::Matrix<double,-1,-1>>(y2_xq_eps_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(2), stan::model::index_uni(2)), 1) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(2)) : 0),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      {
        std::vector<local_scalar_t__> y2_xq_eps_flat__;
        current_statement__ = 817;
        y2_xq_eps_flat__ = context__.vals_r("y2_xq_eps");
        current_statement__ = 817;
        pos__ = 1;
        current_statement__ = 817;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(2)); ++sym1__) {
          current_statement__ = 817;
          for (int sym2__ = 1; sym2__ <=
               (stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(2), stan::model::index_uni(2)), 1) ? 
               stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                 stan::model::index_uni(2)) : 0); ++sym2__) {
            current_statement__ = 817;
            stan::model::assign(y2_xq_eps, y2_xq_eps_flat__[(pos__ - 1)],
              "assigning variable y2_xq_eps", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 817;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 818;
      stan::math::validate_non_negative_index("y3_xq_eps",
        "assoc_uses[2, 3] == 1 ? nrow_y_Xq[3] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(2), stan::model::index_uni(3)), 1) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(3)) : 0));
      current_statement__ = 819;
      stan::math::validate_non_negative_index("y3_xq_eps", "yK[3]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      current_statement__ = 820;
      context__.validate_dims("data initialization", "y3_xq_eps", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(assoc_uses,
                                   "assoc_uses", stan::model::index_uni(2),
                                   stan::model::index_uni(3)), 1) ? stan::model::rvalue(
                                                                    nrow_y_Xq,
                                                                    "nrow_y_Xq",
                                                                    stan::model::index_uni(
                                                                    3)) : 0)),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(3)))});
      y3_xq_eps_data__ = Eigen::Matrix<double,-1,-1>::Constant((stan::math::logical_eq(
                                                                  stan::model::rvalue(
                                                                    assoc_uses,
                                                                    "assoc_uses",
                                                                    stan::model::index_uni(
                                                                    2),
                                                                    stan::model::index_uni(
                                                                    3)), 1) ? 
                           stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                             stan::model::index_uni(3)) : 0),
                           stan::model::rvalue(yK, "yK",
                             stan::model::index_uni(3)),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y3_xq_eps)
        Eigen::Map<Eigen::Matrix<double,-1,-1>>(y3_xq_eps_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(2), stan::model::index_uni(3)), 1) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(3)) : 0),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      {
        std::vector<local_scalar_t__> y3_xq_eps_flat__;
        current_statement__ = 820;
        y3_xq_eps_flat__ = context__.vals_r("y3_xq_eps");
        current_statement__ = 820;
        pos__ = 1;
        current_statement__ = 820;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(3)); ++sym1__) {
          current_statement__ = 820;
          for (int sym2__ = 1; sym2__ <=
               (stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(2), stan::model::index_uni(3)), 1) ? 
               stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                 stan::model::index_uni(3)) : 0); ++sym2__) {
            current_statement__ = 820;
            stan::model::assign(y3_xq_eps, y3_xq_eps_flat__[(pos__ - 1)],
              "assigning variable y3_xq_eps", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 820;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 821;
      stan::math::validate_non_negative_index("y1_offset_eps",
        "has_offset[1] && assoc_uses[2, 1] == 1 ? nrow_y_Xq[1] : 0",
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(1))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(2), stan::model::index_uni(1)), 1))) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(1)) : 0));
      current_statement__ = 822;
      context__.validate_dims("data initialization", "y1_offset_eps",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::model::rvalue(has_offset,
                                    "has_offset", stan::model::index_uni(1)))
                              &&
                              stan::math::primitive_value(
                                stan::math::logical_eq(
                                  stan::model::rvalue(assoc_uses,
                                    "assoc_uses", stan::model::index_uni(2),
                                    stan::model::index_uni(1)), 1))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(1)) : 0))});
      y1_offset_eps_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                    stan::model::rvalue(
                                                                    has_offset,
                                                                    "has_offset",
                                                                    stan::model::index_uni(
                                                                    1))) &&
                               stan::math::primitive_value(
                                 stan::math::logical_eq(
                                   stan::model::rvalue(assoc_uses,
                                     "assoc_uses", stan::model::index_uni(2),
                                     stan::model::index_uni(1)), 1))) ? 
                               stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                 stan::model::index_uni(1)) : 0),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y1_offset_eps)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y1_offset_eps_data__.data(),
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(1))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(2), stan::model::index_uni(1)), 1))) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(1)) : 0));
      {
        std::vector<local_scalar_t__> y1_offset_eps_flat__;
        current_statement__ = 822;
        y1_offset_eps_flat__ = context__.vals_r("y1_offset_eps");
        current_statement__ = 822;
        pos__ = 1;
        current_statement__ = 822;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::model::rvalue(has_offset, "has_offset",
                   stan::model::index_uni(1))) &&
             stan::math::primitive_value(
               stan::math::logical_eq(
                 stan::model::rvalue(assoc_uses, "assoc_uses",
                   stan::model::index_uni(2), stan::model::index_uni(1)), 1))) ? 
             stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
               stan::model::index_uni(1)) : 0); ++sym1__) {
          current_statement__ = 822;
          stan::model::assign(y1_offset_eps, y1_offset_eps_flat__[(pos__ -
            1)], "assigning variable y1_offset_eps",
            stan::model::index_uni(sym1__));
          current_statement__ = 822;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 823;
      stan::math::validate_non_negative_index("y2_offset_eps",
        "has_offset[2] && assoc_uses[2, 2] == 1 ? nrow_y_Xq[2] : 0",
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(2))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(2), stan::model::index_uni(2)), 1))) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(2)) : 0));
      current_statement__ = 824;
      context__.validate_dims("data initialization", "y2_offset_eps",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::model::rvalue(has_offset,
                                    "has_offset", stan::model::index_uni(2)))
                              &&
                              stan::math::primitive_value(
                                stan::math::logical_eq(
                                  stan::model::rvalue(assoc_uses,
                                    "assoc_uses", stan::model::index_uni(2),
                                    stan::model::index_uni(2)), 1))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(2)) : 0))});
      y2_offset_eps_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                    stan::model::rvalue(
                                                                    has_offset,
                                                                    "has_offset",
                                                                    stan::model::index_uni(
                                                                    2))) &&
                               stan::math::primitive_value(
                                 stan::math::logical_eq(
                                   stan::model::rvalue(assoc_uses,
                                     "assoc_uses", stan::model::index_uni(2),
                                     stan::model::index_uni(2)), 1))) ? 
                               stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                 stan::model::index_uni(2)) : 0),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y2_offset_eps)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y2_offset_eps_data__.data(),
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(2))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(2), stan::model::index_uni(2)), 1))) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(2)) : 0));
      {
        std::vector<local_scalar_t__> y2_offset_eps_flat__;
        current_statement__ = 824;
        y2_offset_eps_flat__ = context__.vals_r("y2_offset_eps");
        current_statement__ = 824;
        pos__ = 1;
        current_statement__ = 824;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::model::rvalue(has_offset, "has_offset",
                   stan::model::index_uni(2))) &&
             stan::math::primitive_value(
               stan::math::logical_eq(
                 stan::model::rvalue(assoc_uses, "assoc_uses",
                   stan::model::index_uni(2), stan::model::index_uni(2)), 1))) ? 
             stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
               stan::model::index_uni(2)) : 0); ++sym1__) {
          current_statement__ = 824;
          stan::model::assign(y2_offset_eps, y2_offset_eps_flat__[(pos__ -
            1)], "assigning variable y2_offset_eps",
            stan::model::index_uni(sym1__));
          current_statement__ = 824;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 825;
      stan::math::validate_non_negative_index("y3_offset_eps",
        "has_offset[3] && assoc_uses[2, 3] == 1 ? nrow_y_Xq[3] : 0",
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(3))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(2), stan::model::index_uni(3)), 1))) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(3)) : 0));
      current_statement__ = 826;
      context__.validate_dims("data initialization", "y3_offset_eps",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::model::rvalue(has_offset,
                                    "has_offset", stan::model::index_uni(3)))
                              &&
                              stan::math::primitive_value(
                                stan::math::logical_eq(
                                  stan::model::rvalue(assoc_uses,
                                    "assoc_uses", stan::model::index_uni(2),
                                    stan::model::index_uni(3)), 1))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(3)) : 0))});
      y3_offset_eps_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                    stan::model::rvalue(
                                                                    has_offset,
                                                                    "has_offset",
                                                                    stan::model::index_uni(
                                                                    3))) &&
                               stan::math::primitive_value(
                                 stan::math::logical_eq(
                                   stan::model::rvalue(assoc_uses,
                                     "assoc_uses", stan::model::index_uni(2),
                                     stan::model::index_uni(3)), 1))) ? 
                               stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                 stan::model::index_uni(3)) : 0),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y3_offset_eps)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y3_offset_eps_data__.data(),
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(3))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(2), stan::model::index_uni(3)), 1))) ? 
        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq", stan::model::index_uni(3)) : 0));
      {
        std::vector<local_scalar_t__> y3_offset_eps_flat__;
        current_statement__ = 826;
        y3_offset_eps_flat__ = context__.vals_r("y3_offset_eps");
        current_statement__ = 826;
        pos__ = 1;
        current_statement__ = 826;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::model::rvalue(has_offset, "has_offset",
                   stan::model::index_uni(3))) &&
             stan::math::primitive_value(
               stan::math::logical_eq(
                 stan::model::rvalue(assoc_uses, "assoc_uses",
                   stan::model::index_uni(2), stan::model::index_uni(3)), 1))) ? 
             stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
               stan::model::index_uni(3)) : 0); ++sym1__) {
          current_statement__ = 826;
          stan::model::assign(y3_offset_eps, y3_offset_eps_flat__[(pos__ -
            1)], "assigning variable y3_offset_eps",
            stan::model::index_uni(sym1__));
          current_statement__ = 826;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 827;
      stan::math::validate_non_negative_index("y1_z1q_eps", "bK1_len[1]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)));
      current_statement__ = 828;
      stan::math::validate_non_negative_index("y1_z1q_eps",
        "assoc_uses[2, 1] == 1 && bK1_len[1] > 0 ? nrow_y_Xq[1] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(2), stan::model::index_uni(1)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 829;
      context__.validate_dims("data initialization", "y1_z1q_eps", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(1))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(2), stan::model::index_uni(1)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                       nrow_y_Xq,
                                                       "nrow_y_Xq",
                                                       stan::model::index_uni(
                                                         1)) : 0))});
      y1_z1q_eps = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK1_len,
                                                             "bK1_len",
                                                             stan::model::index_uni(
                                                               1)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    2),
                                                                  stan::model::index_uni(
                                                                    1)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK1_len, "bK1_len",
                             stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                                  nrow_y_Xq,
                                                                  "nrow_y_Xq",
                                                                  stan::model::index_uni(
                                                                    1)) : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y1_z1q_eps_flat__;
        current_statement__ = 829;
        y1_z1q_eps_flat__ = context__.vals_r("y1_z1q_eps");
        current_statement__ = 829;
        pos__ = 1;
        current_statement__ = 829;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(2), stan::model::index_uni(1)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK1_len, "bK1_len",
                   stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                        nrow_y_Xq,
                                                        "nrow_y_Xq",
                                                        stan::model::index_uni(
                                                          1)) : 0); ++sym1__) {
          current_statement__ = 829;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(1)); ++sym2__) {
            current_statement__ = 829;
            stan::model::assign(y1_z1q_eps, y1_z1q_eps_flat__[(pos__ - 1)],
              "assigning variable y1_z1q_eps",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 829;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 830;
      stan::math::validate_non_negative_index("y2_z1q_eps", "bK1_len[2]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)));
      current_statement__ = 831;
      stan::math::validate_non_negative_index("y2_z1q_eps",
        "assoc_uses[2, 2] == 1 && bK1_len[2] > 0 ? nrow_y_Xq[2] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(2), stan::model::index_uni(2)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 832;
      context__.validate_dims("data initialization", "y2_z1q_eps", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(2))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(2), stan::model::index_uni(2)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                       nrow_y_Xq,
                                                       "nrow_y_Xq",
                                                       stan::model::index_uni(
                                                         2)) : 0))});
      y2_z1q_eps = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK1_len,
                                                             "bK1_len",
                                                             stan::model::index_uni(
                                                               2)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    2),
                                                                  stan::model::index_uni(
                                                                    2)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK1_len, "bK1_len",
                             stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                                  nrow_y_Xq,
                                                                  "nrow_y_Xq",
                                                                  stan::model::index_uni(
                                                                    2)) : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y2_z1q_eps_flat__;
        current_statement__ = 832;
        y2_z1q_eps_flat__ = context__.vals_r("y2_z1q_eps");
        current_statement__ = 832;
        pos__ = 1;
        current_statement__ = 832;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(2), stan::model::index_uni(2)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK1_len, "bK1_len",
                   stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                        nrow_y_Xq,
                                                        "nrow_y_Xq",
                                                        stan::model::index_uni(
                                                          2)) : 0); ++sym1__) {
          current_statement__ = 832;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(2)); ++sym2__) {
            current_statement__ = 832;
            stan::model::assign(y2_z1q_eps, y2_z1q_eps_flat__[(pos__ - 1)],
              "assigning variable y2_z1q_eps",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 832;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 833;
      stan::math::validate_non_negative_index("y3_z1q_eps", "bK1_len[3]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)));
      current_statement__ = 834;
      stan::math::validate_non_negative_index("y3_z1q_eps",
        "assoc_uses[2, 3] == 1 && bK1_len[3] > 0 ? nrow_y_Xq[3] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(2), stan::model::index_uni(3)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 835;
      context__.validate_dims("data initialization", "y3_z1q_eps", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(3))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(2), stan::model::index_uni(3)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                       nrow_y_Xq,
                                                       "nrow_y_Xq",
                                                       stan::model::index_uni(
                                                         3)) : 0))});
      y3_z1q_eps = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK1_len,
                                                             "bK1_len",
                                                             stan::model::index_uni(
                                                               3)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    2),
                                                                  stan::model::index_uni(
                                                                    3)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK1_len, "bK1_len",
                             stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                                  nrow_y_Xq,
                                                                  "nrow_y_Xq",
                                                                  stan::model::index_uni(
                                                                    3)) : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y3_z1q_eps_flat__;
        current_statement__ = 835;
        y3_z1q_eps_flat__ = context__.vals_r("y3_z1q_eps");
        current_statement__ = 835;
        pos__ = 1;
        current_statement__ = 835;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(2), stan::model::index_uni(3)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK1_len, "bK1_len",
                   stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                        nrow_y_Xq,
                                                        "nrow_y_Xq",
                                                        stan::model::index_uni(
                                                          3)) : 0); ++sym1__) {
          current_statement__ = 835;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(3)); ++sym2__) {
            current_statement__ = 835;
            stan::model::assign(y3_z1q_eps, y3_z1q_eps_flat__[(pos__ - 1)],
              "assigning variable y3_z1q_eps",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 835;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 836;
      stan::math::validate_non_negative_index("y1_z1q_id_eps",
        "assoc_uses[2, 1] == 1 && bK1_len[1] > 0 ? nrow_y_Xq[1] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(2), stan::model::index_uni(1)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 837;
      context__.validate_dims("data initialization", "y1_z1q_id_eps", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(2),
                                      stan::model::index_uni(1)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK1_len, "bK1_len",
                                    stan::model::index_uni(1)), 0))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(1)) : 0))});
      y1_z1q_id_eps = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(2),
                                               stan::model::index_uni(1)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK1_len, "bK1_len",
                              stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    1)) : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 837;
      y1_z1q_id_eps = context__.vals_i("y1_z1q_id_eps");
      current_statement__ = 837;
      stan::math::check_greater_or_equal(function__, "y1_z1q_id_eps",
        y1_z1q_id_eps, 0);
      current_statement__ = 838;
      stan::math::validate_non_negative_index("y2_z1q_id_eps",
        "assoc_uses[2, 2] == 1 && bK1_len[2] > 0 ? nrow_y_Xq[2] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(2), stan::model::index_uni(2)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 839;
      context__.validate_dims("data initialization", "y2_z1q_id_eps", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(2),
                                      stan::model::index_uni(2)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK1_len, "bK1_len",
                                    stan::model::index_uni(2)), 0))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(2)) : 0))});
      y2_z1q_id_eps = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(2),
                                               stan::model::index_uni(2)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK1_len, "bK1_len",
                              stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    2)) : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 839;
      y2_z1q_id_eps = context__.vals_i("y2_z1q_id_eps");
      current_statement__ = 839;
      stan::math::check_greater_or_equal(function__, "y2_z1q_id_eps",
        y2_z1q_id_eps, 0);
      current_statement__ = 840;
      stan::math::validate_non_negative_index("y3_z1q_id_eps",
        "assoc_uses[2, 3] == 1 && bK1_len[3] > 0 ? nrow_y_Xq[3] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(2), stan::model::index_uni(3)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 841;
      context__.validate_dims("data initialization", "y3_z1q_id_eps", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(2),
                                      stan::model::index_uni(3)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK1_len, "bK1_len",
                                    stan::model::index_uni(3)), 0))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(3)) : 0))});
      y3_z1q_id_eps = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(2),
                                               stan::model::index_uni(3)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK1_len, "bK1_len",
                              stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    3)) : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 841;
      y3_z1q_id_eps = context__.vals_i("y3_z1q_id_eps");
      current_statement__ = 841;
      stan::math::check_greater_or_equal(function__, "y3_z1q_id_eps",
        y3_z1q_id_eps, 0);
      current_statement__ = 842;
      stan::math::validate_non_negative_index("y1_z2q_eps", "bK2_len[1]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)));
      current_statement__ = 843;
      stan::math::validate_non_negative_index("y1_z2q_eps",
        "assoc_uses[2, 1] == 1 && bK2_len[1] > 0 ? nrow_y_Xq[1] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(2), stan::model::index_uni(1)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 844;
      context__.validate_dims("data initialization", "y1_z2q_eps", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(1))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(2), stan::model::index_uni(1)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                       nrow_y_Xq,
                                                       "nrow_y_Xq",
                                                       stan::model::index_uni(
                                                         1)) : 0))});
      y1_z2q_eps = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK2_len,
                                                             "bK2_len",
                                                             stan::model::index_uni(
                                                               1)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    2),
                                                                  stan::model::index_uni(
                                                                    1)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK2_len, "bK2_len",
                             stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                                  nrow_y_Xq,
                                                                  "nrow_y_Xq",
                                                                  stan::model::index_uni(
                                                                    1)) : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y1_z2q_eps_flat__;
        current_statement__ = 844;
        y1_z2q_eps_flat__ = context__.vals_r("y1_z2q_eps");
        current_statement__ = 844;
        pos__ = 1;
        current_statement__ = 844;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(2), stan::model::index_uni(1)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK2_len, "bK2_len",
                   stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                        nrow_y_Xq,
                                                        "nrow_y_Xq",
                                                        stan::model::index_uni(
                                                          1)) : 0); ++sym1__) {
          current_statement__ = 844;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(1)); ++sym2__) {
            current_statement__ = 844;
            stan::model::assign(y1_z2q_eps, y1_z2q_eps_flat__[(pos__ - 1)],
              "assigning variable y1_z2q_eps",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 844;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 845;
      stan::math::validate_non_negative_index("y2_z2q_eps", "bK2_len[2]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)));
      current_statement__ = 846;
      stan::math::validate_non_negative_index("y2_z2q_eps",
        "assoc_uses[2, 2] == 1 && bK2_len[2] > 0 ? nrow_y_Xq[2] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(2), stan::model::index_uni(2)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 847;
      context__.validate_dims("data initialization", "y2_z2q_eps", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(2))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(2), stan::model::index_uni(2)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                       nrow_y_Xq,
                                                       "nrow_y_Xq",
                                                       stan::model::index_uni(
                                                         2)) : 0))});
      y2_z2q_eps = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK2_len,
                                                             "bK2_len",
                                                             stan::model::index_uni(
                                                               2)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    2),
                                                                  stan::model::index_uni(
                                                                    2)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK2_len, "bK2_len",
                             stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                                  nrow_y_Xq,
                                                                  "nrow_y_Xq",
                                                                  stan::model::index_uni(
                                                                    2)) : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y2_z2q_eps_flat__;
        current_statement__ = 847;
        y2_z2q_eps_flat__ = context__.vals_r("y2_z2q_eps");
        current_statement__ = 847;
        pos__ = 1;
        current_statement__ = 847;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(2), stan::model::index_uni(2)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK2_len, "bK2_len",
                   stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                        nrow_y_Xq,
                                                        "nrow_y_Xq",
                                                        stan::model::index_uni(
                                                          2)) : 0); ++sym1__) {
          current_statement__ = 847;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(2)); ++sym2__) {
            current_statement__ = 847;
            stan::model::assign(y2_z2q_eps, y2_z2q_eps_flat__[(pos__ - 1)],
              "assigning variable y2_z2q_eps",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 847;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 848;
      stan::math::validate_non_negative_index("y3_z2q_eps", "bK2_len[3]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)));
      current_statement__ = 849;
      stan::math::validate_non_negative_index("y3_z2q_eps",
        "assoc_uses[2, 3] == 1 && bK2_len[3] > 0 ? nrow_y_Xq[3] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(2), stan::model::index_uni(3)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 850;
      context__.validate_dims("data initialization", "y3_z2q_eps", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(3))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(2), stan::model::index_uni(3)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                       nrow_y_Xq,
                                                       "nrow_y_Xq",
                                                       stan::model::index_uni(
                                                         3)) : 0))});
      y3_z2q_eps = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK2_len,
                                                             "bK2_len",
                                                             stan::model::index_uni(
                                                               3)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    2),
                                                                  stan::model::index_uni(
                                                                    3)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK2_len, "bK2_len",
                             stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                                  nrow_y_Xq,
                                                                  "nrow_y_Xq",
                                                                  stan::model::index_uni(
                                                                    3)) : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y3_z2q_eps_flat__;
        current_statement__ = 850;
        y3_z2q_eps_flat__ = context__.vals_r("y3_z2q_eps");
        current_statement__ = 850;
        pos__ = 1;
        current_statement__ = 850;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(2), stan::model::index_uni(3)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK2_len, "bK2_len",
                   stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                        nrow_y_Xq,
                                                        "nrow_y_Xq",
                                                        stan::model::index_uni(
                                                          3)) : 0); ++sym1__) {
          current_statement__ = 850;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(3)); ++sym2__) {
            current_statement__ = 850;
            stan::model::assign(y3_z2q_eps, y3_z2q_eps_flat__[(pos__ - 1)],
              "assigning variable y3_z2q_eps",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 850;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 851;
      stan::math::validate_non_negative_index("y1_z2q_id_eps",
        "assoc_uses[2, 1] == 1 && bK2_len[1] > 0 ? nrow_y_Xq[1] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(2), stan::model::index_uni(1)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 852;
      context__.validate_dims("data initialization", "y1_z2q_id_eps", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(2),
                                      stan::model::index_uni(1)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK2_len, "bK2_len",
                                    stan::model::index_uni(1)), 0))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(1)) : 0))});
      y1_z2q_id_eps = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(2),
                                               stan::model::index_uni(1)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK2_len, "bK2_len",
                              stan::model::index_uni(1)), 0))) ? stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    1)) : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 852;
      y1_z2q_id_eps = context__.vals_i("y1_z2q_id_eps");
      current_statement__ = 852;
      stan::math::check_greater_or_equal(function__, "y1_z2q_id_eps",
        y1_z2q_id_eps, 0);
      current_statement__ = 853;
      stan::math::validate_non_negative_index("y2_z2q_id_eps",
        "assoc_uses[2, 2] == 1 && bK2_len[2] > 0 ? nrow_y_Xq[2] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(2), stan::model::index_uni(2)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 854;
      context__.validate_dims("data initialization", "y2_z2q_id_eps", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(2),
                                      stan::model::index_uni(2)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK2_len, "bK2_len",
                                    stan::model::index_uni(2)), 0))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(2)) : 0))});
      y2_z2q_id_eps = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(2),
                                               stan::model::index_uni(2)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK2_len, "bK2_len",
                              stan::model::index_uni(2)), 0))) ? stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    2)) : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 854;
      y2_z2q_id_eps = context__.vals_i("y2_z2q_id_eps");
      current_statement__ = 854;
      stan::math::check_greater_or_equal(function__, "y2_z2q_id_eps",
        y2_z2q_id_eps, 0);
      current_statement__ = 855;
      stan::math::validate_non_negative_index("y3_z2q_id_eps",
        "assoc_uses[2, 3] == 1 && bK2_len[3] > 0 ? nrow_y_Xq[3] : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(2), stan::model::index_uni(3)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)),
            0))) ? stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 856;
      context__.validate_dims("data initialization", "y3_z2q_id_eps", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(2),
                                      stan::model::index_uni(3)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK2_len, "bK2_len",
                                    stan::model::index_uni(3)), 0))) ? 
                              stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                stan::model::index_uni(3)) : 0))});
      y3_z2q_id_eps = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(2),
                                               stan::model::index_uni(3)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK2_len, "bK2_len",
                              stan::model::index_uni(3)), 0))) ? stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    3)) : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 856;
      y3_z2q_id_eps = context__.vals_i("y3_z2q_id_eps");
      current_statement__ = 856;
      stan::math::check_greater_or_equal(function__, "y3_z2q_id_eps",
        y3_z2q_id_eps, 0);
      current_statement__ = 857;
      context__.validate_dims("data initialization", "auc_qnodes", "int",
        std::vector<size_t>{});
      auc_qnodes = std::numeric_limits<int>::min();
      current_statement__ = 857;
      auc_qnodes = context__.vals_i("auc_qnodes")[(1 - 1)];
      current_statement__ = 857;
      stan::math::check_greater_or_equal(function__, "auc_qnodes",
        auc_qnodes, 0);
      current_statement__ = 858;
      context__.validate_dims("data initialization", "nrow_y_Xq_auc", "int",
        std::vector<size_t>{});
      nrow_y_Xq_auc = std::numeric_limits<int>::min();
      current_statement__ = 858;
      nrow_y_Xq_auc = context__.vals_i("nrow_y_Xq_auc")[(1 - 1)];
      current_statement__ = 858;
      stan::math::check_greater_or_equal(function__, "nrow_y_Xq_auc",
        nrow_y_Xq_auc, 0);
      current_statement__ = 859;
      stan::math::validate_non_negative_index("auc_qwts",
        "sum(assoc_uses[3,  : ]) > 0 ? nrow_y_Xq_auc : 0",
        (stan::math::logical_gt(
           stan::math::sum(
             stan::model::rvalue(assoc_uses, "assoc_uses",
               stan::model::index_uni(3), stan::model::index_omni())), 0) ? nrow_y_Xq_auc : 0));
      current_statement__ = 860;
      context__.validate_dims("data initialization", "auc_qwts", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(
                                 stan::math::sum(
                                   stan::model::rvalue(assoc_uses,
                                     "assoc_uses", stan::model::index_uni(3),
                                     stan::model::index_omni())), 0) ? nrow_y_Xq_auc : 0))});
      auc_qwts_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                                stan::math::sum(
                                                                  stan::model::rvalue(
                                                                    assoc_uses,
                                                                    "assoc_uses",
                                                                    stan::model::index_uni(
                                                                    3),
                                                                    stan::model::index_omni(
                                                                    ))), 0) ? nrow_y_Xq_auc : 0),
                          std::numeric_limits<double>::quiet_NaN());
      new (&auc_qwts)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(auc_qwts_data__.data(),
        (stan::math::logical_gt(
           stan::math::sum(
             stan::model::rvalue(assoc_uses, "assoc_uses",
               stan::model::index_uni(3), stan::model::index_omni())), 0) ? nrow_y_Xq_auc : 0));
      {
        std::vector<local_scalar_t__> auc_qwts_flat__;
        current_statement__ = 860;
        auc_qwts_flat__ = context__.vals_r("auc_qwts");
        current_statement__ = 860;
        pos__ = 1;
        current_statement__ = 860;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(
                stan::math::sum(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(3), stan::model::index_omni())), 0) ? nrow_y_Xq_auc : 0); ++sym1__) {
          current_statement__ = 860;
          stan::model::assign(auc_qwts, auc_qwts_flat__[(pos__ - 1)],
            "assigning variable auc_qwts", stan::model::index_uni(sym1__));
          current_statement__ = 860;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 861;
      stan::math::validate_non_negative_index("y1_xq_auc",
        "assoc_uses[3, 1] == 1 ? nrow_y_Xq_auc : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(3), stan::model::index_uni(1)), 1) ? nrow_y_Xq_auc : 0));
      current_statement__ = 862;
      stan::math::validate_non_negative_index("y1_xq_auc", "yK[1]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      current_statement__ = 863;
      context__.validate_dims("data initialization", "y1_xq_auc", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(assoc_uses,
                                   "assoc_uses", stan::model::index_uni(3),
                                   stan::model::index_uni(1)), 1) ? nrow_y_Xq_auc : 0)),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(1)))});
      y1_xq_auc_data__ = Eigen::Matrix<double,-1,-1>::Constant((stan::math::logical_eq(
                                                                  stan::model::rvalue(
                                                                    assoc_uses,
                                                                    "assoc_uses",
                                                                    stan::model::index_uni(
                                                                    3),
                                                                    stan::model::index_uni(
                                                                    1)), 1) ? nrow_y_Xq_auc : 0),
                           stan::model::rvalue(yK, "yK",
                             stan::model::index_uni(1)),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y1_xq_auc)
        Eigen::Map<Eigen::Matrix<double,-1,-1>>(y1_xq_auc_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(3), stan::model::index_uni(1)), 1) ? nrow_y_Xq_auc : 0),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      {
        std::vector<local_scalar_t__> y1_xq_auc_flat__;
        current_statement__ = 863;
        y1_xq_auc_flat__ = context__.vals_r("y1_xq_auc");
        current_statement__ = 863;
        pos__ = 1;
        current_statement__ = 863;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(1)); ++sym1__) {
          current_statement__ = 863;
          for (int sym2__ = 1; sym2__ <=
               (stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(3), stan::model::index_uni(1)), 1) ? nrow_y_Xq_auc : 0); ++sym2__) {
            current_statement__ = 863;
            stan::model::assign(y1_xq_auc, y1_xq_auc_flat__[(pos__ - 1)],
              "assigning variable y1_xq_auc", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 863;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 864;
      stan::math::validate_non_negative_index("y2_xq_auc",
        "assoc_uses[3, 2] == 1 ? nrow_y_Xq_auc : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(3), stan::model::index_uni(2)), 1) ? nrow_y_Xq_auc : 0));
      current_statement__ = 865;
      stan::math::validate_non_negative_index("y2_xq_auc", "yK[2]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      current_statement__ = 866;
      context__.validate_dims("data initialization", "y2_xq_auc", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(assoc_uses,
                                   "assoc_uses", stan::model::index_uni(3),
                                   stan::model::index_uni(2)), 1) ? nrow_y_Xq_auc : 0)),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(2)))});
      y2_xq_auc_data__ = Eigen::Matrix<double,-1,-1>::Constant((stan::math::logical_eq(
                                                                  stan::model::rvalue(
                                                                    assoc_uses,
                                                                    "assoc_uses",
                                                                    stan::model::index_uni(
                                                                    3),
                                                                    stan::model::index_uni(
                                                                    2)), 1) ? nrow_y_Xq_auc : 0),
                           stan::model::rvalue(yK, "yK",
                             stan::model::index_uni(2)),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y2_xq_auc)
        Eigen::Map<Eigen::Matrix<double,-1,-1>>(y2_xq_auc_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(3), stan::model::index_uni(2)), 1) ? nrow_y_Xq_auc : 0),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      {
        std::vector<local_scalar_t__> y2_xq_auc_flat__;
        current_statement__ = 866;
        y2_xq_auc_flat__ = context__.vals_r("y2_xq_auc");
        current_statement__ = 866;
        pos__ = 1;
        current_statement__ = 866;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(2)); ++sym1__) {
          current_statement__ = 866;
          for (int sym2__ = 1; sym2__ <=
               (stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(3), stan::model::index_uni(2)), 1) ? nrow_y_Xq_auc : 0); ++sym2__) {
            current_statement__ = 866;
            stan::model::assign(y2_xq_auc, y2_xq_auc_flat__[(pos__ - 1)],
              "assigning variable y2_xq_auc", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 866;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 867;
      stan::math::validate_non_negative_index("y3_xq_auc",
        "assoc_uses[3, 3] == 1 ? nrow_y_Xq_auc : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(3), stan::model::index_uni(3)), 1) ? nrow_y_Xq_auc : 0));
      current_statement__ = 868;
      stan::math::validate_non_negative_index("y3_xq_auc", "yK[3]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      current_statement__ = 869;
      context__.validate_dims("data initialization", "y3_xq_auc", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(assoc_uses,
                                   "assoc_uses", stan::model::index_uni(3),
                                   stan::model::index_uni(3)), 1) ? nrow_y_Xq_auc : 0)),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(3)))});
      y3_xq_auc_data__ = Eigen::Matrix<double,-1,-1>::Constant((stan::math::logical_eq(
                                                                  stan::model::rvalue(
                                                                    assoc_uses,
                                                                    "assoc_uses",
                                                                    stan::model::index_uni(
                                                                    3),
                                                                    stan::model::index_uni(
                                                                    3)), 1) ? nrow_y_Xq_auc : 0),
                           stan::model::rvalue(yK, "yK",
                             stan::model::index_uni(3)),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y3_xq_auc)
        Eigen::Map<Eigen::Matrix<double,-1,-1>>(y3_xq_auc_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(assoc_uses, "assoc_uses",
             stan::model::index_uni(3), stan::model::index_uni(3)), 1) ? nrow_y_Xq_auc : 0),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      {
        std::vector<local_scalar_t__> y3_xq_auc_flat__;
        current_statement__ = 869;
        y3_xq_auc_flat__ = context__.vals_r("y3_xq_auc");
        current_statement__ = 869;
        pos__ = 1;
        current_statement__ = 869;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(3)); ++sym1__) {
          current_statement__ = 869;
          for (int sym2__ = 1; sym2__ <=
               (stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(3), stan::model::index_uni(3)), 1) ? nrow_y_Xq_auc : 0); ++sym2__) {
            current_statement__ = 869;
            stan::model::assign(y3_xq_auc, y3_xq_auc_flat__[(pos__ - 1)],
              "assigning variable y3_xq_auc", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 869;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 870;
      stan::math::validate_non_negative_index("y1_offset_auc",
        "has_offset[1] && assoc_uses[3, 1] == 1 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(1))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(3), stan::model::index_uni(1)), 1))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 871;
      context__.validate_dims("data initialization", "y1_offset_auc",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::model::rvalue(has_offset,
                                    "has_offset", stan::model::index_uni(1)))
                              &&
                              stan::math::primitive_value(
                                stan::math::logical_eq(
                                  stan::model::rvalue(assoc_uses,
                                    "assoc_uses", stan::model::index_uni(3),
                                    stan::model::index_uni(1)), 1))) ? nrow_y_Xq_auc : 0))});
      y1_offset_auc_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                    stan::model::rvalue(
                                                                    has_offset,
                                                                    "has_offset",
                                                                    stan::model::index_uni(
                                                                    1))) &&
                               stan::math::primitive_value(
                                 stan::math::logical_eq(
                                   stan::model::rvalue(assoc_uses,
                                     "assoc_uses", stan::model::index_uni(3),
                                     stan::model::index_uni(1)), 1))) ? nrow_y_Xq_auc : 0),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y1_offset_auc)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y1_offset_auc_data__.data(),
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(1))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(3), stan::model::index_uni(1)), 1))) ? nrow_y_Xq_auc : 0));
      {
        std::vector<local_scalar_t__> y1_offset_auc_flat__;
        current_statement__ = 871;
        y1_offset_auc_flat__ = context__.vals_r("y1_offset_auc");
        current_statement__ = 871;
        pos__ = 1;
        current_statement__ = 871;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::model::rvalue(has_offset, "has_offset",
                   stan::model::index_uni(1))) &&
             stan::math::primitive_value(
               stan::math::logical_eq(
                 stan::model::rvalue(assoc_uses, "assoc_uses",
                   stan::model::index_uni(3), stan::model::index_uni(1)), 1))) ? nrow_y_Xq_auc : 0); ++sym1__) {
          current_statement__ = 871;
          stan::model::assign(y1_offset_auc, y1_offset_auc_flat__[(pos__ -
            1)], "assigning variable y1_offset_auc",
            stan::model::index_uni(sym1__));
          current_statement__ = 871;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 872;
      stan::math::validate_non_negative_index("y2_offset_auc",
        "has_offset[2] && assoc_uses[3, 2] == 1 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(2))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(3), stan::model::index_uni(2)), 1))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 873;
      context__.validate_dims("data initialization", "y2_offset_auc",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::model::rvalue(has_offset,
                                    "has_offset", stan::model::index_uni(2)))
                              &&
                              stan::math::primitive_value(
                                stan::math::logical_eq(
                                  stan::model::rvalue(assoc_uses,
                                    "assoc_uses", stan::model::index_uni(3),
                                    stan::model::index_uni(2)), 1))) ? nrow_y_Xq_auc : 0))});
      y2_offset_auc_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                    stan::model::rvalue(
                                                                    has_offset,
                                                                    "has_offset",
                                                                    stan::model::index_uni(
                                                                    2))) &&
                               stan::math::primitive_value(
                                 stan::math::logical_eq(
                                   stan::model::rvalue(assoc_uses,
                                     "assoc_uses", stan::model::index_uni(3),
                                     stan::model::index_uni(2)), 1))) ? nrow_y_Xq_auc : 0),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y2_offset_auc)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y2_offset_auc_data__.data(),
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(2))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(3), stan::model::index_uni(2)), 1))) ? nrow_y_Xq_auc : 0));
      {
        std::vector<local_scalar_t__> y2_offset_auc_flat__;
        current_statement__ = 873;
        y2_offset_auc_flat__ = context__.vals_r("y2_offset_auc");
        current_statement__ = 873;
        pos__ = 1;
        current_statement__ = 873;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::model::rvalue(has_offset, "has_offset",
                   stan::model::index_uni(2))) &&
             stan::math::primitive_value(
               stan::math::logical_eq(
                 stan::model::rvalue(assoc_uses, "assoc_uses",
                   stan::model::index_uni(3), stan::model::index_uni(2)), 1))) ? nrow_y_Xq_auc : 0); ++sym1__) {
          current_statement__ = 873;
          stan::model::assign(y2_offset_auc, y2_offset_auc_flat__[(pos__ -
            1)], "assigning variable y2_offset_auc",
            stan::model::index_uni(sym1__));
          current_statement__ = 873;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 874;
      stan::math::validate_non_negative_index("y3_offset_auc",
        "has_offset[3] && assoc_uses[3, 3] == 1 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(3))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(3), stan::model::index_uni(3)), 1))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 875;
      context__.validate_dims("data initialization", "y3_offset_auc",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::model::rvalue(has_offset,
                                    "has_offset", stan::model::index_uni(3)))
                              &&
                              stan::math::primitive_value(
                                stan::math::logical_eq(
                                  stan::model::rvalue(assoc_uses,
                                    "assoc_uses", stan::model::index_uni(3),
                                    stan::model::index_uni(3)), 1))) ? nrow_y_Xq_auc : 0))});
      y3_offset_auc_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                    stan::model::rvalue(
                                                                    has_offset,
                                                                    "has_offset",
                                                                    stan::model::index_uni(
                                                                    3))) &&
                               stan::math::primitive_value(
                                 stan::math::logical_eq(
                                   stan::model::rvalue(assoc_uses,
                                     "assoc_uses", stan::model::index_uni(3),
                                     stan::model::index_uni(3)), 1))) ? nrow_y_Xq_auc : 0),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y3_offset_auc)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y3_offset_auc_data__.data(),
        ((stan::math::primitive_value(
            stan::model::rvalue(has_offset, "has_offset",
              stan::model::index_uni(3))) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(assoc_uses, "assoc_uses",
              stan::model::index_uni(3), stan::model::index_uni(3)), 1))) ? nrow_y_Xq_auc : 0));
      {
        std::vector<local_scalar_t__> y3_offset_auc_flat__;
        current_statement__ = 875;
        y3_offset_auc_flat__ = context__.vals_r("y3_offset_auc");
        current_statement__ = 875;
        pos__ = 1;
        current_statement__ = 875;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::model::rvalue(has_offset, "has_offset",
                   stan::model::index_uni(3))) &&
             stan::math::primitive_value(
               stan::math::logical_eq(
                 stan::model::rvalue(assoc_uses, "assoc_uses",
                   stan::model::index_uni(3), stan::model::index_uni(3)), 1))) ? nrow_y_Xq_auc : 0); ++sym1__) {
          current_statement__ = 875;
          stan::model::assign(y3_offset_auc, y3_offset_auc_flat__[(pos__ -
            1)], "assigning variable y3_offset_auc",
            stan::model::index_uni(sym1__));
          current_statement__ = 875;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 876;
      stan::math::validate_non_negative_index("y1_z1q_auc", "bK1_len[1]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)));
      current_statement__ = 877;
      stan::math::validate_non_negative_index("y1_z1q_auc",
        "assoc_uses[3, 1] == 1 && bK1_len[1] > 0 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(3), stan::model::index_uni(1)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)),
            0))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 878;
      context__.validate_dims("data initialization", "y1_z1q_auc", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(1))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(3), stan::model::index_uni(1)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(1)), 0))) ? nrow_y_Xq_auc : 0))});
      y1_z1q_auc = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK1_len,
                                                             "bK1_len",
                                                             stan::model::index_uni(
                                                               1)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    3),
                                                                  stan::model::index_uni(
                                                                    1)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK1_len, "bK1_len",
                             stan::model::index_uni(1)), 0))) ? nrow_y_Xq_auc : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y1_z1q_auc_flat__;
        current_statement__ = 878;
        y1_z1q_auc_flat__ = context__.vals_r("y1_z1q_auc");
        current_statement__ = 878;
        pos__ = 1;
        current_statement__ = 878;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(3), stan::model::index_uni(1)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK1_len, "bK1_len",
                   stan::model::index_uni(1)), 0))) ? nrow_y_Xq_auc : 0); ++sym1__) {
          current_statement__ = 878;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(1)); ++sym2__) {
            current_statement__ = 878;
            stan::model::assign(y1_z1q_auc, y1_z1q_auc_flat__[(pos__ - 1)],
              "assigning variable y1_z1q_auc",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 878;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 879;
      stan::math::validate_non_negative_index("y2_z1q_auc", "bK1_len[2]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)));
      current_statement__ = 880;
      stan::math::validate_non_negative_index("y2_z1q_auc",
        "assoc_uses[3, 2] == 1 && bK1_len[2] > 0 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(3), stan::model::index_uni(2)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)),
            0))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 881;
      context__.validate_dims("data initialization", "y2_z1q_auc", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(2))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(3), stan::model::index_uni(2)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(2)), 0))) ? nrow_y_Xq_auc : 0))});
      y2_z1q_auc = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK1_len,
                                                             "bK1_len",
                                                             stan::model::index_uni(
                                                               2)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    3),
                                                                  stan::model::index_uni(
                                                                    2)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK1_len, "bK1_len",
                             stan::model::index_uni(2)), 0))) ? nrow_y_Xq_auc : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y2_z1q_auc_flat__;
        current_statement__ = 881;
        y2_z1q_auc_flat__ = context__.vals_r("y2_z1q_auc");
        current_statement__ = 881;
        pos__ = 1;
        current_statement__ = 881;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(3), stan::model::index_uni(2)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK1_len, "bK1_len",
                   stan::model::index_uni(2)), 0))) ? nrow_y_Xq_auc : 0); ++sym1__) {
          current_statement__ = 881;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(2)); ++sym2__) {
            current_statement__ = 881;
            stan::model::assign(y2_z1q_auc, y2_z1q_auc_flat__[(pos__ - 1)],
              "assigning variable y2_z1q_auc",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 881;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 882;
      stan::math::validate_non_negative_index("y3_z1q_auc", "bK1_len[3]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)));
      current_statement__ = 883;
      stan::math::validate_non_negative_index("y3_z1q_auc",
        "assoc_uses[3, 3] == 1 && bK1_len[3] > 0 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(3), stan::model::index_uni(3)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)),
            0))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 884;
      context__.validate_dims("data initialization", "y3_z1q_auc", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(3))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(3), stan::model::index_uni(3)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(3)), 0))) ? nrow_y_Xq_auc : 0))});
      y3_z1q_auc = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK1_len,
                                                             "bK1_len",
                                                             stan::model::index_uni(
                                                               3)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    3),
                                                                  stan::model::index_uni(
                                                                    3)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK1_len, "bK1_len",
                             stan::model::index_uni(3)), 0))) ? nrow_y_Xq_auc : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y3_z1q_auc_flat__;
        current_statement__ = 884;
        y3_z1q_auc_flat__ = context__.vals_r("y3_z1q_auc");
        current_statement__ = 884;
        pos__ = 1;
        current_statement__ = 884;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(3), stan::model::index_uni(3)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK1_len, "bK1_len",
                   stan::model::index_uni(3)), 0))) ? nrow_y_Xq_auc : 0); ++sym1__) {
          current_statement__ = 884;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(3)); ++sym2__) {
            current_statement__ = 884;
            stan::model::assign(y3_z1q_auc, y3_z1q_auc_flat__[(pos__ - 1)],
              "assigning variable y3_z1q_auc",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 884;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 885;
      stan::math::validate_non_negative_index("y1_z1q_id_auc",
        "assoc_uses[3, 1] == 1 && bK1_len[1] > 0 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(3), stan::model::index_uni(1)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)),
            0))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 886;
      context__.validate_dims("data initialization", "y1_z1q_id_auc", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(3),
                                      stan::model::index_uni(1)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK1_len, "bK1_len",
                                    stan::model::index_uni(1)), 0))) ? nrow_y_Xq_auc : 0))});
      y1_z1q_id_auc = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(3),
                                               stan::model::index_uni(1)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK1_len, "bK1_len",
                              stan::model::index_uni(1)), 0))) ? nrow_y_Xq_auc : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 886;
      y1_z1q_id_auc = context__.vals_i("y1_z1q_id_auc");
      current_statement__ = 886;
      stan::math::check_greater_or_equal(function__, "y1_z1q_id_auc",
        y1_z1q_id_auc, 0);
      current_statement__ = 887;
      stan::math::validate_non_negative_index("y2_z1q_id_auc",
        "assoc_uses[3, 2] == 1 && bK1_len[2] > 0 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(3), stan::model::index_uni(2)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)),
            0))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 888;
      context__.validate_dims("data initialization", "y2_z1q_id_auc", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(3),
                                      stan::model::index_uni(2)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK1_len, "bK1_len",
                                    stan::model::index_uni(2)), 0))) ? nrow_y_Xq_auc : 0))});
      y2_z1q_id_auc = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(3),
                                               stan::model::index_uni(2)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK1_len, "bK1_len",
                              stan::model::index_uni(2)), 0))) ? nrow_y_Xq_auc : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 888;
      y2_z1q_id_auc = context__.vals_i("y2_z1q_id_auc");
      current_statement__ = 888;
      stan::math::check_greater_or_equal(function__, "y2_z1q_id_auc",
        y2_z1q_id_auc, 0);
      current_statement__ = 889;
      stan::math::validate_non_negative_index("y3_z1q_id_auc",
        "assoc_uses[3, 3] == 1 && bK1_len[3] > 0 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(3), stan::model::index_uni(3)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)),
            0))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 890;
      context__.validate_dims("data initialization", "y3_z1q_id_auc", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(3),
                                      stan::model::index_uni(3)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK1_len, "bK1_len",
                                    stan::model::index_uni(3)), 0))) ? nrow_y_Xq_auc : 0))});
      y3_z1q_id_auc = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(3),
                                               stan::model::index_uni(3)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK1_len, "bK1_len",
                              stan::model::index_uni(3)), 0))) ? nrow_y_Xq_auc : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 890;
      y3_z1q_id_auc = context__.vals_i("y3_z1q_id_auc");
      current_statement__ = 890;
      stan::math::check_greater_or_equal(function__, "y3_z1q_id_auc",
        y3_z1q_id_auc, 0);
      current_statement__ = 891;
      stan::math::validate_non_negative_index("y1_z2q_auc", "bK2_len[1]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)));
      current_statement__ = 892;
      stan::math::validate_non_negative_index("y1_z2q_auc",
        "assoc_uses[3, 1] == 1 && bK2_len[1] > 0 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(3), stan::model::index_uni(1)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)),
            0))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 893;
      context__.validate_dims("data initialization", "y1_z2q_auc", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(1))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(3), stan::model::index_uni(1)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(1)), 0))) ? nrow_y_Xq_auc : 0))});
      y1_z2q_auc = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK2_len,
                                                             "bK2_len",
                                                             stan::model::index_uni(
                                                               1)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    3),
                                                                  stan::model::index_uni(
                                                                    1)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK2_len, "bK2_len",
                             stan::model::index_uni(1)), 0))) ? nrow_y_Xq_auc : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y1_z2q_auc_flat__;
        current_statement__ = 893;
        y1_z2q_auc_flat__ = context__.vals_r("y1_z2q_auc");
        current_statement__ = 893;
        pos__ = 1;
        current_statement__ = 893;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(3), stan::model::index_uni(1)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK2_len, "bK2_len",
                   stan::model::index_uni(1)), 0))) ? nrow_y_Xq_auc : 0); ++sym1__) {
          current_statement__ = 893;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(1)); ++sym2__) {
            current_statement__ = 893;
            stan::model::assign(y1_z2q_auc, y1_z2q_auc_flat__[(pos__ - 1)],
              "assigning variable y1_z2q_auc",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 893;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 894;
      stan::math::validate_non_negative_index("y2_z2q_auc", "bK2_len[2]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)));
      current_statement__ = 895;
      stan::math::validate_non_negative_index("y2_z2q_auc",
        "assoc_uses[3, 2] == 1 && bK2_len[2] > 0 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(3), stan::model::index_uni(2)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)),
            0))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 896;
      context__.validate_dims("data initialization", "y2_z2q_auc", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(2))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(3), stan::model::index_uni(2)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(2)), 0))) ? nrow_y_Xq_auc : 0))});
      y2_z2q_auc = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK2_len,
                                                             "bK2_len",
                                                             stan::model::index_uni(
                                                               2)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    3),
                                                                  stan::model::index_uni(
                                                                    2)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK2_len, "bK2_len",
                             stan::model::index_uni(2)), 0))) ? nrow_y_Xq_auc : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y2_z2q_auc_flat__;
        current_statement__ = 896;
        y2_z2q_auc_flat__ = context__.vals_r("y2_z2q_auc");
        current_statement__ = 896;
        pos__ = 1;
        current_statement__ = 896;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(3), stan::model::index_uni(2)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK2_len, "bK2_len",
                   stan::model::index_uni(2)), 0))) ? nrow_y_Xq_auc : 0); ++sym1__) {
          current_statement__ = 896;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(2)); ++sym2__) {
            current_statement__ = 896;
            stan::model::assign(y2_z2q_auc, y2_z2q_auc_flat__[(pos__ - 1)],
              "assigning variable y2_z2q_auc",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 896;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 897;
      stan::math::validate_non_negative_index("y3_z2q_auc", "bK2_len[3]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)));
      current_statement__ = 898;
      stan::math::validate_non_negative_index("y3_z2q_auc",
        "assoc_uses[3, 3] == 1 && bK2_len[3] > 0 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(3), stan::model::index_uni(3)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)),
            0))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 899;
      context__.validate_dims("data initialization", "y3_z2q_auc", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(3))),
          static_cast<size_t>(
            ((stan::math::primitive_value(
                stan::math::logical_eq(
                  stan::model::rvalue(assoc_uses, "assoc_uses",
                    stan::model::index_uni(3), stan::model::index_uni(3)), 1))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(3)), 0))) ? nrow_y_Xq_auc : 0))});
      y3_z2q_auc = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                             bK2_len,
                                                             "bK2_len",
                                                             stan::model::index_uni(
                                                               3)),
                     Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                              stan::math::logical_eq(
                                                                stan::model::rvalue(
                                                                  assoc_uses,
                                                                  "assoc_uses",
                                                                  stan::model::index_uni(
                                                                    3),
                                                                  stan::model::index_uni(
                                                                    3)), 1))
                       &&
                       stan::math::primitive_value(
                         stan::math::logical_gt(
                           stan::model::rvalue(bK2_len, "bK2_len",
                             stan::model::index_uni(3)), 0))) ? nrow_y_Xq_auc : 0),
                       std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y3_z2q_auc_flat__;
        current_statement__ = 899;
        y3_z2q_auc_flat__ = context__.vals_r("y3_z2q_auc");
        current_statement__ = 899;
        pos__ = 1;
        current_statement__ = 899;
        for (int sym1__ = 1; sym1__ <=
             ((stan::math::primitive_value(
                 stan::math::logical_eq(
                   stan::model::rvalue(assoc_uses, "assoc_uses",
                     stan::model::index_uni(3), stan::model::index_uni(3)), 1))
             &&
             stan::math::primitive_value(
               stan::math::logical_gt(
                 stan::model::rvalue(bK2_len, "bK2_len",
                   stan::model::index_uni(3)), 0))) ? nrow_y_Xq_auc : 0); ++sym1__) {
          current_statement__ = 899;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(3)); ++sym2__) {
            current_statement__ = 899;
            stan::model::assign(y3_z2q_auc, y3_z2q_auc_flat__[(pos__ - 1)],
              "assigning variable y3_z2q_auc",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 899;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 900;
      stan::math::validate_non_negative_index("y1_z2q_id_auc",
        "assoc_uses[3, 1] == 1 && bK2_len[1] > 0 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(3), stan::model::index_uni(1)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)),
            0))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 901;
      context__.validate_dims("data initialization", "y1_z2q_id_auc", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(3),
                                      stan::model::index_uni(1)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK2_len, "bK2_len",
                                    stan::model::index_uni(1)), 0))) ? nrow_y_Xq_auc : 0))});
      y1_z2q_id_auc = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(3),
                                               stan::model::index_uni(1)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK2_len, "bK2_len",
                              stan::model::index_uni(1)), 0))) ? nrow_y_Xq_auc : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 901;
      y1_z2q_id_auc = context__.vals_i("y1_z2q_id_auc");
      current_statement__ = 901;
      stan::math::check_greater_or_equal(function__, "y1_z2q_id_auc",
        y1_z2q_id_auc, 0);
      current_statement__ = 902;
      stan::math::validate_non_negative_index("y2_z2q_id_auc",
        "assoc_uses[3, 2] == 1 && bK2_len[2] > 0 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(3), stan::model::index_uni(2)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)),
            0))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 903;
      context__.validate_dims("data initialization", "y2_z2q_id_auc", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(3),
                                      stan::model::index_uni(2)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK2_len, "bK2_len",
                                    stan::model::index_uni(2)), 0))) ? nrow_y_Xq_auc : 0))});
      y2_z2q_id_auc = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(3),
                                               stan::model::index_uni(2)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK2_len, "bK2_len",
                              stan::model::index_uni(2)), 0))) ? nrow_y_Xq_auc : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 903;
      y2_z2q_id_auc = context__.vals_i("y2_z2q_id_auc");
      current_statement__ = 903;
      stan::math::check_greater_or_equal(function__, "y2_z2q_id_auc",
        y2_z2q_id_auc, 0);
      current_statement__ = 904;
      stan::math::validate_non_negative_index("y3_z2q_id_auc",
        "assoc_uses[3, 3] == 1 && bK2_len[3] > 0 ? nrow_y_Xq_auc : 0",
        ((stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(assoc_uses, "assoc_uses",
                stan::model::index_uni(3), stan::model::index_uni(3)), 1)) &&
        stan::math::primitive_value(
          stan::math::logical_gt(
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)),
            0))) ? nrow_y_Xq_auc : 0));
      current_statement__ = 905;
      context__.validate_dims("data initialization", "y3_z2q_id_auc", "int",
        std::vector<size_t>{static_cast<size_t>(
                              ((stan::math::primitive_value(
                                  stan::math::logical_eq(
                                    stan::model::rvalue(assoc_uses,
                                      "assoc_uses",
                                      stan::model::index_uni(3),
                                      stan::model::index_uni(3)), 1)) &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(
                                  stan::model::rvalue(bK2_len, "bK2_len",
                                    stan::model::index_uni(3)), 0))) ? nrow_y_Xq_auc : 0))});
      y3_z2q_id_auc = std::vector<int>(((stan::math::primitive_value(
                                           stan::math::logical_eq(
                                             stan::model::rvalue(assoc_uses,
                                               "assoc_uses",
                                               stan::model::index_uni(3),
                                               stan::model::index_uni(3)), 1))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_gt(
                            stan::model::rvalue(bK2_len, "bK2_len",
                              stan::model::index_uni(3)), 0))) ? nrow_y_Xq_auc : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 905;
      y3_z2q_id_auc = context__.vals_i("y3_z2q_id_auc");
      current_statement__ = 905;
      stan::math::check_greater_or_equal(function__, "y3_z2q_id_auc",
        y3_z2q_id_auc, 0);
      current_statement__ = 906;
      stan::math::validate_non_negative_index("a_K_data", "M * 4", (M * 4));
      current_statement__ = 907;
      context__.validate_dims("data initialization", "a_K_data", "int",
        std::vector<size_t>{static_cast<size_t>((M * 4))});
      a_K_data = std::vector<int>((M * 4), std::numeric_limits<int>::min());
      current_statement__ = 907;
      a_K_data = context__.vals_i("a_K_data");
      current_statement__ = 907;
      stan::math::check_greater_or_equal(function__, "a_K_data", a_K_data, 0);
      current_statement__ = 907;
      stan::math::check_less_or_equal(function__, "a_K_data", a_K_data, a_K);
      current_statement__ = 908;
      stan::math::validate_non_negative_index("y_Xq_data",
        "sum(nrow_y_Xq[1 : M])",
        stan::math::sum(
          stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
            stan::model::index_min_max(1, M))));
      current_statement__ = 909;
      stan::math::validate_non_negative_index("y_Xq_data", "sum(a_K_data)",
        stan::math::sum(a_K_data));
      current_statement__ = 910;
      context__.validate_dims("data initialization", "y_Xq_data", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::math::sum(
                                stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                                  stan::model::index_min_max(1, M)))),
          static_cast<size_t>(stan::math::sum(a_K_data))});
      y_Xq_data_data__ = Eigen::Matrix<double,-1,-1>::Constant(stan::math::sum(
                                                                 stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_min_max(
                                                                    1, M))),
                           stan::math::sum(a_K_data),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y_Xq_data)
        Eigen::Map<Eigen::Matrix<double,-1,-1>>(y_Xq_data_data__.data(),
        stan::math::sum(
          stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
            stan::model::index_min_max(1, M))), stan::math::sum(a_K_data));
      {
        std::vector<local_scalar_t__> y_Xq_data_flat__;
        current_statement__ = 910;
        y_Xq_data_flat__ = context__.vals_r("y_Xq_data");
        current_statement__ = 910;
        pos__ = 1;
        current_statement__ = 910;
        for (int sym1__ = 1; sym1__ <= stan::math::sum(a_K_data); ++sym1__) {
          current_statement__ = 910;
          for (int sym2__ = 1; sym2__ <=
               stan::math::sum(
                 stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                   stan::model::index_min_max(1, M))); ++sym2__) {
            current_statement__ = 910;
            stan::model::assign(y_Xq_data, y_Xq_data_flat__[(pos__ - 1)],
              "assigning variable y_Xq_data", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 910;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 911;
      context__.validate_dims("data initialization", "idx_q", "int",
        std::vector<size_t>{static_cast<size_t>(3), static_cast<size_t>(2)});
      idx_q = std::vector<std::vector<int>>(3,
                std::vector<int>(2, std::numeric_limits<int>::min()));
      {
        std::vector<int> idx_q_flat__;
        current_statement__ = 911;
        idx_q_flat__ = context__.vals_i("idx_q");
        current_statement__ = 911;
        pos__ = 1;
        current_statement__ = 911;
        for (int sym1__ = 1; sym1__ <= 2; ++sym1__) {
          current_statement__ = 911;
          for (int sym2__ = 1; sym2__ <= 3; ++sym2__) {
            current_statement__ = 911;
            stan::model::assign(idx_q, idx_q_flat__[(pos__ - 1)],
              "assigning variable idx_q", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 911;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 911;
      stan::math::check_greater_or_equal(function__, "idx_q", idx_q, 0);
      current_statement__ = 912;
      stan::math::validate_non_negative_index("has_grp", "M", M);
      current_statement__ = 913;
      context__.validate_dims("data initialization", "has_grp", "int",
        std::vector<size_t>{static_cast<size_t>(M)});
      has_grp = std::vector<int>(M, std::numeric_limits<int>::min());
      current_statement__ = 913;
      has_grp = context__.vals_i("has_grp");
      current_statement__ = 913;
      stan::math::check_greater_or_equal(function__, "has_grp", has_grp, 0);
      current_statement__ = 913;
      stan::math::check_less_or_equal(function__, "has_grp", has_grp, 1);
      current_statement__ = 914;
      context__.validate_dims("data initialization", "grp_assoc", "int",
        std::vector<size_t>{});
      grp_assoc = std::numeric_limits<int>::min();
      current_statement__ = 914;
      grp_assoc = context__.vals_i("grp_assoc")[(1 - 1)];
      current_statement__ = 914;
      stan::math::check_greater_or_equal(function__, "grp_assoc", grp_assoc,
        0);
      current_statement__ = 914;
      stan::math::check_less_or_equal(function__, "grp_assoc", grp_assoc, 4);
      current_statement__ = 915;
      stan::math::validate_non_negative_index("grp_idx", "nrow_e_Xq",
        nrow_e_Xq);
      current_statement__ = 916;
      context__.validate_dims("data initialization", "grp_idx", "int",
        std::vector<size_t>{static_cast<size_t>(nrow_e_Xq),
          static_cast<size_t>(2)});
      grp_idx = std::vector<std::vector<int>>(nrow_e_Xq,
                  std::vector<int>(2, std::numeric_limits<int>::min()));
      {
        std::vector<int> grp_idx_flat__;
        current_statement__ = 916;
        grp_idx_flat__ = context__.vals_i("grp_idx");
        current_statement__ = 916;
        pos__ = 1;
        current_statement__ = 916;
        for (int sym1__ = 1; sym1__ <= 2; ++sym1__) {
          current_statement__ = 916;
          for (int sym2__ = 1; sym2__ <= nrow_e_Xq; ++sym2__) {
            current_statement__ = 916;
            stan::model::assign(grp_idx, grp_idx_flat__[(pos__ - 1)],
              "assigning variable grp_idx", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 916;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 916;
      stan::math::check_greater_or_equal(function__, "grp_idx", grp_idx, 0);
      current_statement__ = 917;
      stan::math::validate_non_negative_index("y_prior_mean1", "yK[1]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      current_statement__ = 918;
      context__.validate_dims("data initialization", "y_prior_mean1",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(1)))});
      y_prior_mean1_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                    yK, "yK",
                                                                    stan::model::index_uni(
                                                                    1)),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_mean1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_mean1_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      {
        std::vector<local_scalar_t__> y_prior_mean1_flat__;
        current_statement__ = 918;
        y_prior_mean1_flat__ = context__.vals_r("y_prior_mean1");
        current_statement__ = 918;
        pos__ = 1;
        current_statement__ = 918;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(1)); ++sym1__) {
          current_statement__ = 918;
          stan::model::assign(y_prior_mean1, y_prior_mean1_flat__[(pos__ -
            1)], "assigning variable y_prior_mean1",
            stan::model::index_uni(sym1__));
          current_statement__ = 918;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 919;
      stan::math::validate_non_negative_index("y_prior_mean2", "yK[2]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      current_statement__ = 920;
      context__.validate_dims("data initialization", "y_prior_mean2",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(2)))});
      y_prior_mean2_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                    yK, "yK",
                                                                    stan::model::index_uni(
                                                                    2)),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_mean2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_mean2_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      {
        std::vector<local_scalar_t__> y_prior_mean2_flat__;
        current_statement__ = 920;
        y_prior_mean2_flat__ = context__.vals_r("y_prior_mean2");
        current_statement__ = 920;
        pos__ = 1;
        current_statement__ = 920;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(2)); ++sym1__) {
          current_statement__ = 920;
          stan::model::assign(y_prior_mean2, y_prior_mean2_flat__[(pos__ -
            1)], "assigning variable y_prior_mean2",
            stan::model::index_uni(sym1__));
          current_statement__ = 920;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 921;
      stan::math::validate_non_negative_index("y_prior_mean3", "yK[3]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      current_statement__ = 922;
      context__.validate_dims("data initialization", "y_prior_mean3",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(3)))});
      y_prior_mean3_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                    yK, "yK",
                                                                    stan::model::index_uni(
                                                                    3)),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_mean3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_mean3_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      {
        std::vector<local_scalar_t__> y_prior_mean3_flat__;
        current_statement__ = 922;
        y_prior_mean3_flat__ = context__.vals_r("y_prior_mean3");
        current_statement__ = 922;
        pos__ = 1;
        current_statement__ = 922;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(3)); ++sym1__) {
          current_statement__ = 922;
          stan::model::assign(y_prior_mean3, y_prior_mean3_flat__[(pos__ -
            1)], "assigning variable y_prior_mean3",
            stan::model::index_uni(sym1__));
          current_statement__ = 922;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 923;
      stan::math::validate_non_negative_index("y_prior_scale1", "yK[1]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      current_statement__ = 924;
      context__.validate_dims("data initialization", "y_prior_scale1",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(1)))});
      y_prior_scale1_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                    yK, "yK",
                                                                    stan::model::index_uni(
                                                                    1)),
                                std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_scale1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_scale1_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      {
        std::vector<local_scalar_t__> y_prior_scale1_flat__;
        current_statement__ = 924;
        y_prior_scale1_flat__ = context__.vals_r("y_prior_scale1");
        current_statement__ = 924;
        pos__ = 1;
        current_statement__ = 924;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(1)); ++sym1__) {
          current_statement__ = 924;
          stan::model::assign(y_prior_scale1, y_prior_scale1_flat__[(pos__ -
            1)], "assigning variable y_prior_scale1",
            stan::model::index_uni(sym1__));
          current_statement__ = 924;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 924;
      stan::math::check_greater_or_equal(function__, "y_prior_scale1",
        y_prior_scale1, 0);
      current_statement__ = 925;
      stan::math::validate_non_negative_index("y_prior_scale2", "yK[2]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      current_statement__ = 926;
      context__.validate_dims("data initialization", "y_prior_scale2",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(2)))});
      y_prior_scale2_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                    yK, "yK",
                                                                    stan::model::index_uni(
                                                                    2)),
                                std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_scale2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_scale2_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      {
        std::vector<local_scalar_t__> y_prior_scale2_flat__;
        current_statement__ = 926;
        y_prior_scale2_flat__ = context__.vals_r("y_prior_scale2");
        current_statement__ = 926;
        pos__ = 1;
        current_statement__ = 926;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(2)); ++sym1__) {
          current_statement__ = 926;
          stan::model::assign(y_prior_scale2, y_prior_scale2_flat__[(pos__ -
            1)], "assigning variable y_prior_scale2",
            stan::model::index_uni(sym1__));
          current_statement__ = 926;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 926;
      stan::math::check_greater_or_equal(function__, "y_prior_scale2",
        y_prior_scale2, 0);
      current_statement__ = 927;
      stan::math::validate_non_negative_index("y_prior_scale3", "yK[3]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      current_statement__ = 928;
      context__.validate_dims("data initialization", "y_prior_scale3",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(3)))});
      y_prior_scale3_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                    yK, "yK",
                                                                    stan::model::index_uni(
                                                                    3)),
                                std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_scale3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_scale3_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      {
        std::vector<local_scalar_t__> y_prior_scale3_flat__;
        current_statement__ = 928;
        y_prior_scale3_flat__ = context__.vals_r("y_prior_scale3");
        current_statement__ = 928;
        pos__ = 1;
        current_statement__ = 928;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(3)); ++sym1__) {
          current_statement__ = 928;
          stan::model::assign(y_prior_scale3, y_prior_scale3_flat__[(pos__ -
            1)], "assigning variable y_prior_scale3",
            stan::model::index_uni(sym1__));
          current_statement__ = 928;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 928;
      stan::math::check_greater_or_equal(function__, "y_prior_scale3",
        y_prior_scale3, 0);
      current_statement__ = 929;
      stan::math::validate_non_negative_index("y_prior_df1", "yK[1]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      current_statement__ = 930;
      context__.validate_dims("data initialization", "y_prior_df1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(1)))});
      y_prior_df1_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                  yK, "yK",
                                                                  stan::model::index_uni(
                                                                    1)),
                             std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_df1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_df1_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      {
        std::vector<local_scalar_t__> y_prior_df1_flat__;
        current_statement__ = 930;
        y_prior_df1_flat__ = context__.vals_r("y_prior_df1");
        current_statement__ = 930;
        pos__ = 1;
        current_statement__ = 930;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(1)); ++sym1__) {
          current_statement__ = 930;
          stan::model::assign(y_prior_df1, y_prior_df1_flat__[(pos__ - 1)],
            "assigning variable y_prior_df1", stan::model::index_uni(sym1__));
          current_statement__ = 930;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 930;
      stan::math::check_greater_or_equal(function__, "y_prior_df1",
        y_prior_df1, 0);
      current_statement__ = 931;
      stan::math::validate_non_negative_index("y_prior_df2", "yK[2]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      current_statement__ = 932;
      context__.validate_dims("data initialization", "y_prior_df2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(2)))});
      y_prior_df2_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                  yK, "yK",
                                                                  stan::model::index_uni(
                                                                    2)),
                             std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_df2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_df2_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      {
        std::vector<local_scalar_t__> y_prior_df2_flat__;
        current_statement__ = 932;
        y_prior_df2_flat__ = context__.vals_r("y_prior_df2");
        current_statement__ = 932;
        pos__ = 1;
        current_statement__ = 932;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(2)); ++sym1__) {
          current_statement__ = 932;
          stan::model::assign(y_prior_df2, y_prior_df2_flat__[(pos__ - 1)],
            "assigning variable y_prior_df2", stan::model::index_uni(sym1__));
          current_statement__ = 932;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 932;
      stan::math::check_greater_or_equal(function__, "y_prior_df2",
        y_prior_df2, 0);
      current_statement__ = 933;
      stan::math::validate_non_negative_index("y_prior_df3", "yK[3]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      current_statement__ = 934;
      context__.validate_dims("data initialization", "y_prior_df3", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(3)))});
      y_prior_df3_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                  yK, "yK",
                                                                  stan::model::index_uni(
                                                                    3)),
                             std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_df3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_df3_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      {
        std::vector<local_scalar_t__> y_prior_df3_flat__;
        current_statement__ = 934;
        y_prior_df3_flat__ = context__.vals_r("y_prior_df3");
        current_statement__ = 934;
        pos__ = 1;
        current_statement__ = 934;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(3)); ++sym1__) {
          current_statement__ = 934;
          stan::model::assign(y_prior_df3, y_prior_df3_flat__[(pos__ - 1)],
            "assigning variable y_prior_df3", stan::model::index_uni(sym1__));
          current_statement__ = 934;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 934;
      stan::math::check_greater_or_equal(function__, "y_prior_df3",
        y_prior_df3, 0);
      current_statement__ = 935;
      stan::math::validate_non_negative_index("y_global_prior_df", "M", M);
      current_statement__ = 936;
      context__.validate_dims("data initialization", "y_global_prior_df",
        "double", std::vector<size_t>{static_cast<size_t>(M)});
      y_global_prior_df_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                   std::numeric_limits<double>::quiet_NaN());
      new (&y_global_prior_df)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_global_prior_df_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_global_prior_df_flat__;
        current_statement__ = 936;
        y_global_prior_df_flat__ = context__.vals_r("y_global_prior_df");
        current_statement__ = 936;
        pos__ = 1;
        current_statement__ = 936;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 936;
          stan::model::assign(y_global_prior_df,
            y_global_prior_df_flat__[(pos__ - 1)],
            "assigning variable y_global_prior_df",
            stan::model::index_uni(sym1__));
          current_statement__ = 936;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 936;
      stan::math::check_greater_or_equal(function__, "y_global_prior_df",
        y_global_prior_df, 0);
      current_statement__ = 937;
      stan::math::validate_non_negative_index("y_global_prior_scale", "M", M);
      current_statement__ = 938;
      context__.validate_dims("data initialization", "y_global_prior_scale",
        "double", std::vector<size_t>{static_cast<size_t>(M)});
      y_global_prior_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                      std::numeric_limits<double>::quiet_NaN());
      new (&y_global_prior_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_global_prior_scale_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_global_prior_scale_flat__;
        current_statement__ = 938;
        y_global_prior_scale_flat__ = context__.vals_r("y_global_prior_scale");
        current_statement__ = 938;
        pos__ = 1;
        current_statement__ = 938;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 938;
          stan::model::assign(y_global_prior_scale,
            y_global_prior_scale_flat__[(pos__ - 1)],
            "assigning variable y_global_prior_scale",
            stan::model::index_uni(sym1__));
          current_statement__ = 938;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 938;
      stan::math::check_greater_or_equal(function__, "y_global_prior_scale",
        y_global_prior_scale, 0);
      current_statement__ = 939;
      stan::math::validate_non_negative_index("y_slab_df", "M", M);
      current_statement__ = 940;
      context__.validate_dims("data initialization", "y_slab_df", "double",
        std::vector<size_t>{static_cast<size_t>(M)});
      y_slab_df_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                           std::numeric_limits<double>::quiet_NaN());
      new (&y_slab_df)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_slab_df_data__.data(), M);
      {
        std::vector<local_scalar_t__> y_slab_df_flat__;
        current_statement__ = 940;
        y_slab_df_flat__ = context__.vals_r("y_slab_df");
        current_statement__ = 940;
        pos__ = 1;
        current_statement__ = 940;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 940;
          stan::model::assign(y_slab_df, y_slab_df_flat__[(pos__ - 1)],
            "assigning variable y_slab_df", stan::model::index_uni(sym1__));
          current_statement__ = 940;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 940;
      stan::math::check_greater_or_equal(function__, "y_slab_df", y_slab_df,
        0);
      current_statement__ = 941;
      stan::math::validate_non_negative_index("y_slab_scale", "M", M);
      current_statement__ = 942;
      context__.validate_dims("data initialization", "y_slab_scale",
        "double", std::vector<size_t>{static_cast<size_t>(M)});
      y_slab_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                              std::numeric_limits<double>::quiet_NaN());
      new (&y_slab_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_slab_scale_data__.data(), M);
      {
        std::vector<local_scalar_t__> y_slab_scale_flat__;
        current_statement__ = 942;
        y_slab_scale_flat__ = context__.vals_r("y_slab_scale");
        current_statement__ = 942;
        pos__ = 1;
        current_statement__ = 942;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 942;
          stan::model::assign(y_slab_scale, y_slab_scale_flat__[(pos__ - 1)],
            "assigning variable y_slab_scale", stan::model::index_uni(sym1__));
          current_statement__ = 942;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 942;
      stan::math::check_greater_or_equal(function__, "y_slab_scale",
        y_slab_scale, 0);
      current_statement__ = 943;
      stan::math::validate_non_negative_index("y_prior_mean_for_intercept",
        "M", M);
      current_statement__ = 944;
      context__.validate_dims("data initialization",
        "y_prior_mean_for_intercept", "double",
        std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_mean_for_intercept_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                            std::numeric_limits<double>::quiet_NaN(
                                              ));
      new (&y_prior_mean_for_intercept)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_mean_for_intercept_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_prior_mean_for_intercept_flat__;
        current_statement__ = 944;
        y_prior_mean_for_intercept_flat__ = context__.vals_r("y_prior_mean_for_intercept");
        current_statement__ = 944;
        pos__ = 1;
        current_statement__ = 944;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 944;
          stan::model::assign(y_prior_mean_for_intercept,
            y_prior_mean_for_intercept_flat__[(pos__ - 1)],
            "assigning variable y_prior_mean_for_intercept",
            stan::model::index_uni(sym1__));
          current_statement__ = 944;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 945;
      stan::math::validate_non_negative_index("y_prior_scale_for_intercept",
        "M", M);
      current_statement__ = 946;
      context__.validate_dims("data initialization",
        "y_prior_scale_for_intercept", "double",
        std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_scale_for_intercept_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                             std::numeric_limits<double>::quiet_NaN(
                                               ));
      new (&y_prior_scale_for_intercept)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_scale_for_intercept_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_prior_scale_for_intercept_flat__;
        current_statement__ = 946;
        y_prior_scale_for_intercept_flat__ = context__.vals_r("y_prior_scale_for_intercept");
        current_statement__ = 946;
        pos__ = 1;
        current_statement__ = 946;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 946;
          stan::model::assign(y_prior_scale_for_intercept,
            y_prior_scale_for_intercept_flat__[(pos__ - 1)],
            "assigning variable y_prior_scale_for_intercept",
            stan::model::index_uni(sym1__));
          current_statement__ = 946;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 946;
      stan::math::check_greater_or_equal(function__,
        "y_prior_scale_for_intercept", y_prior_scale_for_intercept, 0);
      current_statement__ = 947;
      stan::math::validate_non_negative_index("y_prior_df_for_intercept",
        "M", M);
      current_statement__ = 948;
      context__.validate_dims("data initialization",
        "y_prior_df_for_intercept", "double",
        std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_df_for_intercept_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                          std::numeric_limits<double>::quiet_NaN(
                                            ));
      new (&y_prior_df_for_intercept)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_df_for_intercept_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_prior_df_for_intercept_flat__;
        current_statement__ = 948;
        y_prior_df_for_intercept_flat__ = context__.vals_r("y_prior_df_for_intercept");
        current_statement__ = 948;
        pos__ = 1;
        current_statement__ = 948;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 948;
          stan::model::assign(y_prior_df_for_intercept,
            y_prior_df_for_intercept_flat__[(pos__ - 1)],
            "assigning variable y_prior_df_for_intercept",
            stan::model::index_uni(sym1__));
          current_statement__ = 948;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 948;
      stan::math::check_greater_or_equal(function__,
        "y_prior_df_for_intercept", y_prior_df_for_intercept, 0);
      current_statement__ = 949;
      stan::math::validate_non_negative_index("y_prior_mean_for_aux", "M", M);
      current_statement__ = 950;
      context__.validate_dims("data initialization", "y_prior_mean_for_aux",
        "double", std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_mean_for_aux_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                      std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_mean_for_aux)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_mean_for_aux_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_prior_mean_for_aux_flat__;
        current_statement__ = 950;
        y_prior_mean_for_aux_flat__ = context__.vals_r("y_prior_mean_for_aux");
        current_statement__ = 950;
        pos__ = 1;
        current_statement__ = 950;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 950;
          stan::model::assign(y_prior_mean_for_aux,
            y_prior_mean_for_aux_flat__[(pos__ - 1)],
            "assigning variable y_prior_mean_for_aux",
            stan::model::index_uni(sym1__));
          current_statement__ = 950;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 950;
      stan::math::check_greater_or_equal(function__, "y_prior_mean_for_aux",
        y_prior_mean_for_aux, 0);
      current_statement__ = 951;
      stan::math::validate_non_negative_index("y_prior_scale_for_aux", "M", M);
      current_statement__ = 952;
      context__.validate_dims("data initialization", "y_prior_scale_for_aux",
        "double", std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_scale_for_aux_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                       std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_scale_for_aux)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_scale_for_aux_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_prior_scale_for_aux_flat__;
        current_statement__ = 952;
        y_prior_scale_for_aux_flat__ = context__.vals_r("y_prior_scale_for_aux");
        current_statement__ = 952;
        pos__ = 1;
        current_statement__ = 952;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 952;
          stan::model::assign(y_prior_scale_for_aux,
            y_prior_scale_for_aux_flat__[(pos__ - 1)],
            "assigning variable y_prior_scale_for_aux",
            stan::model::index_uni(sym1__));
          current_statement__ = 952;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 952;
      stan::math::check_greater_or_equal(function__, "y_prior_scale_for_aux",
        y_prior_scale_for_aux, 0);
      current_statement__ = 953;
      stan::math::validate_non_negative_index("y_prior_df_for_aux", "M", M);
      current_statement__ = 954;
      context__.validate_dims("data initialization", "y_prior_df_for_aux",
        "double", std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_df_for_aux_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                    std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_df_for_aux)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_df_for_aux_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_prior_df_for_aux_flat__;
        current_statement__ = 954;
        y_prior_df_for_aux_flat__ = context__.vals_r("y_prior_df_for_aux");
        current_statement__ = 954;
        pos__ = 1;
        current_statement__ = 954;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 954;
          stan::model::assign(y_prior_df_for_aux,
            y_prior_df_for_aux_flat__[(pos__ - 1)],
            "assigning variable y_prior_df_for_aux",
            stan::model::index_uni(sym1__));
          current_statement__ = 954;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 954;
      stan::math::check_greater_or_equal(function__, "y_prior_df_for_aux",
        y_prior_df_for_aux, 0);
      current_statement__ = 955;
      context__.validate_dims("data initialization", "len_concentration",
        "int", std::vector<size_t>{});
      len_concentration = std::numeric_limits<int>::min();
      current_statement__ = 955;
      len_concentration = context__.vals_i("len_concentration")[(1 - 1)];
      current_statement__ = 955;
      stan::math::check_greater_or_equal(function__, "len_concentration",
        len_concentration, 0);
      current_statement__ = 956;
      context__.validate_dims("data initialization", "len_regularization",
        "int", std::vector<size_t>{});
      len_regularization = std::numeric_limits<int>::min();
      current_statement__ = 956;
      len_regularization = context__.vals_i("len_regularization")[(1 - 1)];
      current_statement__ = 956;
      stan::math::check_greater_or_equal(function__, "len_regularization",
        len_regularization, 0);
      current_statement__ = 957;
      stan::math::validate_non_negative_index("b_prior_shape", "t", t);
      current_statement__ = 958;
      context__.validate_dims("data initialization", "b_prior_shape",
        "double", std::vector<size_t>{static_cast<size_t>(t)});
      b_prior_shape_data__ = Eigen::Matrix<double,-1,1>::Constant(t,
                               std::numeric_limits<double>::quiet_NaN());
      new (&b_prior_shape)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(b_prior_shape_data__.data(),
        t);
      {
        std::vector<local_scalar_t__> b_prior_shape_flat__;
        current_statement__ = 958;
        b_prior_shape_flat__ = context__.vals_r("b_prior_shape");
        current_statement__ = 958;
        pos__ = 1;
        current_statement__ = 958;
        for (int sym1__ = 1; sym1__ <= t; ++sym1__) {
          current_statement__ = 958;
          stan::model::assign(b_prior_shape, b_prior_shape_flat__[(pos__ -
            1)], "assigning variable b_prior_shape",
            stan::model::index_uni(sym1__));
          current_statement__ = 958;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 958;
      stan::math::check_greater_or_equal(function__, "b_prior_shape",
        b_prior_shape, 0);
      current_statement__ = 959;
      stan::math::validate_non_negative_index("b_prior_scale", "t", t);
      current_statement__ = 960;
      context__.validate_dims("data initialization", "b_prior_scale",
        "double", std::vector<size_t>{static_cast<size_t>(t)});
      b_prior_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(t,
                               std::numeric_limits<double>::quiet_NaN());
      new (&b_prior_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(b_prior_scale_data__.data(),
        t);
      {
        std::vector<local_scalar_t__> b_prior_scale_flat__;
        current_statement__ = 960;
        b_prior_scale_flat__ = context__.vals_r("b_prior_scale");
        current_statement__ = 960;
        pos__ = 1;
        current_statement__ = 960;
        for (int sym1__ = 1; sym1__ <= t; ++sym1__) {
          current_statement__ = 960;
          stan::model::assign(b_prior_scale, b_prior_scale_flat__[(pos__ -
            1)], "assigning variable b_prior_scale",
            stan::model::index_uni(sym1__));
          current_statement__ = 960;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 960;
      stan::math::check_greater_or_equal(function__, "b_prior_scale",
        b_prior_scale, 0);
      current_statement__ = 961;
      stan::math::validate_non_negative_index("b_prior_concentration",
        "len_concentration", len_concentration);
      current_statement__ = 962;
      context__.validate_dims("data initialization", "b_prior_concentration",
        "double",
        std::vector<size_t>{static_cast<size_t>(len_concentration)});
      b_prior_concentration = std::vector<double>(len_concentration,
                                std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 962;
      b_prior_concentration = context__.vals_r("b_prior_concentration");
      current_statement__ = 962;
      stan::math::check_greater_or_equal(function__, "b_prior_concentration",
        b_prior_concentration, 0);
      current_statement__ = 963;
      stan::math::validate_non_negative_index("b_prior_regularization",
        "len_regularization", len_regularization);
      current_statement__ = 964;
      context__.validate_dims("data initialization",
        "b_prior_regularization", "double",
        std::vector<size_t>{static_cast<size_t>(len_regularization)});
      b_prior_regularization = std::vector<double>(len_regularization,
                                 std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 964;
      b_prior_regularization = context__.vals_r("b_prior_regularization");
      current_statement__ = 964;
      stan::math::check_greater_or_equal(function__,
        "b_prior_regularization", b_prior_regularization, 0);
      current_statement__ = 965;
      stan::math::validate_non_negative_index("b1_prior_scale", "bK1", bK1);
      current_statement__ = 966;
      context__.validate_dims("data initialization", "b1_prior_scale",
        "double", std::vector<size_t>{static_cast<size_t>(bK1)});
      b1_prior_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(bK1,
                                std::numeric_limits<double>::quiet_NaN());
      new (&b1_prior_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(b1_prior_scale_data__.data(),
        bK1);
      {
        std::vector<local_scalar_t__> b1_prior_scale_flat__;
        current_statement__ = 966;
        b1_prior_scale_flat__ = context__.vals_r("b1_prior_scale");
        current_statement__ = 966;
        pos__ = 1;
        current_statement__ = 966;
        for (int sym1__ = 1; sym1__ <= bK1; ++sym1__) {
          current_statement__ = 966;
          stan::model::assign(b1_prior_scale, b1_prior_scale_flat__[(pos__ -
            1)], "assigning variable b1_prior_scale",
            stan::model::index_uni(sym1__));
          current_statement__ = 966;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 966;
      stan::math::check_greater_or_equal(function__, "b1_prior_scale",
        b1_prior_scale, 0);
      current_statement__ = 967;
      stan::math::validate_non_negative_index("b2_prior_scale", "bK2", bK2);
      current_statement__ = 968;
      context__.validate_dims("data initialization", "b2_prior_scale",
        "double", std::vector<size_t>{static_cast<size_t>(bK2)});
      b2_prior_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(bK2,
                                std::numeric_limits<double>::quiet_NaN());
      new (&b2_prior_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(b2_prior_scale_data__.data(),
        bK2);
      {
        std::vector<local_scalar_t__> b2_prior_scale_flat__;
        current_statement__ = 968;
        b2_prior_scale_flat__ = context__.vals_r("b2_prior_scale");
        current_statement__ = 968;
        pos__ = 1;
        current_statement__ = 968;
        for (int sym1__ = 1; sym1__ <= bK2; ++sym1__) {
          current_statement__ = 968;
          stan::model::assign(b2_prior_scale, b2_prior_scale_flat__[(pos__ -
            1)], "assigning variable b2_prior_scale",
            stan::model::index_uni(sym1__));
          current_statement__ = 968;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 968;
      stan::math::check_greater_or_equal(function__, "b2_prior_scale",
        b2_prior_scale, 0);
      current_statement__ = 969;
      stan::math::validate_non_negative_index("b1_prior_df", "bK1", bK1);
      current_statement__ = 970;
      context__.validate_dims("data initialization", "b1_prior_df", "double",
        std::vector<size_t>{static_cast<size_t>(bK1)});
      b1_prior_df_data__ = Eigen::Matrix<double,-1,1>::Constant(bK1,
                             std::numeric_limits<double>::quiet_NaN());
      new (&b1_prior_df)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(b1_prior_df_data__.data(),
        bK1);
      {
        std::vector<local_scalar_t__> b1_prior_df_flat__;
        current_statement__ = 970;
        b1_prior_df_flat__ = context__.vals_r("b1_prior_df");
        current_statement__ = 970;
        pos__ = 1;
        current_statement__ = 970;
        for (int sym1__ = 1; sym1__ <= bK1; ++sym1__) {
          current_statement__ = 970;
          stan::model::assign(b1_prior_df, b1_prior_df_flat__[(pos__ - 1)],
            "assigning variable b1_prior_df", stan::model::index_uni(sym1__));
          current_statement__ = 970;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 970;
      stan::math::check_greater_or_equal(function__, "b1_prior_df",
        b1_prior_df, 0);
      current_statement__ = 971;
      stan::math::validate_non_negative_index("b2_prior_df", "bK2", bK2);
      current_statement__ = 972;
      context__.validate_dims("data initialization", "b2_prior_df", "double",
        std::vector<size_t>{static_cast<size_t>(bK2)});
      b2_prior_df_data__ = Eigen::Matrix<double,-1,1>::Constant(bK2,
                             std::numeric_limits<double>::quiet_NaN());
      new (&b2_prior_df)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(b2_prior_df_data__.data(),
        bK2);
      {
        std::vector<local_scalar_t__> b2_prior_df_flat__;
        current_statement__ = 972;
        b2_prior_df_flat__ = context__.vals_r("b2_prior_df");
        current_statement__ = 972;
        pos__ = 1;
        current_statement__ = 972;
        for (int sym1__ = 1; sym1__ <= bK2; ++sym1__) {
          current_statement__ = 972;
          stan::model::assign(b2_prior_df, b2_prior_df_flat__[(pos__ - 1)],
            "assigning variable b2_prior_df", stan::model::index_uni(sym1__));
          current_statement__ = 972;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 972;
      stan::math::check_greater_or_equal(function__, "b2_prior_df",
        b2_prior_df, 0);
      current_statement__ = 973;
      context__.validate_dims("data initialization",
        "b1_prior_regularization", "double", std::vector<size_t>{});
      b1_prior_regularization = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 973;
      b1_prior_regularization = context__.vals_r("b1_prior_regularization")[(1
        - 1)];
      current_statement__ = 973;
      stan::math::check_greater_or_equal(function__,
        "b1_prior_regularization", b1_prior_regularization, 0);
      current_statement__ = 974;
      context__.validate_dims("data initialization",
        "b2_prior_regularization", "double", std::vector<size_t>{});
      b2_prior_regularization = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 974;
      b2_prior_regularization = context__.vals_r("b2_prior_regularization")[(1
        - 1)];
      current_statement__ = 974;
      stan::math::check_greater_or_equal(function__,
        "b2_prior_regularization", b2_prior_regularization, 0);
      current_statement__ = 975;
      stan::math::validate_non_negative_index("e_prior_mean", "e_K", e_K);
      current_statement__ = 976;
      context__.validate_dims("data initialization", "e_prior_mean",
        "double", std::vector<size_t>{static_cast<size_t>(e_K)});
      e_prior_mean_data__ = Eigen::Matrix<double,-1,1>::Constant(e_K,
                              std::numeric_limits<double>::quiet_NaN());
      new (&e_prior_mean)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(e_prior_mean_data__.data(),
        e_K);
      {
        std::vector<local_scalar_t__> e_prior_mean_flat__;
        current_statement__ = 976;
        e_prior_mean_flat__ = context__.vals_r("e_prior_mean");
        current_statement__ = 976;
        pos__ = 1;
        current_statement__ = 976;
        for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
          current_statement__ = 976;
          stan::model::assign(e_prior_mean, e_prior_mean_flat__[(pos__ - 1)],
            "assigning variable e_prior_mean", stan::model::index_uni(sym1__));
          current_statement__ = 976;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 977;
      context__.validate_dims("data initialization",
        "e_prior_mean_for_intercept", "double", std::vector<size_t>{});
      e_prior_mean_for_intercept = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 977;
      e_prior_mean_for_intercept = context__.vals_r("e_prior_mean_for_intercept")[(1
        - 1)];
      current_statement__ = 978;
      stan::math::validate_non_negative_index("e_prior_mean_for_aux",
        "basehaz_df", basehaz_df);
      current_statement__ = 979;
      context__.validate_dims("data initialization", "e_prior_mean_for_aux",
        "double", std::vector<size_t>{static_cast<size_t>(basehaz_df)});
      e_prior_mean_for_aux_data__ = Eigen::Matrix<double,-1,1>::Constant(basehaz_df,
                                      std::numeric_limits<double>::quiet_NaN());
      new (&e_prior_mean_for_aux)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(e_prior_mean_for_aux_data__.data(),
        basehaz_df);
      {
        std::vector<local_scalar_t__> e_prior_mean_for_aux_flat__;
        current_statement__ = 979;
        e_prior_mean_for_aux_flat__ = context__.vals_r("e_prior_mean_for_aux");
        current_statement__ = 979;
        pos__ = 1;
        current_statement__ = 979;
        for (int sym1__ = 1; sym1__ <= basehaz_df; ++sym1__) {
          current_statement__ = 979;
          stan::model::assign(e_prior_mean_for_aux,
            e_prior_mean_for_aux_flat__[(pos__ - 1)],
            "assigning variable e_prior_mean_for_aux",
            stan::model::index_uni(sym1__));
          current_statement__ = 979;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 980;
      stan::math::validate_non_negative_index("e_prior_scale", "e_K", e_K);
      current_statement__ = 981;
      context__.validate_dims("data initialization", "e_prior_scale",
        "double", std::vector<size_t>{static_cast<size_t>(e_K)});
      e_prior_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(e_K,
                               std::numeric_limits<double>::quiet_NaN());
      new (&e_prior_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(e_prior_scale_data__.data(),
        e_K);
      {
        std::vector<local_scalar_t__> e_prior_scale_flat__;
        current_statement__ = 981;
        e_prior_scale_flat__ = context__.vals_r("e_prior_scale");
        current_statement__ = 981;
        pos__ = 1;
        current_statement__ = 981;
        for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
          current_statement__ = 981;
          stan::model::assign(e_prior_scale, e_prior_scale_flat__[(pos__ -
            1)], "assigning variable e_prior_scale",
            stan::model::index_uni(sym1__));
          current_statement__ = 981;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 981;
      stan::math::check_greater_or_equal(function__, "e_prior_scale",
        e_prior_scale, 0);
      current_statement__ = 982;
      context__.validate_dims("data initialization",
        "e_prior_scale_for_intercept", "double", std::vector<size_t>{});
      e_prior_scale_for_intercept = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 982;
      e_prior_scale_for_intercept = context__.vals_r("e_prior_scale_for_intercept")[(1
        - 1)];
      current_statement__ = 982;
      stan::math::check_greater_or_equal(function__,
        "e_prior_scale_for_intercept", e_prior_scale_for_intercept, 0);
      current_statement__ = 983;
      stan::math::validate_non_negative_index("e_prior_scale_for_aux",
        "basehaz_df", basehaz_df);
      current_statement__ = 984;
      context__.validate_dims("data initialization", "e_prior_scale_for_aux",
        "double", std::vector<size_t>{static_cast<size_t>(basehaz_df)});
      e_prior_scale_for_aux_data__ = Eigen::Matrix<double,-1,1>::Constant(basehaz_df,
                                       std::numeric_limits<double>::quiet_NaN());
      new (&e_prior_scale_for_aux)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(e_prior_scale_for_aux_data__.data(),
        basehaz_df);
      {
        std::vector<local_scalar_t__> e_prior_scale_for_aux_flat__;
        current_statement__ = 984;
        e_prior_scale_for_aux_flat__ = context__.vals_r("e_prior_scale_for_aux");
        current_statement__ = 984;
        pos__ = 1;
        current_statement__ = 984;
        for (int sym1__ = 1; sym1__ <= basehaz_df; ++sym1__) {
          current_statement__ = 984;
          stan::model::assign(e_prior_scale_for_aux,
            e_prior_scale_for_aux_flat__[(pos__ - 1)],
            "assigning variable e_prior_scale_for_aux",
            stan::model::index_uni(sym1__));
          current_statement__ = 984;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 984;
      stan::math::check_greater_or_equal(function__, "e_prior_scale_for_aux",
        e_prior_scale_for_aux, 0);
      current_statement__ = 985;
      stan::math::validate_non_negative_index("e_prior_df", "e_K", e_K);
      current_statement__ = 986;
      context__.validate_dims("data initialization", "e_prior_df", "double",
        std::vector<size_t>{static_cast<size_t>(e_K)});
      e_prior_df_data__ = Eigen::Matrix<double,-1,1>::Constant(e_K,
                            std::numeric_limits<double>::quiet_NaN());
      new (&e_prior_df)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(e_prior_df_data__.data(), e_K);
      {
        std::vector<local_scalar_t__> e_prior_df_flat__;
        current_statement__ = 986;
        e_prior_df_flat__ = context__.vals_r("e_prior_df");
        current_statement__ = 986;
        pos__ = 1;
        current_statement__ = 986;
        for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
          current_statement__ = 986;
          stan::model::assign(e_prior_df, e_prior_df_flat__[(pos__ - 1)],
            "assigning variable e_prior_df", stan::model::index_uni(sym1__));
          current_statement__ = 986;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 986;
      stan::math::check_greater_or_equal(function__, "e_prior_df",
        e_prior_df, 0);
      current_statement__ = 987;
      context__.validate_dims("data initialization",
        "e_prior_df_for_intercept", "double", std::vector<size_t>{});
      e_prior_df_for_intercept = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 987;
      e_prior_df_for_intercept = context__.vals_r("e_prior_df_for_intercept")[(1
        - 1)];
      current_statement__ = 987;
      stan::math::check_greater_or_equal(function__,
        "e_prior_df_for_intercept", e_prior_df_for_intercept, 0);
      current_statement__ = 988;
      stan::math::validate_non_negative_index("e_prior_df_for_aux",
        "basehaz_df", basehaz_df);
      current_statement__ = 989;
      context__.validate_dims("data initialization", "e_prior_df_for_aux",
        "double", std::vector<size_t>{static_cast<size_t>(basehaz_df)});
      e_prior_df_for_aux_data__ = Eigen::Matrix<double,-1,1>::Constant(basehaz_df,
                                    std::numeric_limits<double>::quiet_NaN());
      new (&e_prior_df_for_aux)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(e_prior_df_for_aux_data__.data(),
        basehaz_df);
      {
        std::vector<local_scalar_t__> e_prior_df_for_aux_flat__;
        current_statement__ = 989;
        e_prior_df_for_aux_flat__ = context__.vals_r("e_prior_df_for_aux");
        current_statement__ = 989;
        pos__ = 1;
        current_statement__ = 989;
        for (int sym1__ = 1; sym1__ <= basehaz_df; ++sym1__) {
          current_statement__ = 989;
          stan::model::assign(e_prior_df_for_aux,
            e_prior_df_for_aux_flat__[(pos__ - 1)],
            "assigning variable e_prior_df_for_aux",
            stan::model::index_uni(sym1__));
          current_statement__ = 989;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 989;
      stan::math::check_greater_or_equal(function__, "e_prior_df_for_aux",
        e_prior_df_for_aux, 0);
      current_statement__ = 990;
      context__.validate_dims("data initialization", "e_global_prior_scale",
        "double", std::vector<size_t>{});
      e_global_prior_scale = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 990;
      e_global_prior_scale = context__.vals_r("e_global_prior_scale")[(1 -
        1)];
      current_statement__ = 990;
      stan::math::check_greater_or_equal(function__, "e_global_prior_scale",
        e_global_prior_scale, 0);
      current_statement__ = 991;
      context__.validate_dims("data initialization", "e_global_prior_df",
        "double", std::vector<size_t>{});
      e_global_prior_df = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 991;
      e_global_prior_df = context__.vals_r("e_global_prior_df")[(1 - 1)];
      current_statement__ = 991;
      stan::math::check_greater_or_equal(function__, "e_global_prior_df",
        e_global_prior_df, 0);
      current_statement__ = 992;
      context__.validate_dims("data initialization", "e_slab_df", "double",
        std::vector<size_t>{});
      e_slab_df = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 992;
      e_slab_df = context__.vals_r("e_slab_df")[(1 - 1)];
      current_statement__ = 992;
      stan::math::check_greater_or_equal(function__, "e_slab_df", e_slab_df,
        0);
      current_statement__ = 993;
      context__.validate_dims("data initialization", "e_slab_scale",
        "double", std::vector<size_t>{});
      e_slab_scale = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 993;
      e_slab_scale = context__.vals_r("e_slab_scale")[(1 - 1)];
      current_statement__ = 993;
      stan::math::check_greater_or_equal(function__, "e_slab_scale",
        e_slab_scale, 0);
      current_statement__ = 994;
      stan::math::validate_non_negative_index("a_prior_mean", "a_K", a_K);
      current_statement__ = 995;
      context__.validate_dims("data initialization", "a_prior_mean",
        "double", std::vector<size_t>{static_cast<size_t>(a_K)});
      a_prior_mean_data__ = Eigen::Matrix<double,-1,1>::Constant(a_K,
                              std::numeric_limits<double>::quiet_NaN());
      new (&a_prior_mean)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(a_prior_mean_data__.data(),
        a_K);
      {
        std::vector<local_scalar_t__> a_prior_mean_flat__;
        current_statement__ = 995;
        a_prior_mean_flat__ = context__.vals_r("a_prior_mean");
        current_statement__ = 995;
        pos__ = 1;
        current_statement__ = 995;
        for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
          current_statement__ = 995;
          stan::model::assign(a_prior_mean, a_prior_mean_flat__[(pos__ - 1)],
            "assigning variable a_prior_mean", stan::model::index_uni(sym1__));
          current_statement__ = 995;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 996;
      stan::math::validate_non_negative_index("a_prior_scale", "a_K", a_K);
      current_statement__ = 997;
      context__.validate_dims("data initialization", "a_prior_scale",
        "double", std::vector<size_t>{static_cast<size_t>(a_K)});
      a_prior_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(a_K,
                               std::numeric_limits<double>::quiet_NaN());
      new (&a_prior_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(a_prior_scale_data__.data(),
        a_K);
      {
        std::vector<local_scalar_t__> a_prior_scale_flat__;
        current_statement__ = 997;
        a_prior_scale_flat__ = context__.vals_r("a_prior_scale");
        current_statement__ = 997;
        pos__ = 1;
        current_statement__ = 997;
        for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
          current_statement__ = 997;
          stan::model::assign(a_prior_scale, a_prior_scale_flat__[(pos__ -
            1)], "assigning variable a_prior_scale",
            stan::model::index_uni(sym1__));
          current_statement__ = 997;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 997;
      stan::math::check_greater_or_equal(function__, "a_prior_scale",
        a_prior_scale, 0);
      current_statement__ = 998;
      stan::math::validate_non_negative_index("a_prior_df", "a_K", a_K);
      current_statement__ = 999;
      context__.validate_dims("data initialization", "a_prior_df", "double",
        std::vector<size_t>{static_cast<size_t>(a_K)});
      a_prior_df_data__ = Eigen::Matrix<double,-1,1>::Constant(a_K,
                            std::numeric_limits<double>::quiet_NaN());
      new (&a_prior_df)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(a_prior_df_data__.data(), a_K);
      {
        std::vector<local_scalar_t__> a_prior_df_flat__;
        current_statement__ = 999;
        a_prior_df_flat__ = context__.vals_r("a_prior_df");
        current_statement__ = 999;
        pos__ = 1;
        current_statement__ = 999;
        for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
          current_statement__ = 999;
          stan::model::assign(a_prior_df, a_prior_df_flat__[(pos__ - 1)],
            "assigning variable a_prior_df", stan::model::index_uni(sym1__));
          current_statement__ = 999;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 999;
      stan::math::check_greater_or_equal(function__, "a_prior_df",
        a_prior_df, 0);
      current_statement__ = 1000;
      context__.validate_dims("data initialization", "a_global_prior_scale",
        "double", std::vector<size_t>{});
      a_global_prior_scale = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 1000;
      a_global_prior_scale = context__.vals_r("a_global_prior_scale")[(1 -
        1)];
      current_statement__ = 1000;
      stan::math::check_greater_or_equal(function__, "a_global_prior_scale",
        a_global_prior_scale, 0);
      current_statement__ = 1001;
      context__.validate_dims("data initialization", "a_global_prior_df",
        "double", std::vector<size_t>{});
      a_global_prior_df = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 1001;
      a_global_prior_df = context__.vals_r("a_global_prior_df")[(1 - 1)];
      current_statement__ = 1001;
      stan::math::check_greater_or_equal(function__, "a_global_prior_df",
        a_global_prior_df, 0);
      current_statement__ = 1002;
      context__.validate_dims("data initialization", "a_slab_df", "double",
        std::vector<size_t>{});
      a_slab_df = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 1002;
      a_slab_df = context__.vals_r("a_slab_df")[(1 - 1)];
      current_statement__ = 1002;
      stan::math::check_greater_or_equal(function__, "a_slab_df", a_slab_df,
        0);
      current_statement__ = 1003;
      context__.validate_dims("data initialization", "a_slab_scale",
        "double", std::vector<size_t>{});
      a_slab_scale = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 1003;
      a_slab_scale = context__.vals_r("a_slab_scale")[(1 - 1)];
      current_statement__ = 1003;
      stan::math::check_greater_or_equal(function__, "a_slab_scale",
        a_slab_scale, 0);
      current_statement__ = 1004;
      e_hs = std::numeric_limits<int>::min();
      current_statement__ = 1004;
      e_hs = get_nvars_for_hs(e_prior_dist, pstream__);
      current_statement__ = 1005;
      a_hs = std::numeric_limits<int>::min();
      current_statement__ = 1005;
      a_hs = get_nvars_for_hs(a_prior_dist, pstream__);
      current_statement__ = 1006;
      yHs1 = std::numeric_limits<int>::min();
      current_statement__ = 1006;
      yHs1 = get_nvars_for_hs(
               (stan::math::logical_gt(M, 0) ? stan::model::rvalue(
                                                 y_prior_dist,
                                                 "y_prior_dist",
                                                 stan::model::index_uni(1)) : 0),
               pstream__);
      current_statement__ = 1007;
      yHs2 = std::numeric_limits<int>::min();
      current_statement__ = 1007;
      yHs2 = get_nvars_for_hs(
               (stan::math::logical_gt(M, 1) ? stan::model::rvalue(
                                                 y_prior_dist,
                                                 "y_prior_dist",
                                                 stan::model::index_uni(2)) : 0),
               pstream__);
      current_statement__ = 1008;
      yHs3 = std::numeric_limits<int>::min();
      current_statement__ = 1008;
      yHs3 = get_nvars_for_hs(
               (stan::math::logical_gt(M, 2) ? stan::model::rvalue(
                                                 y_prior_dist,
                                                 "y_prior_dist",
                                                 stan::model::index_uni(3)) : 0),
               pstream__);
      current_statement__ = 1009;
      len_z_T = std::numeric_limits<int>::min();
      current_statement__ = 1009;
      len_z_T = 0;
      current_statement__ = 1010;
      len_var_group = std::numeric_limits<int>::min();
      current_statement__ = 1010;
      len_var_group = (stan::math::sum(p) * stan::math::logical_gt(t, 0));
      current_statement__ = 1011;
      len_rho = std::numeric_limits<int>::min();
      current_statement__ = 1011;
      len_rho = (stan::math::sum(p) - t);
      current_statement__ = 1012;
      pos = std::numeric_limits<int>::min();
      current_statement__ = 1012;
      pos = 1;
      current_statement__ = 1013;
      stan::math::validate_non_negative_index("delta", "len_concentration",
        len_concentration);
      current_statement__ = 1014;
      delta = std::vector<double>(len_concentration,
                std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 1015;
      stan::math::validate_non_negative_index("bCov1_idx",
        "prior_dist_for_cov == 2 ? (bK1 + choose(bK1, 2)) : 0",
        (stan::math::logical_eq(prior_dist_for_cov, 2) ? (bK1 +
        stan::math::choose(bK1, 2)) : 0));
      current_statement__ = 1016;
      bCov1_idx = std::vector<int>((stan::math::logical_eq(
                                      prior_dist_for_cov, 2) ? (bK1 +
                    stan::math::choose(bK1, 2)) : 0),
                    std::numeric_limits<int>::min());
      current_statement__ = 1017;
      stan::math::validate_non_negative_index("bCov2_idx",
        "prior_dist_for_cov == 2 ? (bK2 + choose(bK2, 2)) : 0",
        (stan::math::logical_eq(prior_dist_for_cov, 2) ? (bK2 +
        stan::math::choose(bK2, 2)) : 0));
      current_statement__ = 1018;
      bCov2_idx = std::vector<int>((stan::math::logical_eq(
                                      prior_dist_for_cov, 2) ? (bK2 +
                    stan::math::choose(bK2, 2)) : 0),
                    std::numeric_limits<int>::min());
      current_statement__ = 1019;
      sum_log_y1 = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 1019;
      sum_log_y1 = ((stan::math::primitive_value(stan::math::logical_gt(M, 0))
        &&
        stan::math::primitive_value(
          (stan::math::primitive_value(
             stan::math::logical_eq(
               stan::model::rvalue(family, "family",
                 stan::model::index_uni(1)), 2)) ||
          stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(family, "family", stan::model::index_uni(1)),
              3))))) ? stan::math::sum(stan::math::log(yReal1)) : stan::math::not_a_number(
                                                                    ));
      current_statement__ = 1020;
      sum_log_y2 = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 1020;
      sum_log_y2 = ((stan::math::primitive_value(stan::math::logical_gt(M, 1))
        &&
        stan::math::primitive_value(
          (stan::math::primitive_value(
             stan::math::logical_eq(
               stan::model::rvalue(family, "family",
                 stan::model::index_uni(2)), 2)) ||
          stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(family, "family", stan::model::index_uni(2)),
              3))))) ? stan::math::sum(stan::math::log(yReal2)) : stan::math::not_a_number(
                                                                    ));
      current_statement__ = 1021;
      sum_log_y3 = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 1021;
      sum_log_y3 = ((stan::math::primitive_value(stan::math::logical_gt(M, 2))
        &&
        stan::math::primitive_value(
          (stan::math::primitive_value(
             stan::math::logical_eq(
               stan::model::rvalue(family, "family",
                 stan::model::index_uni(3)), 2)) ||
          stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(family, "family", stan::model::index_uni(3)),
              3))))) ? stan::math::sum(stan::math::log(yReal3)) : stan::math::not_a_number(
                                                                    ));
      current_statement__ = 1022;
      stan::math::validate_non_negative_index("sqrt_y1",
        "M > 0 && family[1] == 3 ? yNobs[1] : 0",
        ((stan::math::primitive_value(stan::math::logical_gt(M, 0)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(1)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 1023;
      sqrt_y1_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                stan::math::logical_gt(
                                                                  M, 0)) &&
                         stan::math::primitive_value(
                           stan::math::logical_eq(
                             stan::model::rvalue(family, "family",
                               stan::model::index_uni(1)), 3))) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    1)) : 0),
                         std::numeric_limits<double>::quiet_NaN());
      new (&sqrt_y1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(sqrt_y1_data__.data(),
        ((stan::math::primitive_value(stan::math::logical_gt(M, 0)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(1)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 1024;
      stan::math::validate_non_negative_index("sqrt_y2",
        "M > 1 && family[2] == 3 ? yNobs[2] : 0",
        ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(2)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 1025;
      sqrt_y2_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                stan::math::logical_gt(
                                                                  M, 1)) &&
                         stan::math::primitive_value(
                           stan::math::logical_eq(
                             stan::model::rvalue(family, "family",
                               stan::model::index_uni(2)), 3))) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    2)) : 0),
                         std::numeric_limits<double>::quiet_NaN());
      new (&sqrt_y2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(sqrt_y2_data__.data(),
        ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(2)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 1026;
      stan::math::validate_non_negative_index("sqrt_y3",
        "M > 2 && family[3] == 3 ? yNobs[3] : 0",
        ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(3)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 1027;
      sqrt_y3_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                stan::math::logical_gt(
                                                                  M, 2)) &&
                         stan::math::primitive_value(
                           stan::math::logical_eq(
                             stan::model::rvalue(family, "family",
                               stan::model::index_uni(3)), 3))) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    3)) : 0),
                         std::numeric_limits<double>::quiet_NaN());
      new (&sqrt_y3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(sqrt_y3_data__.data(),
        ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(3)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 1028;
      stan::math::validate_non_negative_index("log_y1",
        "M > 0 && family[1] == 3 ? yNobs[1] : 0",
        ((stan::math::primitive_value(stan::math::logical_gt(M, 0)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(1)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 1029;
      log_y1_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                               stan::math::logical_gt(
                                                                 M, 0)) &&
                        stan::math::primitive_value(
                          stan::math::logical_eq(
                            stan::model::rvalue(family, "family",
                              stan::model::index_uni(1)), 3))) ? stan::model::rvalue(
                                                                   yNobs,
                                                                   "yNobs",
                                                                   stan::model::index_uni(
                                                                    1)) : 0),
                        std::numeric_limits<double>::quiet_NaN());
      new (&log_y1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(log_y1_data__.data(),
        ((stan::math::primitive_value(stan::math::logical_gt(M, 0)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(1)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 1030;
      stan::math::validate_non_negative_index("log_y2",
        "M > 1 && family[2] == 3 ? yNobs[2] : 0",
        ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(2)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 1031;
      log_y2_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                               stan::math::logical_gt(
                                                                 M, 1)) &&
                        stan::math::primitive_value(
                          stan::math::logical_eq(
                            stan::model::rvalue(family, "family",
                              stan::model::index_uni(2)), 3))) ? stan::model::rvalue(
                                                                   yNobs,
                                                                   "yNobs",
                                                                   stan::model::index_uni(
                                                                    2)) : 0),
                        std::numeric_limits<double>::quiet_NaN());
      new (&log_y2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(log_y2_data__.data(),
        ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(2)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 1032;
      stan::math::validate_non_negative_index("log_y3",
        "M > 2 && family[3] == 3 ? yNobs[3] : 0",
        ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(3)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 1033;
      log_y3_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                               stan::math::logical_gt(
                                                                 M, 2)) &&
                        stan::math::primitive_value(
                          stan::math::logical_eq(
                            stan::model::rvalue(family, "family",
                              stan::model::index_uni(3)), 3))) ? stan::model::rvalue(
                                                                   yNobs,
                                                                   "yNobs",
                                                                   stan::model::index_uni(
                                                                    3)) : 0),
                        std::numeric_limits<double>::quiet_NaN());
      new (&log_y3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(log_y3_data__.data(),
        ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(3)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 1037;
      if ((stan::math::primitive_value(stan::math::logical_gt(M, 0)) &&
          stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(family, "family", stan::model::index_uni(1)),
              3)))) {
        current_statement__ = 1034;
        stan::model::assign(sqrt_y1, stan::math::sqrt(yReal1),
          "assigning variable sqrt_y1");
        current_statement__ = 1035;
        stan::model::assign(log_y1, stan::math::log(yReal1),
          "assigning variable log_y1");
      }
      current_statement__ = 1041;
      if ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
          stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(family, "family", stan::model::index_uni(2)),
              3)))) {
        current_statement__ = 1038;
        stan::model::assign(sqrt_y2, stan::math::sqrt(yReal2),
          "assigning variable sqrt_y2");
        current_statement__ = 1039;
        stan::model::assign(log_y2, stan::math::log(yReal2),
          "assigning variable log_y2");
      }
      current_statement__ = 1045;
      if ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
          stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(family, "family", stan::model::index_uni(3)),
              3)))) {
        current_statement__ = 1042;
        stan::model::assign(sqrt_y3, stan::math::sqrt(yReal3),
          "assigning variable sqrt_y3");
        current_statement__ = 1043;
        stan::model::assign(log_y3, stan::math::log(yReal3),
          "assigning variable log_y3");
      }
      current_statement__ = 1057;
      if (stan::math::logical_eq(prior_dist_for_cov, 1)) {
        current_statement__ = 1055;
        for (int i = 1; i <= t; ++i) {
          current_statement__ = 1051;
          if (stan::math::logical_gt(
                stan::model::rvalue(p, "p", stan::model::index_uni(i)), 1)) {
            current_statement__ = 1049;
            for (int j = 1; j <=
                 stan::model::rvalue(p, "p", stan::model::index_uni(i)); ++j) {
              current_statement__ = 1046;
              stan::model::assign(delta,
                stan::model::rvalue(b_prior_concentration,
                  "b_prior_concentration", stan::model::index_uni(j)),
                "assigning variable delta", stan::model::index_uni(pos));
              current_statement__ = 1047;
              pos = (pos + 1);
            }
          }
          current_statement__ = 1053;
          for (int j = 3; j <=
               stan::model::rvalue(p, "p", stan::model::index_uni(i)); ++j) {
            current_statement__ = 1052;
            len_z_T = (len_z_T +
              (stan::model::rvalue(p, "p", stan::model::index_uni(i)) - 1));
          }
        }
      }
      current_statement__ = 1063;
      if (stan::math::logical_eq(prior_dist_for_cov, 2)) {
        current_statement__ = 1059;
        if (stan::math::logical_gt(bK1, 0)) {
          current_statement__ = 1058;
          stan::model::assign(bCov1_idx, lower_tri_indices(bK1, pstream__),
            "assigning variable bCov1_idx");
        }
        current_statement__ = 1061;
        if (stan::math::logical_gt(bK2, 0)) {
          current_statement__ = 1060;
          stan::model::assign(bCov2_idx, lower_tri_indices(bK2, pstream__),
            "assigning variable bCov2_idx");
        }
      }
      current_statement__ = 1004;
      stan::math::check_greater_or_equal(function__, "e_hs", e_hs, 0);
      current_statement__ = 1005;
      stan::math::check_greater_or_equal(function__, "a_hs", a_hs, 0);
      current_statement__ = 1006;
      stan::math::check_greater_or_equal(function__, "yHs1", yHs1, 0);
      current_statement__ = 1007;
      stan::math::check_greater_or_equal(function__, "yHs2", yHs2, 0);
      current_statement__ = 1008;
      stan::math::check_greater_or_equal(function__, "yHs3", yHs3, 0);
      current_statement__ = 1009;
      stan::math::check_greater_or_equal(function__, "len_z_T", len_z_T, 0);
      current_statement__ = 1010;
      stan::math::check_greater_or_equal(function__, "len_var_group",
        len_var_group, 0);
      current_statement__ = 1011;
      stan::math::check_greater_or_equal(function__, "len_rho", len_rho, 0);
      current_statement__ = 1012;
      stan::math::check_greater_or_equal(function__, "pos", pos, 1);
      current_statement__ = 1014;
      stan::math::check_greater_or_equal(function__, "delta", delta, 0);
      current_statement__ = 1064;
      yGamma1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1064;
      yGamma1_1dim__ = stan::math::logical_gt(
                         stan::model::rvalue(intercept_type,
                           "intercept_type", stan::model::index_uni(1)), 0);
      current_statement__ = 1064;
      stan::math::validate_non_negative_index("yGamma1",
        "intercept_type[1] > 0", yGamma1_1dim__);
      current_statement__ = 1065;
      yGamma2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1065;
      yGamma2_1dim__ = stan::math::logical_gt(
                         stan::model::rvalue(intercept_type,
                           "intercept_type", stan::model::index_uni(2)), 0);
      current_statement__ = 1065;
      stan::math::validate_non_negative_index("yGamma2",
        "intercept_type[2] > 0", yGamma2_1dim__);
      current_statement__ = 1066;
      yGamma3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1066;
      yGamma3_1dim__ = stan::math::logical_gt(
                         stan::model::rvalue(intercept_type,
                           "intercept_type", stan::model::index_uni(3)), 0);
      current_statement__ = 1066;
      stan::math::validate_non_negative_index("yGamma3",
        "intercept_type[3] > 0", yGamma3_1dim__);
      current_statement__ = 1067;
      z_yBeta1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1067;
      z_yBeta1_1dim__ = stan::model::rvalue(yK, "yK",
                          stan::model::index_uni(1));
      current_statement__ = 1067;
      stan::math::validate_non_negative_index("z_yBeta1", "yK[1]",
        z_yBeta1_1dim__);
      current_statement__ = 1068;
      z_yBeta2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1068;
      z_yBeta2_1dim__ = stan::model::rvalue(yK, "yK",
                          stan::model::index_uni(2));
      current_statement__ = 1068;
      stan::math::validate_non_negative_index("z_yBeta2", "yK[2]",
        z_yBeta2_1dim__);
      current_statement__ = 1069;
      z_yBeta3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1069;
      z_yBeta3_1dim__ = stan::model::rvalue(yK, "yK",
                          stan::model::index_uni(3));
      current_statement__ = 1069;
      stan::math::validate_non_negative_index("z_yBeta3", "yK[3]",
        z_yBeta3_1dim__);
      current_statement__ = 1070;
      z_b_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1070;
      z_b_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 1) ? q : 0);
      current_statement__ = 1070;
      stan::math::validate_non_negative_index("z_b",
        "prior_dist_for_cov == 1 ? q : 0", z_b_1dim__);
      current_statement__ = 1071;
      z_T_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1071;
      z_T_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 1) ? len_z_T : 0);
      current_statement__ = 1071;
      stan::math::validate_non_negative_index("z_T",
        "prior_dist_for_cov == 1 ? len_z_T : 0", z_T_1dim__);
      current_statement__ = 1072;
      rho_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1072;
      rho_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 1) ? len_rho : 0);
      current_statement__ = 1072;
      stan::math::validate_non_negative_index("rho",
        "prior_dist_for_cov == 1 ? len_rho : 0", rho_1dim__);
      current_statement__ = 1073;
      zeta_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1073;
      zeta_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 1) ? len_concentration : 0);
      current_statement__ = 1073;
      stan::math::validate_non_negative_index("zeta",
        "prior_dist_for_cov == 1 ? len_concentration : 0", zeta_1dim__);
      current_statement__ = 1074;
      tau_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1074;
      tau_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 1) ? t : 0);
      current_statement__ = 1074;
      stan::math::validate_non_negative_index("tau",
        "prior_dist_for_cov == 1 ? t : 0", tau_1dim__);
      current_statement__ = 1075;
      bSd1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1075;
      bSd1_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 2) ? bK1 : 0);
      current_statement__ = 1075;
      stan::math::validate_non_negative_index("bSd1",
        "prior_dist_for_cov == 2 ? bK1 : 0", bSd1_1dim__);
      current_statement__ = 1076;
      z_bMat1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1076;
      z_bMat1_1dim__ = ((stan::math::primitive_value(
                           stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK1, 0))) ? bK1 : 0);
      current_statement__ = 1076;
      stan::math::validate_non_negative_index("z_bMat1",
        "prior_dist_for_cov == 2 && bK1 > 0 ? bK1 : 0", z_bMat1_1dim__);
      current_statement__ = 1077;
      z_bMat1_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1077;
      z_bMat1_2dim__ = (stan::math::logical_gt(bK1, 0) ? bN1 : 0);
      current_statement__ = 1077;
      stan::math::validate_non_negative_index("z_bMat1", "bK1 > 0 ? bN1 : 0",
        z_bMat1_2dim__);
      current_statement__ = 1078;
      bCholesky1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1078;
      bCholesky1_1dim__ = ((stan::math::primitive_value(
                              stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK1, 1))) ? bK1 : 0);
      current_statement__ = 1078;
      stan::math::validate_non_negative_index("bCholesky1",
        "prior_dist_for_cov == 2 && bK1 > 1 ? bK1 : 0", bCholesky1_1dim__);
      current_statement__ = 1078;
      bCholesky1_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1078;
      bCholesky1_2dim__ = ((stan::math::primitive_value(
                              stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK1, 1))) ? bK1 : 0);
      current_statement__ = 1078;
      stan::math::validate_non_negative_index("bCholesky1",
        "prior_dist_for_cov == 2 && bK1 > 1 ? bK1 : 0", bCholesky1_2dim__);
      current_statement__ = 1079;
      bSd2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1079;
      bSd2_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 2) ? bK2 : 0);
      current_statement__ = 1079;
      stan::math::validate_non_negative_index("bSd2",
        "prior_dist_for_cov == 2 ? bK2 : 0", bSd2_1dim__);
      current_statement__ = 1080;
      z_bMat2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1080;
      z_bMat2_1dim__ = ((stan::math::primitive_value(
                           stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK2, 0))) ? bK2 : 0);
      current_statement__ = 1080;
      stan::math::validate_non_negative_index("z_bMat2",
        "prior_dist_for_cov == 2 && bK2 > 0 ? bK2 : 0", z_bMat2_1dim__);
      current_statement__ = 1081;
      z_bMat2_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1081;
      z_bMat2_2dim__ = (stan::math::logical_gt(bK2, 0) ? bN2 : 0);
      current_statement__ = 1081;
      stan::math::validate_non_negative_index("z_bMat2", "bK2 > 0 ? bN2 : 0",
        z_bMat2_2dim__);
      current_statement__ = 1082;
      bCholesky2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1082;
      bCholesky2_1dim__ = ((stan::math::primitive_value(
                              stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK2, 1))) ? bK2 : 0);
      current_statement__ = 1082;
      stan::math::validate_non_negative_index("bCholesky2",
        "prior_dist_for_cov == 2 && bK2 > 1 ? bK2 : 0", bCholesky2_1dim__);
      current_statement__ = 1082;
      bCholesky2_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1082;
      bCholesky2_2dim__ = ((stan::math::primitive_value(
                              stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK2, 1))) ? bK2 : 0);
      current_statement__ = 1082;
      stan::math::validate_non_negative_index("bCholesky2",
        "prior_dist_for_cov == 2 && bK2 > 1 ? bK2 : 0", bCholesky2_2dim__);
      current_statement__ = 1083;
      yAux1_unscaled_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1083;
      yAux1_unscaled_1dim__ = stan::model::rvalue(has_aux, "has_aux",
                                stan::model::index_uni(1));
      current_statement__ = 1083;
      stan::math::validate_non_negative_index("yAux1_unscaled", "has_aux[1]",
        yAux1_unscaled_1dim__);
      current_statement__ = 1084;
      yAux2_unscaled_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1084;
      yAux2_unscaled_1dim__ = stan::model::rvalue(has_aux, "has_aux",
                                stan::model::index_uni(2));
      current_statement__ = 1084;
      stan::math::validate_non_negative_index("yAux2_unscaled", "has_aux[2]",
        yAux2_unscaled_1dim__);
      current_statement__ = 1085;
      yAux3_unscaled_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1085;
      yAux3_unscaled_1dim__ = stan::model::rvalue(has_aux, "has_aux",
                                stan::model::index_uni(3));
      current_statement__ = 1085;
      stan::math::validate_non_negative_index("yAux3_unscaled", "has_aux[3]",
        yAux3_unscaled_1dim__);
      current_statement__ = 1086;
      stan::math::validate_non_negative_index("yGlobal1", "yHs1", yHs1);
      current_statement__ = 1087;
      stan::math::validate_non_negative_index("yGlobal2", "yHs2", yHs2);
      current_statement__ = 1088;
      stan::math::validate_non_negative_index("yGlobal3", "yHs3", yHs3);
      current_statement__ = 1089;
      stan::math::validate_non_negative_index("yLocal1", "yHs1", yHs1);
      current_statement__ = 1090;
      yLocal1_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1090;
      yLocal1_2dim__ = stan::model::rvalue(yK, "yK",
                         stan::model::index_uni(1));
      current_statement__ = 1090;
      stan::math::validate_non_negative_index("yLocal1", "yK[1]",
        yLocal1_2dim__);
      current_statement__ = 1091;
      stan::math::validate_non_negative_index("yLocal2", "yHs2", yHs2);
      current_statement__ = 1092;
      yLocal2_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1092;
      yLocal2_2dim__ = stan::model::rvalue(yK, "yK",
                         stan::model::index_uni(2));
      current_statement__ = 1092;
      stan::math::validate_non_negative_index("yLocal2", "yK[2]",
        yLocal2_2dim__);
      current_statement__ = 1093;
      stan::math::validate_non_negative_index("yLocal3", "yHs3", yHs3);
      current_statement__ = 1094;
      yLocal3_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1094;
      yLocal3_2dim__ = stan::model::rvalue(yK, "yK",
                         stan::model::index_uni(3));
      current_statement__ = 1094;
      stan::math::validate_non_negative_index("yLocal3", "yK[3]",
        yLocal3_2dim__);
      current_statement__ = 1095;
      y_caux1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1095;
      y_caux1_1dim__ = stan::math::logical_gt(yHs1, 0);
      current_statement__ = 1095;
      stan::math::validate_non_negative_index("y_caux1", "yHs1 > 0",
        y_caux1_1dim__);
      current_statement__ = 1096;
      y_caux2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1096;
      y_caux2_1dim__ = stan::math::logical_gt(yHs2, 0);
      current_statement__ = 1096;
      stan::math::validate_non_negative_index("y_caux2", "yHs2 > 0",
        y_caux2_1dim__);
      current_statement__ = 1097;
      y_caux3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1097;
      y_caux3_1dim__ = stan::math::logical_gt(yHs3, 0);
      current_statement__ = 1097;
      stan::math::validate_non_negative_index("y_caux3", "yHs3 > 0",
        y_caux3_1dim__);
      current_statement__ = 1098;
      yOol1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1098;
      yOol1_1dim__ = stan::math::logical_eq(
                       stan::model::rvalue(y_prior_dist, "y_prior_dist",
                         stan::model::index_uni(1)), 6);
      current_statement__ = 1098;
      stan::math::validate_non_negative_index("yOol1",
        "y_prior_dist[1] == 6", yOol1_1dim__);
      current_statement__ = 1099;
      yOol2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1099;
      yOol2_1dim__ = stan::math::logical_eq(
                       stan::model::rvalue(y_prior_dist, "y_prior_dist",
                         stan::model::index_uni(2)), 6);
      current_statement__ = 1099;
      stan::math::validate_non_negative_index("yOol2",
        "y_prior_dist[2] == 6", yOol2_1dim__);
      current_statement__ = 1100;
      yOol3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1100;
      yOol3_1dim__ = stan::math::logical_eq(
                       stan::model::rvalue(y_prior_dist, "y_prior_dist",
                         stan::model::index_uni(3)), 6);
      current_statement__ = 1100;
      stan::math::validate_non_negative_index("yOol3",
        "y_prior_dist[3] == 6", yOol3_1dim__);
      current_statement__ = 1101;
      yMix1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1101;
      yMix1_1dim__ = (stan::math::primitive_value(
                        stan::math::logical_eq(
                          stan::model::rvalue(y_prior_dist, "y_prior_dist",
                            stan::model::index_uni(1)), 5))
        ||
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(y_prior_dist, "y_prior_dist",
              stan::model::index_uni(1)), 6)));
      current_statement__ = 1101;
      stan::math::validate_non_negative_index("yMix1",
        "y_prior_dist[1] == 5 || y_prior_dist[1] == 6", yMix1_1dim__);
      current_statement__ = 1102;
      yMix1_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1102;
      yMix1_2dim__ = stan::model::rvalue(yK, "yK", stan::model::index_uni(1));
      current_statement__ = 1102;
      stan::math::validate_non_negative_index("yMix1", "yK[1]", yMix1_2dim__);
      current_statement__ = 1103;
      yMix2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1103;
      yMix2_1dim__ = (stan::math::primitive_value(
                        stan::math::logical_eq(
                          stan::model::rvalue(y_prior_dist, "y_prior_dist",
                            stan::model::index_uni(2)), 5))
        ||
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(y_prior_dist, "y_prior_dist",
              stan::model::index_uni(2)), 6)));
      current_statement__ = 1103;
      stan::math::validate_non_negative_index("yMix2",
        "y_prior_dist[2] == 5 || y_prior_dist[2] == 6", yMix2_1dim__);
      current_statement__ = 1104;
      yMix2_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1104;
      yMix2_2dim__ = stan::model::rvalue(yK, "yK", stan::model::index_uni(2));
      current_statement__ = 1104;
      stan::math::validate_non_negative_index("yMix2", "yK[2]", yMix2_2dim__);
      current_statement__ = 1105;
      yMix3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1105;
      yMix3_1dim__ = (stan::math::primitive_value(
                        stan::math::logical_eq(
                          stan::model::rvalue(y_prior_dist, "y_prior_dist",
                            stan::model::index_uni(3)), 5))
        ||
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(y_prior_dist, "y_prior_dist",
              stan::model::index_uni(3)), 6)));
      current_statement__ = 1105;
      stan::math::validate_non_negative_index("yMix3",
        "y_prior_dist[3] == 5 || y_prior_dist[3] == 6", yMix3_1dim__);
      current_statement__ = 1106;
      yMix3_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1106;
      yMix3_2dim__ = stan::model::rvalue(yK, "yK", stan::model::index_uni(3));
      current_statement__ = 1106;
      stan::math::validate_non_negative_index("yMix3", "yK[3]", yMix3_2dim__);
      current_statement__ = 1107;
      stan::math::validate_non_negative_index("e_gamma", "e_has_intercept",
        e_has_intercept);
      current_statement__ = 1108;
      stan::math::validate_non_negative_index("e_z_beta", "e_K", e_K);
      current_statement__ = 1109;
      stan::math::validate_non_negative_index("e_aux_unscaled", "basehaz_df",
        basehaz_df);
      current_statement__ = 1110;
      stan::math::validate_non_negative_index("e_global", "e_hs", e_hs);
      current_statement__ = 1111;
      stan::math::validate_non_negative_index("e_local", "e_hs", e_hs);
      current_statement__ = 1112;
      e_local_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1112;
      e_local_2dim__ = (stan::math::logical_gt(e_hs, 0) * e_K);
      current_statement__ = 1112;
      stan::math::validate_non_negative_index("e_local", "(e_hs > 0) * e_K",
        e_local_2dim__);
      current_statement__ = 1113;
      e_caux_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1113;
      e_caux_1dim__ = stan::math::logical_gt(e_hs, 0);
      current_statement__ = 1113;
      stan::math::validate_non_negative_index("e_caux", "e_hs > 0",
        e_caux_1dim__);
      current_statement__ = 1114;
      e_mix_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1114;
      e_mix_1dim__ = (stan::math::primitive_value(
                        stan::math::logical_eq(e_prior_dist, 5))
        ||
        stan::math::primitive_value(stan::math::logical_eq(e_prior_dist, 6)));
      current_statement__ = 1114;
      stan::math::validate_non_negative_index("e_mix",
        "e_prior_dist == 5 || e_prior_dist == 6", e_mix_1dim__);
      current_statement__ = 1115;
      stan::math::validate_non_negative_index("e_mix", "e_K", e_K);
      current_statement__ = 1116;
      e_ool_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1116;
      e_ool_1dim__ = stan::math::logical_eq(e_prior_dist, 6);
      current_statement__ = 1116;
      stan::math::validate_non_negative_index("e_ool", "e_prior_dist == 6",
        e_ool_1dim__);
      current_statement__ = 1117;
      stan::math::validate_non_negative_index("a_z_beta", "a_K", a_K);
      current_statement__ = 1118;
      stan::math::validate_non_negative_index("a_global", "a_hs", a_hs);
      current_statement__ = 1119;
      stan::math::validate_non_negative_index("a_local", "a_hs", a_hs);
      current_statement__ = 1120;
      a_local_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1120;
      a_local_2dim__ = (stan::math::logical_gt(a_hs, 0) * a_K);
      current_statement__ = 1120;
      stan::math::validate_non_negative_index("a_local", "(a_hs > 0) * a_K",
        a_local_2dim__);
      current_statement__ = 1121;
      a_caux_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1121;
      a_caux_1dim__ = stan::math::logical_gt(a_hs, 0);
      current_statement__ = 1121;
      stan::math::validate_non_negative_index("a_caux", "a_hs > 0",
        a_caux_1dim__);
      current_statement__ = 1122;
      a_mix_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1122;
      a_mix_1dim__ = (stan::math::primitive_value(
                        stan::math::logical_eq(a_prior_dist, 5))
        ||
        stan::math::primitive_value(stan::math::logical_eq(a_prior_dist, 6)));
      current_statement__ = 1122;
      stan::math::validate_non_negative_index("a_mix",
        "a_prior_dist == 5 || a_prior_dist == 6", a_mix_1dim__);
      current_statement__ = 1123;
      stan::math::validate_non_negative_index("a_mix", "a_K", a_K);
      current_statement__ = 1124;
      a_ool_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1124;
      a_ool_1dim__ = stan::math::logical_eq(a_prior_dist, 6);
      current_statement__ = 1124;
      stan::math::validate_non_negative_index("a_ool", "a_prior_dist == 6",
        a_ool_1dim__);
      current_statement__ = 1125;
      stan::math::validate_non_negative_index("e_beta", "e_K", e_K);
      current_statement__ = 1126;
      stan::math::validate_non_negative_index("a_beta", "a_K", a_K);
      current_statement__ = 1127;
      stan::math::validate_non_negative_index("e_aux", "basehaz_df",
        basehaz_df);
      current_statement__ = 1128;
      yBeta1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1128;
      yBeta1_1dim__ = stan::model::rvalue(yK, "yK", stan::model::index_uni(1));
      current_statement__ = 1128;
      stan::math::validate_non_negative_index("yBeta1", "yK[1]",
        yBeta1_1dim__);
      current_statement__ = 1129;
      yBeta2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1129;
      yBeta2_1dim__ = stan::model::rvalue(yK, "yK", stan::model::index_uni(2));
      current_statement__ = 1129;
      stan::math::validate_non_negative_index("yBeta2", "yK[2]",
        yBeta2_1dim__);
      current_statement__ = 1130;
      yBeta3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1130;
      yBeta3_1dim__ = stan::model::rvalue(yK, "yK", stan::model::index_uni(3));
      current_statement__ = 1130;
      stan::math::validate_non_negative_index("yBeta3", "yK[3]",
        yBeta3_1dim__);
      current_statement__ = 1131;
      yAux1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1131;
      yAux1_1dim__ = stan::model::rvalue(has_aux, "has_aux",
                       stan::model::index_uni(1));
      current_statement__ = 1131;
      stan::math::validate_non_negative_index("yAux1", "has_aux[1]",
        yAux1_1dim__);
      current_statement__ = 1132;
      yAux2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1132;
      yAux2_1dim__ = stan::model::rvalue(has_aux, "has_aux",
                       stan::model::index_uni(2));
      current_statement__ = 1132;
      stan::math::validate_non_negative_index("yAux2", "has_aux[2]",
        yAux2_1dim__);
      current_statement__ = 1133;
      yAux3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1133;
      yAux3_1dim__ = stan::model::rvalue(has_aux, "has_aux",
                       stan::model::index_uni(3));
      current_statement__ = 1133;
      stan::math::validate_non_negative_index("yAux3", "has_aux[3]",
        yAux3_1dim__);
      current_statement__ = 1134;
      stan::math::validate_non_negative_index("theta_L", "len_theta_L",
        len_theta_L);
      current_statement__ = 1135;
      bMat1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1135;
      bMat1_1dim__ = (stan::math::logical_gt(bK1, 0) ? bN1 : 0);
      current_statement__ = 1135;
      stan::math::validate_non_negative_index("bMat1", "bK1 > 0 ? bN1 : 0",
        bMat1_1dim__);
      current_statement__ = 1136;
      stan::math::validate_non_negative_index("bMat1", "bK1", bK1);
      current_statement__ = 1137;
      bMat2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1137;
      bMat2_1dim__ = (stan::math::logical_gt(bK2, 0) ? bN2 : 0);
      current_statement__ = 1137;
      stan::math::validate_non_negative_index("bMat2", "bK2 > 0 ? bN2 : 0",
        bMat2_1dim__);
      current_statement__ = 1138;
      stan::math::validate_non_negative_index("bMat2", "bK2", bK2);
      current_statement__ = 1139;
      stan::math::validate_non_negative_index("mean_PPD", "M", M);
      current_statement__ = 1140;
      yAlpha1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1140;
      yAlpha1_1dim__ = stan::math::logical_gt(
                         stan::model::rvalue(intercept_type,
                           "intercept_type", stan::model::index_uni(1)), 0);
      current_statement__ = 1140;
      stan::math::validate_non_negative_index("yAlpha1",
        "intercept_type[1] > 0", yAlpha1_1dim__);
      current_statement__ = 1141;
      yAlpha2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1141;
      yAlpha2_1dim__ = stan::math::logical_gt(
                         stan::model::rvalue(intercept_type,
                           "intercept_type", stan::model::index_uni(2)), 0);
      current_statement__ = 1141;
      stan::math::validate_non_negative_index("yAlpha2",
        "intercept_type[2] > 0", yAlpha2_1dim__);
      current_statement__ = 1142;
      yAlpha3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1142;
      yAlpha3_1dim__ = stan::math::logical_gt(
                         stan::model::rvalue(intercept_type,
                           "intercept_type", stan::model::index_uni(3)), 0);
      current_statement__ = 1142;
      stan::math::validate_non_negative_index("yAlpha3",
        "intercept_type[3] > 0", yAlpha3_1dim__);
      current_statement__ = 1143;
      bCov1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1143;
      bCov1_1dim__ = ((stan::math::primitive_value(
                         stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK1, 0))) ? 
        stan::math::size(bCov1_idx) : 0);
      current_statement__ = 1143;
      stan::math::validate_non_negative_index("bCov1",
        "prior_dist_for_cov == 2 && bK1 > 0 ? size(bCov1_idx) : 0",
        bCov1_1dim__);
      current_statement__ = 1144;
      bCov2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1144;
      bCov2_1dim__ = ((stan::math::primitive_value(
                         stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK2, 0))) ? 
        stan::math::size(bCov2_idx) : 0);
      current_statement__ = 1144;
      stan::math::validate_non_negative_index("bCov2",
        "prior_dist_for_cov == 2 && bK2 > 0 ? size(bCov2_idx) : 0",
        bCov2_1dim__);
      current_statement__ = 1145;
      b1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1145;
      b1_1dim__ = (bN1 * bK1);
      current_statement__ = 1145;
      stan::math::validate_non_negative_index("b1", "bN1 * bK1", b1_1dim__);
      current_statement__ = 1146;
      b2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 1146;
      b2_1dim__ = (bN2 * bK2);
      current_statement__ = 1146;
      stan::math::validate_non_negative_index("b2", "bN2 * bK2", b2_1dim__);
    } catch (const std::exception& e) {
      stan::lang::rethrow_located(e, locations_array__[current_statement__]);
    }
    num_params_r__ = yGamma1_1dim__ + yGamma2_1dim__ + yGamma3_1dim__ +
      z_yBeta1_1dim__ + z_yBeta2_1dim__ + z_yBeta3_1dim__ + z_b_1dim__ +
      z_T_1dim__ + rho_1dim__ + zeta_1dim__ + tau_1dim__ + bSd1_1dim__ +
      (z_bMat1_1dim__ * z_bMat1_2dim__) + ((bCholesky1_1dim__ *
      (bCholesky1_1dim__ - 1)) / 2) + bSd2_1dim__ + (z_bMat2_1dim__ *
      z_bMat2_2dim__) + ((bCholesky2_1dim__ * (bCholesky2_1dim__ - 1)) / 2) +
      yAux1_unscaled_1dim__ + yAux2_unscaled_1dim__ + yAux3_unscaled_1dim__ +
      yHs1 + yHs2 + yHs3 + (yHs1 * yLocal1_2dim__) + (yHs2 * yLocal2_2dim__)
      + (yHs3 * yLocal3_2dim__) + y_caux1_1dim__ + y_caux2_1dim__ +
      y_caux3_1dim__ + yOol1_1dim__ + yOol2_1dim__ + yOol3_1dim__ +
      (yMix1_1dim__ * yMix1_2dim__) + (yMix2_1dim__ * yMix2_2dim__) +
      (yMix3_1dim__ * yMix3_2dim__) + e_has_intercept + e_K + basehaz_df +
      e_hs + (e_hs * e_local_2dim__) + e_caux_1dim__ + (e_mix_1dim__ * e_K) +
      e_ool_1dim__ + a_K + a_hs + (a_hs * a_local_2dim__) + a_caux_1dim__ +
      (a_mix_1dim__ * a_K) + a_ool_1dim__;
  }
  inline std::string model_name() const final {
    return "model_jm";
  }
  inline std::vector<std::string> model_compile_info() const noexcept {
    return std::vector<std::string>{"stanc_version = stanc3 v2.32.2",
             "stancflags = --allow-undefined"};
  }
  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__ = "model_jm_namespace::log_prob";
    // suppress unused var warning
    (void) function__;
    try {
      std::vector<local_scalar_t__> yGamma1 =
        std::vector<local_scalar_t__>(yGamma1_1dim__, DUMMY_VAR__);
      current_statement__ = 1;
      yGamma1 = in__.template read_constrain_lub<
                  std::vector<local_scalar_t__>,
                  jacobian__>(lb(
                                stan::model::rvalue(intercept_type,
                                  "intercept_type", stan::model::index_uni(1)),
                                pstream__),
                  ub(
                    stan::model::rvalue(intercept_type, "intercept_type",
                      stan::model::index_uni(1)), pstream__), lp__,
                  yGamma1_1dim__);
      std::vector<local_scalar_t__> yGamma2 =
        std::vector<local_scalar_t__>(yGamma2_1dim__, DUMMY_VAR__);
      current_statement__ = 2;
      yGamma2 = in__.template read_constrain_lub<
                  std::vector<local_scalar_t__>,
                  jacobian__>(lb(
                                stan::model::rvalue(intercept_type,
                                  "intercept_type", stan::model::index_uni(2)),
                                pstream__),
                  ub(
                    stan::model::rvalue(intercept_type, "intercept_type",
                      stan::model::index_uni(2)), pstream__), lp__,
                  yGamma2_1dim__);
      std::vector<local_scalar_t__> yGamma3 =
        std::vector<local_scalar_t__>(yGamma3_1dim__, DUMMY_VAR__);
      current_statement__ = 3;
      yGamma3 = in__.template read_constrain_lub<
                  std::vector<local_scalar_t__>,
                  jacobian__>(lb(
                                stan::model::rvalue(intercept_type,
                                  "intercept_type", stan::model::index_uni(3)),
                                pstream__),
                  ub(
                    stan::model::rvalue(intercept_type, "intercept_type",
                      stan::model::index_uni(3)), pstream__), lp__,
                  yGamma3_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta1_1dim__,
          DUMMY_VAR__);
      current_statement__ = 4;
      z_yBeta1 = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta1_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta2_1dim__,
          DUMMY_VAR__);
      current_statement__ = 5;
      z_yBeta2 = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta2_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta3_1dim__,
          DUMMY_VAR__);
      current_statement__ = 6;
      z_yBeta3 = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta3_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> z_b =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_b_1dim__,
          DUMMY_VAR__);
      current_statement__ = 7;
      z_b = in__.template read<
              Eigen::Matrix<local_scalar_t__,-1,1>>(z_b_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> z_T =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_T_1dim__,
          DUMMY_VAR__);
      current_statement__ = 8;
      z_T = in__.template read<
              Eigen::Matrix<local_scalar_t__,-1,1>>(z_T_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> rho =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(rho_1dim__,
          DUMMY_VAR__);
      current_statement__ = 9;
      rho = in__.template read_constrain_lub<
              Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, 1, lp__,
              rho_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> zeta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(zeta_1dim__,
          DUMMY_VAR__);
      current_statement__ = 10;
      zeta = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               zeta_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> tau =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(tau_1dim__,
          DUMMY_VAR__);
      current_statement__ = 11;
      tau = in__.template read_constrain_lb<
              Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
              tau_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> bSd1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(bSd1_1dim__,
          DUMMY_VAR__);
      current_statement__ = 12;
      bSd1 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               bSd1_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,-1> z_bMat1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(z_bMat1_1dim__,
          z_bMat1_2dim__, DUMMY_VAR__);
      current_statement__ = 13;
      z_bMat1 = in__.template read<
                  Eigen::Matrix<local_scalar_t__,-1,-1>>(z_bMat1_1dim__,
                  z_bMat1_2dim__);
      Eigen::Matrix<local_scalar_t__,-1,-1> bCholesky1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bCholesky1_1dim__,
          bCholesky1_2dim__, DUMMY_VAR__);
      current_statement__ = 14;
      bCholesky1 = in__.template read_constrain_cholesky_factor_corr<
                     Eigen::Matrix<local_scalar_t__,-1,-1>, jacobian__>(lp__,
                     bCholesky1_2dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> bSd2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(bSd2_1dim__,
          DUMMY_VAR__);
      current_statement__ = 15;
      bSd2 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               bSd2_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,-1> z_bMat2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(z_bMat2_1dim__,
          z_bMat2_2dim__, DUMMY_VAR__);
      current_statement__ = 16;
      z_bMat2 = in__.template read<
                  Eigen::Matrix<local_scalar_t__,-1,-1>>(z_bMat2_1dim__,
                  z_bMat2_2dim__);
      Eigen::Matrix<local_scalar_t__,-1,-1> bCholesky2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bCholesky2_1dim__,
          bCholesky2_2dim__, DUMMY_VAR__);
      current_statement__ = 17;
      bCholesky2 = in__.template read_constrain_cholesky_factor_corr<
                     Eigen::Matrix<local_scalar_t__,-1,-1>, jacobian__>(lp__,
                     bCholesky2_2dim__);
      std::vector<local_scalar_t__> yAux1_unscaled =
        std::vector<local_scalar_t__>(yAux1_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 18;
      yAux1_unscaled = in__.template read_constrain_lb<
                         std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                         yAux1_unscaled_1dim__);
      std::vector<local_scalar_t__> yAux2_unscaled =
        std::vector<local_scalar_t__>(yAux2_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 19;
      yAux2_unscaled = in__.template read_constrain_lb<
                         std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                         yAux2_unscaled_1dim__);
      std::vector<local_scalar_t__> yAux3_unscaled =
        std::vector<local_scalar_t__>(yAux3_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 20;
      yAux3_unscaled = in__.template read_constrain_lb<
                         std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                         yAux3_unscaled_1dim__);
      std::vector<local_scalar_t__> yGlobal1 =
        std::vector<local_scalar_t__>(yHs1, DUMMY_VAR__);
      current_statement__ = 21;
      yGlobal1 = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, yHs1);
      std::vector<local_scalar_t__> yGlobal2 =
        std::vector<local_scalar_t__>(yHs2, DUMMY_VAR__);
      current_statement__ = 22;
      yGlobal2 = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, yHs2);
      std::vector<local_scalar_t__> yGlobal3 =
        std::vector<local_scalar_t__>(yHs3, DUMMY_VAR__);
      current_statement__ = 23;
      yGlobal3 = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, yHs3);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs1,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal1_2dim__,
            DUMMY_VAR__));
      current_statement__ = 24;
      yLocal1 = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, yHs1, yLocal1_2dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs2,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal2_2dim__,
            DUMMY_VAR__));
      current_statement__ = 25;
      yLocal2 = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, yHs2, yLocal2_2dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs3,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal3_2dim__,
            DUMMY_VAR__));
      current_statement__ = 26;
      yLocal3 = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, yHs3, yLocal3_2dim__);
      std::vector<local_scalar_t__> y_caux1 =
        std::vector<local_scalar_t__>(y_caux1_1dim__, DUMMY_VAR__);
      current_statement__ = 27;
      y_caux1 = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                  y_caux1_1dim__);
      std::vector<local_scalar_t__> y_caux2 =
        std::vector<local_scalar_t__>(y_caux2_1dim__, DUMMY_VAR__);
      current_statement__ = 28;
      y_caux2 = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                  y_caux2_1dim__);
      std::vector<local_scalar_t__> y_caux3 =
        std::vector<local_scalar_t__>(y_caux3_1dim__, DUMMY_VAR__);
      current_statement__ = 29;
      y_caux3 = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                  y_caux3_1dim__);
      std::vector<local_scalar_t__> yOol1 =
        std::vector<local_scalar_t__>(yOol1_1dim__, DUMMY_VAR__);
      current_statement__ = 30;
      yOol1 = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, yOol1_1dim__);
      std::vector<local_scalar_t__> yOol2 =
        std::vector<local_scalar_t__>(yOol2_1dim__, DUMMY_VAR__);
      current_statement__ = 31;
      yOol2 = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, yOol2_1dim__);
      std::vector<local_scalar_t__> yOol3 =
        std::vector<local_scalar_t__>(yOol3_1dim__, DUMMY_VAR__);
      current_statement__ = 32;
      yOol3 = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, yOol3_1dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix1_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix1_2dim__,
            DUMMY_VAR__));
      current_statement__ = 33;
      yMix1 = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, yMix1_1dim__, yMix1_2dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix2_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix2_2dim__,
            DUMMY_VAR__));
      current_statement__ = 34;
      yMix2 = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, yMix2_1dim__, yMix2_2dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix3_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix3_2dim__,
            DUMMY_VAR__));
      current_statement__ = 35;
      yMix3 = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, yMix3_1dim__, yMix3_2dim__);
      std::vector<local_scalar_t__> e_gamma =
        std::vector<local_scalar_t__>(e_has_intercept, DUMMY_VAR__);
      current_statement__ = 36;
      e_gamma = in__.template read<
                  std::vector<local_scalar_t__>>(e_has_intercept);
      Eigen::Matrix<local_scalar_t__,-1,1> e_z_beta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(e_K, DUMMY_VAR__);
      current_statement__ = 37;
      e_z_beta = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(e_K);
      Eigen::Matrix<local_scalar_t__,-1,1> e_aux_unscaled =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(basehaz_df,
          DUMMY_VAR__);
      current_statement__ = 38;
      e_aux_unscaled = in__.template read_constrain_lb<
                         Eigen::Matrix<local_scalar_t__,-1,1>,
                         jacobian__>((stan::math::logical_eq(basehaz_type, 1) ? 0 : 
                         stan::math::negative_infinity()), lp__, basehaz_df);
      std::vector<local_scalar_t__> e_global =
        std::vector<local_scalar_t__>(e_hs, DUMMY_VAR__);
      current_statement__ = 39;
      e_global = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, e_hs);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> e_local =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(e_hs,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(e_local_2dim__,
            DUMMY_VAR__));
      current_statement__ = 40;
      e_local = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, e_hs, e_local_2dim__);
      std::vector<local_scalar_t__> e_caux =
        std::vector<local_scalar_t__>(e_caux_1dim__, DUMMY_VAR__);
      current_statement__ = 41;
      e_caux = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                 jacobian__>(0, lp__, e_caux_1dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> e_mix =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(e_mix_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(e_K, DUMMY_VAR__));
      current_statement__ = 42;
      e_mix = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, e_mix_1dim__, e_K);
      std::vector<local_scalar_t__> e_ool =
        std::vector<local_scalar_t__>(e_ool_1dim__, DUMMY_VAR__);
      current_statement__ = 43;
      e_ool = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, e_ool_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> a_z_beta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(a_K, DUMMY_VAR__);
      current_statement__ = 44;
      a_z_beta = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(a_K);
      std::vector<local_scalar_t__> a_global =
        std::vector<local_scalar_t__>(a_hs, DUMMY_VAR__);
      current_statement__ = 45;
      a_global = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, a_hs);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> a_local =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(a_hs,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(a_local_2dim__,
            DUMMY_VAR__));
      current_statement__ = 46;
      a_local = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, a_hs, a_local_2dim__);
      std::vector<local_scalar_t__> a_caux =
        std::vector<local_scalar_t__>(a_caux_1dim__, DUMMY_VAR__);
      current_statement__ = 47;
      a_caux = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                 jacobian__>(0, lp__, a_caux_1dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> a_mix =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(a_mix_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(a_K, DUMMY_VAR__));
      current_statement__ = 48;
      a_mix = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, a_mix_1dim__, a_K);
      std::vector<local_scalar_t__> a_ool =
        std::vector<local_scalar_t__>(a_ool_1dim__, DUMMY_VAR__);
      current_statement__ = 49;
      a_ool = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, a_ool_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> e_beta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(e_K, DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> a_beta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(a_K, DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> e_aux =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(basehaz_df,
          DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> yBeta1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yBeta1_1dim__,
          DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> yBeta2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yBeta2_1dim__,
          DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> yBeta3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yBeta3_1dim__,
          DUMMY_VAR__);
      std::vector<local_scalar_t__> yAux1 =
        std::vector<local_scalar_t__>(yAux1_1dim__, DUMMY_VAR__);
      std::vector<local_scalar_t__> yAux2 =
        std::vector<local_scalar_t__>(yAux2_1dim__, DUMMY_VAR__);
      std::vector<local_scalar_t__> yAux3 =
        std::vector<local_scalar_t__>(yAux3_1dim__, DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> theta_L =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(len_theta_L,
          DUMMY_VAR__);
      local_scalar_t__ yAuxMaximum = DUMMY_VAR__;
      current_statement__ = 60;
      yAuxMaximum = 1.0;
      Eigen::Matrix<local_scalar_t__,-1,-1> bMat1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bMat1_1dim__, bK1,
          DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,-1> bMat2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bMat2_1dim__, bK2,
          DUMMY_VAR__);
      current_statement__ = 76;
      if (stan::math::logical_eq(
            stan::model::rvalue(has_aux, "has_aux", stan::model::index_uni(1)),
            1)) {
        current_statement__ = 72;
        stan::model::assign(yAux1,
          make_aux(
            stan::model::rvalue(yAux1_unscaled, "yAux1_unscaled",
              stan::model::index_uni(1)),
            stan::model::rvalue(y_prior_dist_for_aux, "y_prior_dist_for_aux",
              stan::model::index_uni(1)),
            stan::model::rvalue(y_prior_mean_for_aux, "y_prior_mean_for_aux",
              stan::model::index_uni(1)),
            stan::model::rvalue(y_prior_scale_for_aux,
              "y_prior_scale_for_aux", stan::model::index_uni(1)), pstream__),
          "assigning variable yAux1", stan::model::index_uni(1));
        current_statement__ = 74;
        if (stan::math::logical_gt(
              stan::model::rvalue(yAux1, "yAux1", stan::model::index_uni(1)),
              yAuxMaximum)) {
          current_statement__ = 73;
          yAuxMaximum = stan::model::rvalue(yAux1, "yAux1",
                          stan::model::index_uni(1));
        }
      }
      current_statement__ = 78;
      if (stan::math::logical_gt(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(1)), 0)) {
        current_statement__ = 77;
        stan::model::assign(yBeta1,
          make_beta(z_yBeta1,
            stan::model::rvalue(y_prior_dist, "y_prior_dist",
              stan::model::index_uni(1)), y_prior_mean1, y_prior_scale1,
            y_prior_df1,
            stan::model::rvalue(y_global_prior_scale, "y_global_prior_scale",
              stan::model::index_uni(1)), yGlobal1, yLocal1, yOol1, yMix1,
            yAux1,
            stan::model::rvalue(family, "family", stan::model::index_uni(1)),
            stan::model::rvalue(y_slab_scale, "y_slab_scale",
              stan::model::index_uni(1)), y_caux1, pstream__),
          "assigning variable yBeta1");
      }
      current_statement__ = 87;
      if (stan::math::logical_gt(M, 1)) {
        current_statement__ = 83;
        if (stan::math::logical_eq(
              stan::model::rvalue(has_aux, "has_aux",
                stan::model::index_uni(2)), 1)) {
          current_statement__ = 79;
          stan::model::assign(yAux2,
            make_aux(
              stan::model::rvalue(yAux2_unscaled, "yAux2_unscaled",
                stan::model::index_uni(1)),
              stan::model::rvalue(y_prior_dist_for_aux,
                "y_prior_dist_for_aux", stan::model::index_uni(2)),
              stan::model::rvalue(y_prior_mean_for_aux,
                "y_prior_mean_for_aux", stan::model::index_uni(2)),
              stan::model::rvalue(y_prior_scale_for_aux,
                "y_prior_scale_for_aux", stan::model::index_uni(2)),
              pstream__), "assigning variable yAux2",
            stan::model::index_uni(1));
          current_statement__ = 81;
          if (stan::math::logical_gt(
                stan::model::rvalue(yAux2, "yAux2", stan::model::index_uni(1)),
                yAuxMaximum)) {
            current_statement__ = 80;
            yAuxMaximum = stan::model::rvalue(yAux2, "yAux2",
                            stan::model::index_uni(1));
          }
        }
        current_statement__ = 85;
        if (stan::math::logical_gt(
              stan::model::rvalue(yK, "yK", stan::model::index_uni(2)), 0)) {
          current_statement__ = 84;
          stan::model::assign(yBeta2,
            make_beta(z_yBeta2,
              stan::model::rvalue(y_prior_dist, "y_prior_dist",
                stan::model::index_uni(2)), y_prior_mean2, y_prior_scale2,
              y_prior_df2,
              stan::model::rvalue(y_global_prior_scale,
                "y_global_prior_scale", stan::model::index_uni(2)), yGlobal2,
              yLocal2, yOol2, yMix2, yAux2,
              stan::model::rvalue(family, "family", stan::model::index_uni(2)),
              stan::model::rvalue(y_slab_scale, "y_slab_scale",
                stan::model::index_uni(2)), y_caux2, pstream__),
            "assigning variable yBeta2");
        }
      }
      current_statement__ = 96;
      if (stan::math::logical_gt(M, 2)) {
        current_statement__ = 92;
        if (stan::math::logical_eq(
              stan::model::rvalue(has_aux, "has_aux",
                stan::model::index_uni(3)), 1)) {
          current_statement__ = 88;
          stan::model::assign(yAux3,
            make_aux(
              stan::model::rvalue(yAux3_unscaled, "yAux3_unscaled",
                stan::model::index_uni(1)),
              stan::model::rvalue(y_prior_dist_for_aux,
                "y_prior_dist_for_aux", stan::model::index_uni(3)),
              stan::model::rvalue(y_prior_mean_for_aux,
                "y_prior_mean_for_aux", stan::model::index_uni(3)),
              stan::model::rvalue(y_prior_scale_for_aux,
                "y_prior_scale_for_aux", stan::model::index_uni(3)),
              pstream__), "assigning variable yAux3",
            stan::model::index_uni(1));
          current_statement__ = 90;
          if (stan::math::logical_gt(
                stan::model::rvalue(yAux3, "yAux3", stan::model::index_uni(1)),
                yAuxMaximum)) {
            current_statement__ = 89;
            yAuxMaximum = stan::model::rvalue(yAux3, "yAux3",
                            stan::model::index_uni(1));
          }
        }
        current_statement__ = 94;
        if (stan::math::logical_gt(
              stan::model::rvalue(yK, "yK", stan::model::index_uni(3)), 0)) {
          current_statement__ = 93;
          stan::model::assign(yBeta3,
            make_beta(z_yBeta3,
              stan::model::rvalue(y_prior_dist, "y_prior_dist",
                stan::model::index_uni(3)), y_prior_mean3, y_prior_scale3,
              y_prior_df3,
              stan::model::rvalue(y_global_prior_scale,
                "y_global_prior_scale", stan::model::index_uni(3)), yGlobal3,
              yLocal3, yOol3, yMix3, yAux3,
              stan::model::rvalue(family, "family", stan::model::index_uni(3)),
              stan::model::rvalue(y_slab_scale, "y_slab_scale",
                stan::model::index_uni(3)), y_caux3, pstream__),
            "assigning variable yBeta3");
        }
      }
      current_statement__ = 114;
      if (stan::math::logical_eq(prior_dist_for_cov, 1)) {
        int mark = std::numeric_limits<int>::min();
        current_statement__ = 107;
        mark = 1;
        current_statement__ = 108;
        stan::model::assign(theta_L,
          make_theta_L(len_theta_L, p, yAuxMaximum, tau, b_prior_scale, zeta,
            rho, z_T, pstream__), "assigning variable theta_L");
        current_statement__ = 110;
        if (stan::math::logical_gt(bK1, 0)) {
          current_statement__ = 109;
          stan::model::assign(bMat1,
            make_b_matrix(z_b, theta_L, p, l, 1, pstream__),
            "assigning variable bMat1");
        }
        current_statement__ = 112;
        if (stan::math::logical_gt(bK2, 0)) {
          current_statement__ = 111;
          stan::model::assign(bMat2,
            make_b_matrix(z_b, theta_L, p, l, 2, pstream__),
            "assigning variable bMat2");
        }
      } else {
        current_statement__ = 106;
        if (stan::math::logical_eq(prior_dist_for_cov, 2)) {
          current_statement__ = 100;
          if (stan::math::logical_eq(bK1, 1)) {
            current_statement__ = 99;
            stan::model::assign(bMat1,
              stan::math::transpose(
                stan::math::multiply(
                  stan::model::rvalue(bSd1, "bSd1", stan::model::index_uni(1)),
                  z_bMat1)), "assigning variable bMat1");
          } else {
            current_statement__ = 98;
            if (stan::math::logical_gt(bK1, 1)) {
              current_statement__ = 97;
              stan::model::assign(bMat1,
                stan::math::transpose(
                  stan::math::multiply(
                    stan::math::diag_pre_multiply(bSd1, bCholesky1), z_bMat1)),
                "assigning variable bMat1");
            }
          }
          current_statement__ = 104;
          if (stan::math::logical_eq(bK2, 1)) {
            current_statement__ = 103;
            stan::model::assign(bMat2,
              stan::math::transpose(
                stan::math::multiply(
                  stan::model::rvalue(bSd2, "bSd2", stan::model::index_uni(1)),
                  z_bMat2)), "assigning variable bMat2");
          } else {
            current_statement__ = 102;
            if (stan::math::logical_gt(bK2, 1)) {
              current_statement__ = 101;
              stan::model::assign(bMat2,
                stan::math::transpose(
                  stan::math::multiply(
                    stan::math::diag_pre_multiply(bSd2, bCholesky2), z_bMat2)),
                "assigning variable bMat2");
            }
          }
        }
      }
      current_statement__ = 115;
      stan::model::assign(e_beta,
        make_beta(e_z_beta, e_prior_dist, e_prior_mean, e_prior_scale,
          e_prior_df, e_global_prior_scale, e_global, e_local, e_ool, e_mix,
          stan::math::rep_array(1.0, 0), 0, e_slab_scale, e_caux, pstream__),
        "assigning variable e_beta");
      current_statement__ = 116;
      stan::model::assign(a_beta,
        make_beta(a_z_beta, a_prior_dist, a_prior_mean, a_prior_scale,
          a_prior_df, a_global_prior_scale, a_global, a_local, a_ool, a_mix,
          stan::math::rep_array(1.0, 0), 0, a_slab_scale, a_caux, pstream__),
        "assigning variable a_beta");
      current_statement__ = 117;
      stan::model::assign(e_aux,
        make_basehaz_coef(e_aux_unscaled, e_prior_dist_for_aux,
          e_prior_mean_for_aux, e_prior_scale_for_aux, pstream__),
        "assigning variable e_aux");
      {
        current_statement__ = 163;
        stan::math::validate_non_negative_index("yEta1", "yNeta[1]",
          stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)));
        Eigen::Matrix<local_scalar_t__,-1,1> yEta1 =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::model::rvalue(
                                                           yNeta, "yNeta",
                                                           stan::model::index_uni(
                                                             1)),
            DUMMY_VAR__);
        current_statement__ = 165;
        stan::math::validate_non_negative_index("yEta2", "yNeta[2]",
          stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)));
        Eigen::Matrix<local_scalar_t__,-1,1> yEta2 =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::model::rvalue(
                                                           yNeta, "yNeta",
                                                           stan::model::index_uni(
                                                             2)),
            DUMMY_VAR__);
        current_statement__ = 167;
        stan::math::validate_non_negative_index("yEta3", "yNeta[3]",
          stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)));
        Eigen::Matrix<local_scalar_t__,-1,1> yEta3 =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::model::rvalue(
                                                           yNeta, "yNeta",
                                                           stan::model::index_uni(
                                                             3)),
            DUMMY_VAR__);
        current_statement__ = 173;
        if (stan::math::logical_gt(M, 0)) {
          int bMat1_colshift = std::numeric_limits<int>::min();
          current_statement__ = 169;
          bMat1_colshift = 0;
          int bMat2_colshift = std::numeric_limits<int>::min();
          current_statement__ = 170;
          bMat2_colshift = 0;
          current_statement__ = 171;
          stan::model::assign(yEta1,
            evaluate_eta(yX1, y1_Z1, y1_Z2, y1_Z1_id, y1_Z2_id, yGamma1,
              yBeta1, bMat1, bMat2, bMat1_colshift, bMat2_colshift,
              stan::model::rvalue(intercept_type, "intercept_type",
                stan::model::index_uni(1)), y1_offset, pstream__),
            "assigning variable yEta1");
        }
        current_statement__ = 178;
        if (stan::math::logical_gt(M, 1)) {
          int bMat1_colshift = std::numeric_limits<int>::min();
          current_statement__ = 174;
          bMat1_colshift = stan::model::rvalue(bK1_len, "bK1_len",
                             stan::model::index_uni(1));
          int bMat2_colshift = std::numeric_limits<int>::min();
          current_statement__ = 175;
          bMat2_colshift = stan::model::rvalue(bK2_len, "bK2_len",
                             stan::model::index_uni(1));
          current_statement__ = 176;
          stan::model::assign(yEta2,
            evaluate_eta(yX2, y2_Z1, y2_Z2, y2_Z1_id, y2_Z2_id, yGamma2,
              yBeta2, bMat1, bMat2, bMat1_colshift, bMat2_colshift,
              stan::model::rvalue(intercept_type, "intercept_type",
                stan::model::index_uni(2)), y2_offset, pstream__),
            "assigning variable yEta2");
        }
        current_statement__ = 183;
        if (stan::math::logical_gt(M, 2)) {
          int bMat1_colshift = std::numeric_limits<int>::min();
          current_statement__ = 179;
          bMat1_colshift = stan::math::sum(
                             stan::model::rvalue(bK1_len, "bK1_len",
                               stan::model::index_min_max(1, 2)));
          int bMat2_colshift = std::numeric_limits<int>::min();
          current_statement__ = 180;
          bMat2_colshift = stan::math::sum(
                             stan::model::rvalue(bK2_len, "bK2_len",
                               stan::model::index_min_max(1, 2)));
          current_statement__ = 181;
          stan::model::assign(yEta3,
            evaluate_eta(yX3, y3_Z1, y3_Z2, y3_Z1_id, y3_Z2_id, yGamma3,
              yBeta3, bMat1, bMat2, bMat1_colshift, bMat2_colshift,
              stan::model::rvalue(intercept_type, "intercept_type",
                stan::model::index_uni(3)), y3_offset, pstream__),
            "assigning variable yEta3");
        }
        current_statement__ = 190;
        if (stan::math::logical_eq(prior_PD, 0)) {
          current_statement__ = 184;
          lp_accum__.add(glm_lpdf<false>(yReal1, yInt1, yEta1, yAux1,
                           stan::model::rvalue(family, "family",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(link, "link",
                             stan::model::index_uni(1)), sum_log_y1, sqrt_y1,
                           log_y1, pstream__));
          current_statement__ = 186;
          if (stan::math::logical_gt(M, 1)) {
            current_statement__ = 185;
            lp_accum__.add(glm_lpdf<false>(yReal2, yInt2, yEta2, yAux2,
                             stan::model::rvalue(family, "family",
                               stan::model::index_uni(2)),
                             stan::model::rvalue(link, "link",
                               stan::model::index_uni(2)), sum_log_y2,
                             sqrt_y2, log_y2, pstream__));
          }
          current_statement__ = 188;
          if (stan::math::logical_gt(M, 2)) {
            current_statement__ = 187;
            lp_accum__.add(glm_lpdf<false>(yReal3, yInt3, yEta3, yAux3,
                             stan::model::rvalue(family, "family",
                               stan::model::index_uni(3)),
                             stan::model::rvalue(link, "link",
                               stan::model::index_uni(3)), sum_log_y3,
                             sqrt_y3, log_y3, pstream__));
          }
        }
        {
          current_statement__ = 191;
          stan::math::validate_non_negative_index("e_eta_q", "nrow_e_Xq",
            nrow_e_Xq);
          Eigen::Matrix<local_scalar_t__,-1,1> e_eta_q =
            Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_e_Xq,
              DUMMY_VAR__);
          current_statement__ = 195;
          if (stan::math::logical_gt(e_K, 0)) {
            current_statement__ = 194;
            stan::model::assign(e_eta_q, stan::math::multiply(e_Xq, e_beta),
              "assigning variable e_eta_q");
          } else {
            current_statement__ = 193;
            stan::model::assign(e_eta_q,
              stan::math::rep_vector(0.0, nrow_e_Xq),
              "assigning variable e_eta_q");
          }
          current_statement__ = 549;
          if (stan::math::logical_eq(assoc, 1)) {
            int mark = std::numeric_limits<int>::min();
            current_statement__ = 196;
            mark = 0;
            int mark2 = std::numeric_limits<int>::min();
            current_statement__ = 197;
            mark2 = 0;
            int mark3 = std::numeric_limits<int>::min();
            current_statement__ = 198;
            mark3 = 0;
            current_statement__ = 541;
            for (int m = 1; m <= M; ++m) {
              current_statement__ = 199;
              mark2 = (mark2 + 1);
              current_statement__ = 308;
              if ((stan::math::primitive_value(
                     (stan::math::primitive_value(
                        (stan::math::primitive_value(
                           stan::math::logical_eq(
                             stan::model::rvalue(has_assoc, "has_assoc",
                               stan::model::index_uni(1),
                               stan::model::index_uni(m)), 1)) ||
                        stan::math::primitive_value(
                          stan::math::logical_eq(
                            stan::model::rvalue(has_assoc, "has_assoc",
                              stan::model::index_uni(9),
                              stan::model::index_uni(m)), 1)))) ||
                     stan::math::primitive_value(
                       stan::math::logical_eq(
                         stan::model::rvalue(has_assoc, "has_assoc",
                           stan::model::index_uni(13),
                           stan::model::index_uni(m)), 1))))
                  ||
                  stan::math::primitive_value(
                    stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(14), stan::model::index_uni(m)),
                      1)))) {
                current_statement__ = 202;
                stan::math::validate_non_negative_index("eta_tmp",
                  "nrow_y_Xq[m]",
                  stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                    stan::model::index_uni(m)));
                Eigen::Matrix<local_scalar_t__,-1,1> eta_tmp =
                  Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    m)),
                    DUMMY_VAR__);
                current_statement__ = 218;
                if (stan::math::logical_eq(m, 1)) {
                  int bMat1_colshift = std::numeric_limits<int>::min();
                  current_statement__ = 214;
                  bMat1_colshift = 0;
                  int bMat2_colshift = std::numeric_limits<int>::min();
                  current_statement__ = 215;
                  bMat2_colshift = 0;
                  current_statement__ = 216;
                  stan::model::assign(eta_tmp,
                    evaluate_eta(y1_xq_eta, y1_z1q_eta, y1_z2q_eta,
                      y1_z1q_id_eta, y1_z2q_id_eta, yGamma1, yBeta1, bMat1,
                      bMat2, bMat1_colshift, bMat2_colshift,
                      stan::model::rvalue(intercept_type, "intercept_type",
                        stan::model::index_uni(1)), y1_offset_eta, pstream__),
                    "assigning variable eta_tmp");
                } else {
                  current_statement__ = 213;
                  if (stan::math::logical_eq(m, 2)) {
                    int bMat1_colshift = std::numeric_limits<int>::min();
                    current_statement__ = 209;
                    bMat1_colshift = stan::model::rvalue(bK1_len, "bK1_len",
                                       stan::model::index_uni(1));
                    int bMat2_colshift = std::numeric_limits<int>::min();
                    current_statement__ = 210;
                    bMat2_colshift = stan::model::rvalue(bK2_len, "bK2_len",
                                       stan::model::index_uni(1));
                    current_statement__ = 211;
                    stan::model::assign(eta_tmp,
                      evaluate_eta(y2_xq_eta, y2_z1q_eta, y2_z2q_eta,
                        y2_z1q_id_eta, y2_z2q_id_eta, yGamma2, yBeta2, bMat1,
                        bMat2, bMat1_colshift, bMat2_colshift,
                        stan::model::rvalue(intercept_type, "intercept_type",
                          stan::model::index_uni(2)), y2_offset_eta,
                        pstream__), "assigning variable eta_tmp");
                  } else {
                    current_statement__ = 208;
                    if (stan::math::logical_eq(m, 3)) {
                      int bMat1_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 204;
                      bMat1_colshift = stan::math::sum(
                                         stan::model::rvalue(bK1_len,
                                           "bK1_len",
                                           stan::model::index_min_max(1, 2)));
                      int bMat2_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 205;
                      bMat2_colshift = stan::math::sum(
                                         stan::model::rvalue(bK2_len,
                                           "bK2_len",
                                           stan::model::index_min_max(1, 2)));
                      current_statement__ = 206;
                      stan::model::assign(eta_tmp,
                        evaluate_eta(y3_xq_eta, y3_z1q_eta, y3_z2q_eta,
                          y3_z1q_id_eta, y3_z2q_id_eta, yGamma3, yBeta3,
                          bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                          stan::model::rvalue(intercept_type,
                            "intercept_type", stan::model::index_uni(3)),
                          y3_offset_eta, pstream__),
                        "assigning variable eta_tmp");
                    }
                  }
                }
                current_statement__ = 229;
                if (stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(1), stan::model::index_uni(m)),
                      1)) {
                  current_statement__ = 219;
                  stan::math::validate_non_negative_index("val", "nrow_e_Xq",
                    nrow_e_Xq);
                  Eigen::Matrix<local_scalar_t__,-1,1> val =
                    Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_e_Xq,
                      DUMMY_VAR__);
                  current_statement__ = 225;
                  if (stan::math::logical_eq(
                        stan::model::rvalue(has_grp, "has_grp",
                          stan::model::index_uni(m)), 0)) {
                    current_statement__ = 223;
                    stan::model::assign(val, eta_tmp,
                      "assigning variable val");
                  } else {
                    current_statement__ = 221;
                    stan::model::assign(val,
                      collapse_within_groups(eta_tmp, grp_idx, grp_assoc,
                        pstream__), "assigning variable val");
                  }
                  current_statement__ = 226;
                  mark = (mark + 1);
                  current_statement__ = 227;
                  stan::model::assign(e_eta_q,
                    stan::math::add(stan::model::deep_copy(e_eta_q),
                      stan::math::multiply(
                        (stan::model::rvalue(a_beta, "a_beta",
                           stan::model::index_uni(mark)) *
                        stan::model::rvalue(a_scale, "a_scale",
                          stan::model::index_uni(mark))),
                        stan::math::subtract(val,
                          stan::model::rvalue(a_xbar, "a_xbar",
                            stan::model::index_uni(mark))))),
                    "assigning variable e_eta_q");
                }
                current_statement__ = 245;
                if (stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(9), stan::model::index_uni(m)),
                      1)) {
                  int J = std::numeric_limits<int>::min();
                  current_statement__ = 230;
                  J = stan::model::rvalue(a_K_data, "a_K_data",
                        stan::model::index_uni(mark2));
                  int j_shift = std::numeric_limits<int>::min();
                  current_statement__ = 231;
                  j_shift = (stan::math::logical_eq(mark2, 1) ? 0 : stan::math::sum(
                                                                    stan::model::rvalue(
                                                                    a_K_data,
                                                                    "a_K_data",
                                                                    stan::model::index_min_max(
                                                                    1, (mark2
                                                                    - 1)))));
                  current_statement__ = 243;
                  for (int j = 1; j <= J; ++j) {
                    current_statement__ = 232;
                    stan::math::validate_non_negative_index("val",
                      "nrow_e_Xq", nrow_e_Xq);
                    Eigen::Matrix<local_scalar_t__,-1,1> val =
                      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_e_Xq,
                        DUMMY_VAR__);
                    int sel = std::numeric_limits<int>::min();
                    current_statement__ = 234;
                    sel = (j_shift + j);
                    current_statement__ = 239;
                    if (stan::math::logical_eq(
                          stan::model::rvalue(has_grp, "has_grp",
                            stan::model::index_uni(m)), 0)) {
                      current_statement__ = 237;
                      stan::model::assign(val,
                        stan::math::elt_multiply(eta_tmp,
                          stan::model::rvalue(y_Xq_data, "y_Xq_data",
                            stan::model::index_min_max(
                              stan::model::rvalue(idx_q, "idx_q",
                                stan::model::index_uni(m),
                                stan::model::index_uni(1)),
                              stan::model::rvalue(idx_q, "idx_q",
                                stan::model::index_uni(m),
                                stan::model::index_uni(2))),
                            stan::model::index_uni(sel))),
                        "assigning variable val");
                    } else {
                      current_statement__ = 235;
                      stan::model::assign(val,
                        collapse_within_groups(
                          stan::math::elt_multiply(eta_tmp,
                            stan::model::rvalue(y_Xq_data, "y_Xq_data",
                              stan::model::index_min_max(
                                stan::model::rvalue(idx_q, "idx_q",
                                  stan::model::index_uni(m),
                                  stan::model::index_uni(1)),
                                stan::model::rvalue(idx_q, "idx_q",
                                  stan::model::index_uni(m),
                                  stan::model::index_uni(2))),
                              stan::model::index_uni(sel))), grp_idx,
                          grp_assoc, pstream__), "assigning variable val");
                    }
                    current_statement__ = 240;
                    mark = (mark + 1);
                    current_statement__ = 241;
                    stan::model::assign(e_eta_q,
                      stan::math::add(stan::model::deep_copy(e_eta_q),
                        stan::math::multiply(
                          (stan::model::rvalue(a_beta, "a_beta",
                             stan::model::index_uni(mark)) *
                          stan::model::rvalue(a_scale, "a_scale",
                            stan::model::index_uni(mark))),
                          stan::math::subtract(val,
                            stan::model::rvalue(a_xbar, "a_xbar",
                              stan::model::index_uni(mark))))),
                      "assigning variable e_eta_q");
                  }
                }
                current_statement__ = 246;
                mark3 = (mark3 + 1);
                current_statement__ = 274;
                if (stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(13), stan::model::index_uni(m)),
                      1)) {
                  current_statement__ = 272;
                  for (int j = 1; j <=
                       stan::model::rvalue(size_which_interactions,
                         "size_which_interactions",
                         stan::model::index_uni(mark3)); ++j) {
                    int j_shift = std::numeric_limits<int>::min();
                    current_statement__ = 247;
                    j_shift = (stan::math::logical_eq(mark3, 1) ? 0 : 
                      stan::math::sum(
                        stan::model::rvalue(size_which_interactions,
                          "size_which_interactions",
                          stan::model::index_min_max(1, (mark3 - 1)))));
                    int sel = std::numeric_limits<int>::min();
                    current_statement__ = 248;
                    sel = stan::model::rvalue(which_interactions,
                            "which_interactions",
                            stan::model::index_uni((j + j_shift)));
                    current_statement__ = 249;
                    stan::math::validate_non_negative_index("val",
                      "nrow_e_Xq", nrow_e_Xq);
                    Eigen::Matrix<local_scalar_t__,-1,1> val =
                      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_e_Xq,
                        DUMMY_VAR__);
                    current_statement__ = 251;
                    stan::math::validate_non_negative_index("eta_tmp2",
                      "nrow_y_Xq[sel]",
                      stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                        stan::model::index_uni(sel)));
                    Eigen::Matrix<local_scalar_t__,-1,1> eta_tmp2 =
                      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(
                        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                          stan::model::index_uni(sel)), DUMMY_VAR__);
                    current_statement__ = 267;
                    if (stan::math::logical_eq(sel, 1)) {
                      int bMat1_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 263;
                      bMat1_colshift = 0;
                      int bMat2_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 264;
                      bMat2_colshift = 0;
                      current_statement__ = 265;
                      stan::model::assign(eta_tmp2,
                        evaluate_eta(y1_xq_eta, y1_z1q_eta, y1_z2q_eta,
                          y1_z1q_id_eta, y1_z2q_id_eta, yGamma1, yBeta1,
                          bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                          stan::model::rvalue(intercept_type,
                            "intercept_type", stan::model::index_uni(1)),
                          y1_offset_eta, pstream__),
                        "assigning variable eta_tmp2");
                    } else {
                      current_statement__ = 262;
                      if (stan::math::logical_eq(sel, 2)) {
                        int bMat1_colshift = std::numeric_limits<int>::min();
                        current_statement__ = 258;
                        bMat1_colshift = stan::model::rvalue(bK1_len,
                                           "bK1_len",
                                           stan::model::index_uni(1));
                        int bMat2_colshift = std::numeric_limits<int>::min();
                        current_statement__ = 259;
                        bMat2_colshift = stan::model::rvalue(bK2_len,
                                           "bK2_len",
                                           stan::model::index_uni(1));
                        current_statement__ = 260;
                        stan::model::assign(eta_tmp2,
                          evaluate_eta(y2_xq_eta, y2_z1q_eta, y2_z2q_eta,
                            y2_z1q_id_eta, y2_z2q_id_eta, yGamma2, yBeta2,
                            bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                            stan::model::rvalue(intercept_type,
                              "intercept_type", stan::model::index_uni(2)),
                            y2_offset_eta, pstream__),
                          "assigning variable eta_tmp2");
                      } else {
                        current_statement__ = 257;
                        if (stan::math::logical_eq(sel, 3)) {
                          int bMat1_colshift =
                            std::numeric_limits<int>::min();
                          current_statement__ = 253;
                          bMat1_colshift = stan::math::sum(
                                             stan::model::rvalue(bK1_len,
                                               "bK1_len",
                                               stan::model::index_min_max(1,
                                                 2)));
                          int bMat2_colshift =
                            std::numeric_limits<int>::min();
                          current_statement__ = 254;
                          bMat2_colshift = stan::math::sum(
                                             stan::model::rvalue(bK2_len,
                                               "bK2_len",
                                               stan::model::index_min_max(1,
                                                 2)));
                          current_statement__ = 255;
                          stan::model::assign(eta_tmp2,
                            evaluate_eta(y3_xq_eta, y3_z1q_eta, y3_z2q_eta,
                              y3_z1q_id_eta, y3_z2q_id_eta, yGamma3, yBeta3,
                              bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                              stan::model::rvalue(intercept_type,
                                "intercept_type", stan::model::index_uni(3)),
                              y3_offset_eta, pstream__),
                            "assigning variable eta_tmp2");
                        }
                      }
                    }
                    current_statement__ = 268;
                    stan::model::assign(val,
                      stan::math::elt_multiply(eta_tmp, eta_tmp2),
                      "assigning variable val");
                    current_statement__ = 269;
                    mark = (mark + 1);
                    current_statement__ = 270;
                    stan::model::assign(e_eta_q,
                      stan::math::add(stan::model::deep_copy(e_eta_q),
                        stan::math::multiply(
                          (stan::model::rvalue(a_beta, "a_beta",
                             stan::model::index_uni(mark)) *
                          stan::model::rvalue(a_scale, "a_scale",
                            stan::model::index_uni(mark))),
                          stan::math::subtract(val,
                            stan::model::rvalue(a_xbar, "a_xbar",
                              stan::model::index_uni(mark))))),
                      "assigning variable e_eta_q");
                  }
                }
                current_statement__ = 275;
                mark3 = (mark3 + 1);
                current_statement__ = 306;
                if (stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(14), stan::model::index_uni(m)),
                      1)) {
                  current_statement__ = 304;
                  for (int j = 1; j <=
                       stan::model::rvalue(size_which_interactions,
                         "size_which_interactions",
                         stan::model::index_uni(mark3)); ++j) {
                    int j_shift = std::numeric_limits<int>::min();
                    current_statement__ = 276;
                    j_shift = (stan::math::logical_eq(mark3, 1) ? 0 : 
                      stan::math::sum(
                        stan::model::rvalue(size_which_interactions,
                          "size_which_interactions",
                          stan::model::index_min_max(1, (mark3 - 1)))));
                    int sel = std::numeric_limits<int>::min();
                    current_statement__ = 277;
                    sel = stan::model::rvalue(which_interactions,
                            "which_interactions",
                            stan::model::index_uni((j + j_shift)));
                    current_statement__ = 278;
                    stan::math::validate_non_negative_index("val",
                      "nrow_e_Xq", nrow_e_Xq);
                    Eigen::Matrix<local_scalar_t__,-1,1> val =
                      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_e_Xq,
                        DUMMY_VAR__);
                    current_statement__ = 280;
                    stan::math::validate_non_negative_index("mu_tmp2",
                      "nrow_y_Xq[sel]",
                      stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                        stan::model::index_uni(sel)));
                    Eigen::Matrix<local_scalar_t__,-1,1> mu_tmp2 =
                      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(
                        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                          stan::model::index_uni(sel)), DUMMY_VAR__);
                    current_statement__ = 282;
                    stan::math::validate_non_negative_index("eta_tmp2",
                      "nrow_y_Xq[sel]",
                      stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                        stan::model::index_uni(sel)));
                    Eigen::Matrix<local_scalar_t__,-1,1> eta_tmp2 =
                      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(
                        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                          stan::model::index_uni(sel)), DUMMY_VAR__);
                    current_statement__ = 298;
                    if (stan::math::logical_eq(sel, 1)) {
                      int bMat1_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 294;
                      bMat1_colshift = 0;
                      int bMat2_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 295;
                      bMat2_colshift = 0;
                      current_statement__ = 296;
                      stan::model::assign(eta_tmp2,
                        evaluate_eta(y1_xq_eta, y1_z1q_eta, y1_z2q_eta,
                          y1_z1q_id_eta, y1_z2q_id_eta, yGamma1, yBeta1,
                          bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                          stan::model::rvalue(intercept_type,
                            "intercept_type", stan::model::index_uni(1)),
                          y1_offset_eta, pstream__),
                        "assigning variable eta_tmp2");
                    } else {
                      current_statement__ = 293;
                      if (stan::math::logical_eq(sel, 2)) {
                        int bMat1_colshift = std::numeric_limits<int>::min();
                        current_statement__ = 289;
                        bMat1_colshift = stan::model::rvalue(bK1_len,
                                           "bK1_len",
                                           stan::model::index_uni(1));
                        int bMat2_colshift = std::numeric_limits<int>::min();
                        current_statement__ = 290;
                        bMat2_colshift = stan::model::rvalue(bK2_len,
                                           "bK2_len",
                                           stan::model::index_uni(1));
                        current_statement__ = 291;
                        stan::model::assign(eta_tmp2,
                          evaluate_eta(y2_xq_eta, y2_z1q_eta, y2_z2q_eta,
                            y2_z1q_id_eta, y2_z2q_id_eta, yGamma2, yBeta2,
                            bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                            stan::model::rvalue(intercept_type,
                              "intercept_type", stan::model::index_uni(2)),
                            y2_offset_eta, pstream__),
                          "assigning variable eta_tmp2");
                      } else {
                        current_statement__ = 288;
                        if (stan::math::logical_eq(sel, 3)) {
                          int bMat1_colshift =
                            std::numeric_limits<int>::min();
                          current_statement__ = 284;
                          bMat1_colshift = stan::math::sum(
                                             stan::model::rvalue(bK1_len,
                                               "bK1_len",
                                               stan::model::index_min_max(1,
                                                 2)));
                          int bMat2_colshift =
                            std::numeric_limits<int>::min();
                          current_statement__ = 285;
                          bMat2_colshift = stan::math::sum(
                                             stan::model::rvalue(bK2_len,
                                               "bK2_len",
                                               stan::model::index_min_max(1,
                                                 2)));
                          current_statement__ = 286;
                          stan::model::assign(eta_tmp2,
                            evaluate_eta(y3_xq_eta, y3_z1q_eta, y3_z2q_eta,
                              y3_z1q_id_eta, y3_z2q_id_eta, yGamma3, yBeta3,
                              bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                              stan::model::rvalue(intercept_type,
                                "intercept_type", stan::model::index_uni(3)),
                              y3_offset_eta, pstream__),
                            "assigning variable eta_tmp2");
                        }
                      }
                    }
                    current_statement__ = 299;
                    stan::model::assign(mu_tmp2,
                      evaluate_mu(eta_tmp2,
                        stan::model::rvalue(family, "family",
                          stan::model::index_uni(sel)),
                        stan::model::rvalue(link, "link",
                          stan::model::index_uni(sel)), pstream__),
                      "assigning variable mu_tmp2");
                    current_statement__ = 300;
                    stan::model::assign(val,
                      stan::math::elt_multiply(eta_tmp, mu_tmp2),
                      "assigning variable val");
                    current_statement__ = 301;
                    mark = (mark + 1);
                    current_statement__ = 302;
                    stan::model::assign(e_eta_q,
                      stan::math::add(stan::model::deep_copy(e_eta_q),
                        stan::math::multiply(
                          (stan::model::rvalue(a_beta, "a_beta",
                             stan::model::index_uni(mark)) *
                          stan::model::rvalue(a_scale, "a_scale",
                            stan::model::index_uni(mark))),
                          stan::math::subtract(val,
                            stan::model::rvalue(a_xbar, "a_xbar",
                              stan::model::index_uni(mark))))),
                      "assigning variable e_eta_q");
                  }
                }
              } else {
                current_statement__ = 200;
                mark3 = (mark3 + 2);
              }
              current_statement__ = 309;
              mark2 = (mark2 + 1);
              current_statement__ = 355;
              if ((stan::math::primitive_value(
                     stan::math::logical_eq(
                       stan::model::rvalue(has_assoc, "has_assoc",
                         stan::model::index_uni(2), stan::model::index_uni(m)),
                       1))
                  ||
                  stan::math::primitive_value(
                    stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(10), stan::model::index_uni(m)),
                      1)))) {
                current_statement__ = 310;
                stan::math::validate_non_negative_index("dydt_eta_q",
                  "nrow_y_Xq[m]",
                  stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                    stan::model::index_uni(m)));
                Eigen::Matrix<local_scalar_t__,-1,1> dydt_eta_q =
                  Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    m)),
                    DUMMY_VAR__);
                current_statement__ = 326;
                if (stan::math::logical_eq(m, 1)) {
                  int bMat1_colshift = std::numeric_limits<int>::min();
                  current_statement__ = 322;
                  bMat1_colshift = 0;
                  int bMat2_colshift = std::numeric_limits<int>::min();
                  current_statement__ = 323;
                  bMat2_colshift = 0;
                  current_statement__ = 324;
                  stan::model::assign(dydt_eta_q,
                    evaluate_eta(y1_xq_eps, y1_z1q_eps, y1_z2q_eps,
                      y1_z1q_id_eps, y1_z2q_id_eps, yGamma1, yBeta1, bMat1,
                      bMat2, bMat1_colshift, bMat2_colshift, 0,
                      y1_offset_eps, pstream__),
                    "assigning variable dydt_eta_q");
                } else {
                  current_statement__ = 321;
                  if (stan::math::logical_eq(m, 2)) {
                    int bMat1_colshift = std::numeric_limits<int>::min();
                    current_statement__ = 317;
                    bMat1_colshift = stan::model::rvalue(bK1_len, "bK1_len",
                                       stan::model::index_uni(1));
                    int bMat2_colshift = std::numeric_limits<int>::min();
                    current_statement__ = 318;
                    bMat2_colshift = stan::model::rvalue(bK2_len, "bK2_len",
                                       stan::model::index_uni(1));
                    current_statement__ = 319;
                    stan::model::assign(dydt_eta_q,
                      evaluate_eta(y2_xq_eps, y2_z1q_eps, y2_z2q_eps,
                        y2_z1q_id_eps, y2_z2q_id_eps, yGamma2, yBeta2, bMat1,
                        bMat2, bMat1_colshift, bMat2_colshift, 0,
                        y2_offset_eps, pstream__),
                      "assigning variable dydt_eta_q");
                  } else {
                    current_statement__ = 316;
                    if (stan::math::logical_eq(m, 3)) {
                      int bMat1_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 312;
                      bMat1_colshift = stan::math::sum(
                                         stan::model::rvalue(bK1_len,
                                           "bK1_len",
                                           stan::model::index_min_max(1, 2)));
                      int bMat2_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 313;
                      bMat2_colshift = stan::math::sum(
                                         stan::model::rvalue(bK2_len,
                                           "bK2_len",
                                           stan::model::index_min_max(1, 2)));
                      current_statement__ = 314;
                      stan::model::assign(dydt_eta_q,
                        evaluate_eta(y3_xq_eps, y3_z1q_eps, y3_z2q_eps,
                          y3_z1q_id_eps, y3_z2q_id_eps, yGamma3, yBeta3,
                          bMat1, bMat2, bMat1_colshift, bMat2_colshift, 0,
                          y3_offset_eps, pstream__),
                        "assigning variable dydt_eta_q");
                    }
                  }
                }
                current_statement__ = 337;
                if (stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(2), stan::model::index_uni(m)),
                      1)) {
                  current_statement__ = 327;
                  stan::math::validate_non_negative_index("val", "nrow_e_Xq",
                    nrow_e_Xq);
                  Eigen::Matrix<local_scalar_t__,-1,1> val =
                    Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_e_Xq,
                      DUMMY_VAR__);
                  current_statement__ = 333;
                  if (stan::math::logical_eq(
                        stan::model::rvalue(has_grp, "has_grp",
                          stan::model::index_uni(m)), 0)) {
                    current_statement__ = 331;
                    stan::model::assign(val, dydt_eta_q,
                      "assigning variable val");
                  } else {
                    current_statement__ = 329;
                    stan::model::assign(val,
                      collapse_within_groups(dydt_eta_q, grp_idx, grp_assoc,
                        pstream__), "assigning variable val");
                  }
                  current_statement__ = 334;
                  mark = (mark + 1);
                  current_statement__ = 335;
                  stan::model::assign(e_eta_q,
                    stan::math::add(stan::model::deep_copy(e_eta_q),
                      stan::math::multiply(
                        (stan::model::rvalue(a_beta, "a_beta",
                           stan::model::index_uni(mark)) *
                        stan::model::rvalue(a_scale, "a_scale",
                          stan::model::index_uni(mark))),
                        stan::math::subtract(val,
                          stan::model::rvalue(a_xbar, "a_xbar",
                            stan::model::index_uni(mark))))),
                    "assigning variable e_eta_q");
                }
                current_statement__ = 353;
                if (stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(10), stan::model::index_uni(m)),
                      1)) {
                  int J = std::numeric_limits<int>::min();
                  current_statement__ = 338;
                  J = stan::model::rvalue(a_K_data, "a_K_data",
                        stan::model::index_uni(mark2));
                  int j_shift = std::numeric_limits<int>::min();
                  current_statement__ = 339;
                  j_shift = (stan::math::logical_eq(mark2, 1) ? 0 : stan::math::sum(
                                                                    stan::model::rvalue(
                                                                    a_K_data,
                                                                    "a_K_data",
                                                                    stan::model::index_min_max(
                                                                    1, (mark2
                                                                    - 1)))));
                  current_statement__ = 351;
                  for (int j = 1; j <= J; ++j) {
                    current_statement__ = 340;
                    stan::math::validate_non_negative_index("val",
                      "nrow_e_Xq", nrow_e_Xq);
                    Eigen::Matrix<local_scalar_t__,-1,1> val =
                      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_e_Xq,
                        DUMMY_VAR__);
                    int sel = std::numeric_limits<int>::min();
                    current_statement__ = 342;
                    sel = (j_shift + j);
                    current_statement__ = 347;
                    if (stan::math::logical_eq(
                          stan::model::rvalue(has_grp, "has_grp",
                            stan::model::index_uni(m)), 0)) {
                      current_statement__ = 345;
                      stan::model::assign(val,
                        stan::math::elt_multiply(dydt_eta_q,
                          stan::model::rvalue(y_Xq_data, "y_Xq_data",
                            stan::model::index_min_max(
                              stan::model::rvalue(idx_q, "idx_q",
                                stan::model::index_uni(m),
                                stan::model::index_uni(1)),
                              stan::model::rvalue(idx_q, "idx_q",
                                stan::model::index_uni(m),
                                stan::model::index_uni(2))),
                            stan::model::index_uni(sel))),
                        "assigning variable val");
                    } else {
                      current_statement__ = 343;
                      stan::model::assign(val,
                        collapse_within_groups(
                          stan::math::elt_multiply(dydt_eta_q,
                            stan::model::rvalue(y_Xq_data, "y_Xq_data",
                              stan::model::index_min_max(
                                stan::model::rvalue(idx_q, "idx_q",
                                  stan::model::index_uni(m),
                                  stan::model::index_uni(1)),
                                stan::model::rvalue(idx_q, "idx_q",
                                  stan::model::index_uni(m),
                                  stan::model::index_uni(2))),
                              stan::model::index_uni(sel))), grp_idx,
                          grp_assoc, pstream__), "assigning variable val");
                    }
                    current_statement__ = 348;
                    mark = (mark + 1);
                    current_statement__ = 349;
                    stan::model::assign(e_eta_q,
                      stan::math::add(stan::model::deep_copy(e_eta_q),
                        stan::math::multiply(
                          (stan::model::rvalue(a_beta, "a_beta",
                             stan::model::index_uni(mark)) *
                          stan::model::rvalue(a_scale, "a_scale",
                            stan::model::index_uni(mark))),
                          stan::math::subtract(val,
                            stan::model::rvalue(a_xbar, "a_xbar",
                              stan::model::index_uni(mark))))),
                      "assigning variable e_eta_q");
                  }
                }
              }
              current_statement__ = 387;
              if (stan::math::logical_eq(
                    stan::model::rvalue(has_assoc, "has_assoc",
                      stan::model::index_uni(3), stan::model::index_uni(m)),
                    1)) {
                current_statement__ = 356;
                stan::math::validate_non_negative_index("eta_auc_tmp",
                  "nrow_y_Xq_auc", nrow_y_Xq_auc);
                Eigen::Matrix<local_scalar_t__,-1,1> eta_auc_tmp =
                  Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_y_Xq_auc,
                    DUMMY_VAR__);
                current_statement__ = 358;
                stan::math::validate_non_negative_index("val",
                  "nrow_y_Xq[m]",
                  stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                    stan::model::index_uni(m)));
                Eigen::Matrix<local_scalar_t__,-1,1> val =
                  Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    m)),
                    DUMMY_VAR__);
                current_statement__ = 374;
                if (stan::math::logical_eq(m, 1)) {
                  int bMat1_colshift = std::numeric_limits<int>::min();
                  current_statement__ = 370;
                  bMat1_colshift = 0;
                  int bMat2_colshift = std::numeric_limits<int>::min();
                  current_statement__ = 371;
                  bMat2_colshift = 0;
                  current_statement__ = 372;
                  stan::model::assign(eta_auc_tmp,
                    evaluate_eta(y1_xq_auc, y1_z1q_auc, y1_z2q_auc,
                      y1_z1q_id_auc, y1_z2q_id_auc, yGamma1, yBeta1, bMat1,
                      bMat2, bMat1_colshift, bMat2_colshift,
                      stan::model::rvalue(intercept_type, "intercept_type",
                        stan::model::index_uni(1)), y1_offset_auc, pstream__),
                    "assigning variable eta_auc_tmp");
                } else {
                  current_statement__ = 369;
                  if (stan::math::logical_eq(m, 2)) {
                    int bMat1_colshift = std::numeric_limits<int>::min();
                    current_statement__ = 365;
                    bMat1_colshift = stan::model::rvalue(bK1_len, "bK1_len",
                                       stan::model::index_uni(1));
                    int bMat2_colshift = std::numeric_limits<int>::min();
                    current_statement__ = 366;
                    bMat2_colshift = stan::model::rvalue(bK2_len, "bK2_len",
                                       stan::model::index_uni(1));
                    current_statement__ = 367;
                    stan::model::assign(eta_auc_tmp,
                      evaluate_eta(y2_xq_auc, y2_z1q_auc, y2_z2q_auc,
                        y2_z1q_id_auc, y2_z2q_id_auc, yGamma2, yBeta2, bMat1,
                        bMat2, bMat1_colshift, bMat2_colshift,
                        stan::model::rvalue(intercept_type, "intercept_type",
                          stan::model::index_uni(2)), y2_offset_auc,
                        pstream__), "assigning variable eta_auc_tmp");
                  } else {
                    current_statement__ = 364;
                    if (stan::math::logical_eq(m, 3)) {
                      int bMat1_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 360;
                      bMat1_colshift = stan::math::sum(
                                         stan::model::rvalue(bK1_len,
                                           "bK1_len",
                                           stan::model::index_min_max(1, 2)));
                      int bMat2_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 361;
                      bMat2_colshift = stan::math::sum(
                                         stan::model::rvalue(bK2_len,
                                           "bK2_len",
                                           stan::model::index_min_max(1, 2)));
                      current_statement__ = 362;
                      stan::model::assign(eta_auc_tmp,
                        evaluate_eta(y3_xq_auc, y3_z1q_auc, y3_z2q_auc,
                          y3_z1q_id_auc, y3_z2q_id_auc, yGamma3, yBeta3,
                          bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                          stan::model::rvalue(intercept_type,
                            "intercept_type", stan::model::index_uni(3)),
                          y3_offset_auc, pstream__),
                        "assigning variable eta_auc_tmp");
                    }
                  }
                }
                current_statement__ = 375;
                mark = (mark + 1);
                current_statement__ = 384;
                for (int r = 1; r <=
                     stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                       stan::model::index_uni(m)); ++r) {
                  current_statement__ = 376;
                  stan::math::validate_non_negative_index("val_tmp",
                    "auc_qnodes", auc_qnodes);
                  Eigen::Matrix<local_scalar_t__,-1,1> val_tmp =
                    Eigen::Matrix<local_scalar_t__,-1,1>::Constant(auc_qnodes,
                      DUMMY_VAR__);
                  current_statement__ = 378;
                  stan::math::validate_non_negative_index("wgt_tmp",
                    "auc_qnodes", auc_qnodes);
                  Eigen::Matrix<local_scalar_t__,-1,1> wgt_tmp =
                    Eigen::Matrix<local_scalar_t__,-1,1>::Constant(auc_qnodes,
                      DUMMY_VAR__);
                  current_statement__ = 380;
                  stan::model::assign(val_tmp,
                    stan::model::rvalue(eta_auc_tmp, "eta_auc_tmp",
                      stan::model::index_min_max((((r - 1) * auc_qnodes) +
                        1), (r * auc_qnodes))), "assigning variable val_tmp");
                  current_statement__ = 381;
                  stan::model::assign(wgt_tmp,
                    stan::model::rvalue(auc_qwts, "auc_qwts",
                      stan::model::index_min_max((((r - 1) * auc_qnodes) +
                        1), (r * auc_qnodes))), "assigning variable wgt_tmp");
                  current_statement__ = 382;
                  stan::model::assign(val,
                    stan::math::sum(
                      stan::math::elt_multiply(wgt_tmp, val_tmp)),
                    "assigning variable val", stan::model::index_uni(r));
                }
                current_statement__ = 385;
                stan::model::assign(e_eta_q,
                  stan::math::add(stan::model::deep_copy(e_eta_q),
                    stan::math::multiply(
                      (stan::model::rvalue(a_beta, "a_beta",
                         stan::model::index_uni(mark)) *
                      stan::model::rvalue(a_scale, "a_scale",
                        stan::model::index_uni(mark))),
                      stan::math::subtract(val,
                        stan::model::rvalue(a_xbar, "a_xbar",
                          stan::model::index_uni(mark))))),
                  "assigning variable e_eta_q");
              }
              current_statement__ = 388;
              mark2 = (mark2 + 1);
              current_statement__ = 500;
              if ((stan::math::primitive_value(
                     (stan::math::primitive_value(
                        (stan::math::primitive_value(
                           stan::math::logical_eq(
                             stan::model::rvalue(has_assoc, "has_assoc",
                               stan::model::index_uni(4),
                               stan::model::index_uni(m)), 1)) ||
                        stan::math::primitive_value(
                          stan::math::logical_eq(
                            stan::model::rvalue(has_assoc, "has_assoc",
                              stan::model::index_uni(11),
                              stan::model::index_uni(m)), 1)))) ||
                     stan::math::primitive_value(
                       stan::math::logical_eq(
                         stan::model::rvalue(has_assoc, "has_assoc",
                           stan::model::index_uni(15),
                           stan::model::index_uni(m)), 1))))
                  ||
                  stan::math::primitive_value(
                    stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(16), stan::model::index_uni(m)),
                      1)))) {
                current_statement__ = 391;
                stan::math::validate_non_negative_index("mu_tmp",
                  "nrow_y_Xq[m]",
                  stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                    stan::model::index_uni(m)));
                Eigen::Matrix<local_scalar_t__,-1,1> mu_tmp =
                  Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    m)),
                    DUMMY_VAR__);
                current_statement__ = 393;
                stan::math::validate_non_negative_index("eta_tmp",
                  "nrow_y_Xq[m]",
                  stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                    stan::model::index_uni(m)));
                Eigen::Matrix<local_scalar_t__,-1,1> eta_tmp =
                  Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    m)),
                    DUMMY_VAR__);
                current_statement__ = 409;
                if (stan::math::logical_eq(m, 1)) {
                  int bMat1_colshift = std::numeric_limits<int>::min();
                  current_statement__ = 405;
                  bMat1_colshift = 0;
                  int bMat2_colshift = std::numeric_limits<int>::min();
                  current_statement__ = 406;
                  bMat2_colshift = 0;
                  current_statement__ = 407;
                  stan::model::assign(eta_tmp,
                    evaluate_eta(y1_xq_eta, y1_z1q_eta, y1_z2q_eta,
                      y1_z1q_id_eta, y1_z2q_id_eta, yGamma1, yBeta1, bMat1,
                      bMat2, bMat1_colshift, bMat2_colshift,
                      stan::model::rvalue(intercept_type, "intercept_type",
                        stan::model::index_uni(1)), y1_offset_eta, pstream__),
                    "assigning variable eta_tmp");
                } else {
                  current_statement__ = 404;
                  if (stan::math::logical_eq(m, 2)) {
                    int bMat1_colshift = std::numeric_limits<int>::min();
                    current_statement__ = 400;
                    bMat1_colshift = stan::model::rvalue(bK1_len, "bK1_len",
                                       stan::model::index_uni(1));
                    int bMat2_colshift = std::numeric_limits<int>::min();
                    current_statement__ = 401;
                    bMat2_colshift = stan::model::rvalue(bK2_len, "bK2_len",
                                       stan::model::index_uni(1));
                    current_statement__ = 402;
                    stan::model::assign(eta_tmp,
                      evaluate_eta(y2_xq_eta, y2_z1q_eta, y2_z2q_eta,
                        y2_z1q_id_eta, y2_z2q_id_eta, yGamma2, yBeta2, bMat1,
                        bMat2, bMat1_colshift, bMat2_colshift,
                        stan::model::rvalue(intercept_type, "intercept_type",
                          stan::model::index_uni(2)), y2_offset_eta,
                        pstream__), "assigning variable eta_tmp");
                  } else {
                    current_statement__ = 399;
                    if (stan::math::logical_eq(m, 3)) {
                      int bMat1_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 395;
                      bMat1_colshift = stan::math::sum(
                                         stan::model::rvalue(bK1_len,
                                           "bK1_len",
                                           stan::model::index_min_max(1, 2)));
                      int bMat2_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 396;
                      bMat2_colshift = stan::math::sum(
                                         stan::model::rvalue(bK2_len,
                                           "bK2_len",
                                           stan::model::index_min_max(1, 2)));
                      current_statement__ = 397;
                      stan::model::assign(eta_tmp,
                        evaluate_eta(y3_xq_eta, y3_z1q_eta, y3_z2q_eta,
                          y3_z1q_id_eta, y3_z2q_id_eta, yGamma3, yBeta3,
                          bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                          stan::model::rvalue(intercept_type,
                            "intercept_type", stan::model::index_uni(3)),
                          y3_offset_eta, pstream__),
                        "assigning variable eta_tmp");
                    }
                  }
                }
                current_statement__ = 410;
                stan::model::assign(mu_tmp,
                  evaluate_mu(eta_tmp,
                    stan::model::rvalue(family, "family",
                      stan::model::index_uni(m)),
                    stan::model::rvalue(link, "link",
                      stan::model::index_uni(m)), pstream__),
                  "assigning variable mu_tmp");
                current_statement__ = 421;
                if (stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(4), stan::model::index_uni(m)),
                      1)) {
                  current_statement__ = 411;
                  stan::math::validate_non_negative_index("val", "nrow_e_Xq",
                    nrow_e_Xq);
                  Eigen::Matrix<local_scalar_t__,-1,1> val =
                    Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_e_Xq,
                      DUMMY_VAR__);
                  current_statement__ = 417;
                  if (stan::math::logical_eq(
                        stan::model::rvalue(has_grp, "has_grp",
                          stan::model::index_uni(m)), 0)) {
                    current_statement__ = 415;
                    stan::model::assign(val, mu_tmp, "assigning variable val");
                  } else {
                    current_statement__ = 413;
                    stan::model::assign(val,
                      collapse_within_groups(mu_tmp, grp_idx, grp_assoc,
                        pstream__), "assigning variable val");
                  }
                  current_statement__ = 418;
                  mark = (mark + 1);
                  current_statement__ = 419;
                  stan::model::assign(e_eta_q,
                    stan::math::add(stan::model::deep_copy(e_eta_q),
                      stan::math::multiply(
                        (stan::model::rvalue(a_beta, "a_beta",
                           stan::model::index_uni(mark)) *
                        stan::model::rvalue(a_scale, "a_scale",
                          stan::model::index_uni(mark))),
                        stan::math::subtract(val,
                          stan::model::rvalue(a_xbar, "a_xbar",
                            stan::model::index_uni(mark))))),
                    "assigning variable e_eta_q");
                }
                current_statement__ = 437;
                if (stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(11), stan::model::index_uni(m)),
                      1)) {
                  int tmp = std::numeric_limits<int>::min();
                  current_statement__ = 422;
                  tmp = stan::model::rvalue(a_K_data, "a_K_data",
                          stan::model::index_uni(mark2));
                  int j_shift = std::numeric_limits<int>::min();
                  current_statement__ = 423;
                  j_shift = (stan::math::logical_eq(mark2, 1) ? 0 : stan::math::sum(
                                                                    stan::model::rvalue(
                                                                    a_K_data,
                                                                    "a_K_data",
                                                                    stan::model::index_min_max(
                                                                    1, (mark2
                                                                    - 1)))));
                  current_statement__ = 435;
                  for (int j = 1; j <= tmp; ++j) {
                    current_statement__ = 424;
                    stan::math::validate_non_negative_index("val",
                      "nrow_e_Xq", nrow_e_Xq);
                    Eigen::Matrix<local_scalar_t__,-1,1> val =
                      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_e_Xq,
                        DUMMY_VAR__);
                    int sel = std::numeric_limits<int>::min();
                    current_statement__ = 426;
                    sel = (j_shift + j);
                    current_statement__ = 431;
                    if (stan::math::logical_eq(
                          stan::model::rvalue(has_grp, "has_grp",
                            stan::model::index_uni(m)), 0)) {
                      current_statement__ = 429;
                      stan::model::assign(val,
                        stan::math::elt_multiply(mu_tmp,
                          stan::model::rvalue(y_Xq_data, "y_Xq_data",
                            stan::model::index_min_max(
                              stan::model::rvalue(idx_q, "idx_q",
                                stan::model::index_uni(m),
                                stan::model::index_uni(1)),
                              stan::model::rvalue(idx_q, "idx_q",
                                stan::model::index_uni(m),
                                stan::model::index_uni(2))),
                            stan::model::index_uni(sel))),
                        "assigning variable val");
                    } else {
                      current_statement__ = 427;
                      stan::model::assign(val,
                        collapse_within_groups(
                          stan::math::elt_multiply(mu_tmp,
                            stan::model::rvalue(y_Xq_data, "y_Xq_data",
                              stan::model::index_min_max(
                                stan::model::rvalue(idx_q, "idx_q",
                                  stan::model::index_uni(m),
                                  stan::model::index_uni(1)),
                                stan::model::rvalue(idx_q, "idx_q",
                                  stan::model::index_uni(m),
                                  stan::model::index_uni(2))),
                              stan::model::index_uni(sel))), grp_idx,
                          grp_assoc, pstream__), "assigning variable val");
                    }
                    current_statement__ = 432;
                    mark = (mark + 1);
                    current_statement__ = 433;
                    stan::model::assign(e_eta_q,
                      stan::math::add(stan::model::deep_copy(e_eta_q),
                        stan::math::multiply(
                          (stan::model::rvalue(a_beta, "a_beta",
                             stan::model::index_uni(mark)) *
                          stan::model::rvalue(a_scale, "a_scale",
                            stan::model::index_uni(mark))),
                          stan::math::subtract(val,
                            stan::model::rvalue(a_xbar, "a_xbar",
                              stan::model::index_uni(mark))))),
                      "assigning variable e_eta_q");
                  }
                }
                current_statement__ = 438;
                mark3 = (mark3 + 1);
                current_statement__ = 466;
                if (stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(15), stan::model::index_uni(m)),
                      1)) {
                  current_statement__ = 464;
                  for (int j = 1; j <=
                       stan::model::rvalue(size_which_interactions,
                         "size_which_interactions",
                         stan::model::index_uni(mark3)); ++j) {
                    int j_shift = std::numeric_limits<int>::min();
                    current_statement__ = 439;
                    j_shift = (stan::math::logical_eq(mark3, 1) ? 0 : 
                      stan::math::sum(
                        stan::model::rvalue(size_which_interactions,
                          "size_which_interactions",
                          stan::model::index_min_max(1, (mark3 - 1)))));
                    int sel = std::numeric_limits<int>::min();
                    current_statement__ = 440;
                    sel = stan::model::rvalue(which_interactions,
                            "which_interactions",
                            stan::model::index_uni((j + j_shift)));
                    current_statement__ = 441;
                    stan::math::validate_non_negative_index("val",
                      "nrow_e_Xq", nrow_e_Xq);
                    Eigen::Matrix<local_scalar_t__,-1,1> val =
                      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_e_Xq,
                        DUMMY_VAR__);
                    current_statement__ = 443;
                    stan::math::validate_non_negative_index("eta_tmp2",
                      "nrow_y_Xq[sel]",
                      stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                        stan::model::index_uni(sel)));
                    Eigen::Matrix<local_scalar_t__,-1,1> eta_tmp2 =
                      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(
                        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                          stan::model::index_uni(sel)), DUMMY_VAR__);
                    current_statement__ = 459;
                    if (stan::math::logical_eq(sel, 1)) {
                      int bMat1_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 455;
                      bMat1_colshift = 0;
                      int bMat2_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 456;
                      bMat2_colshift = 0;
                      current_statement__ = 457;
                      stan::model::assign(eta_tmp2,
                        evaluate_eta(y1_xq_eta, y1_z1q_eta, y1_z2q_eta,
                          y1_z1q_id_eta, y1_z2q_id_eta, yGamma1, yBeta1,
                          bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                          stan::model::rvalue(intercept_type,
                            "intercept_type", stan::model::index_uni(1)),
                          y1_offset_eta, pstream__),
                        "assigning variable eta_tmp2");
                    } else {
                      current_statement__ = 454;
                      if (stan::math::logical_eq(sel, 2)) {
                        int bMat1_colshift = std::numeric_limits<int>::min();
                        current_statement__ = 450;
                        bMat1_colshift = stan::model::rvalue(bK1_len,
                                           "bK1_len",
                                           stan::model::index_uni(1));
                        int bMat2_colshift = std::numeric_limits<int>::min();
                        current_statement__ = 451;
                        bMat2_colshift = stan::model::rvalue(bK2_len,
                                           "bK2_len",
                                           stan::model::index_uni(1));
                        current_statement__ = 452;
                        stan::model::assign(eta_tmp2,
                          evaluate_eta(y2_xq_eta, y2_z1q_eta, y2_z2q_eta,
                            y2_z1q_id_eta, y2_z2q_id_eta, yGamma2, yBeta2,
                            bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                            stan::model::rvalue(intercept_type,
                              "intercept_type", stan::model::index_uni(2)),
                            y2_offset_eta, pstream__),
                          "assigning variable eta_tmp2");
                      } else {
                        current_statement__ = 449;
                        if (stan::math::logical_eq(sel, 3)) {
                          int bMat1_colshift =
                            std::numeric_limits<int>::min();
                          current_statement__ = 445;
                          bMat1_colshift = stan::math::sum(
                                             stan::model::rvalue(bK1_len,
                                               "bK1_len",
                                               stan::model::index_min_max(1,
                                                 2)));
                          int bMat2_colshift =
                            std::numeric_limits<int>::min();
                          current_statement__ = 446;
                          bMat2_colshift = stan::math::sum(
                                             stan::model::rvalue(bK2_len,
                                               "bK2_len",
                                               stan::model::index_min_max(1,
                                                 2)));
                          current_statement__ = 447;
                          stan::model::assign(eta_tmp2,
                            evaluate_eta(y3_xq_eta, y3_z1q_eta, y3_z2q_eta,
                              y3_z1q_id_eta, y3_z2q_id_eta, yGamma3, yBeta3,
                              bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                              stan::model::rvalue(intercept_type,
                                "intercept_type", stan::model::index_uni(3)),
                              y3_offset_eta, pstream__),
                            "assigning variable eta_tmp2");
                        }
                      }
                    }
                    current_statement__ = 460;
                    stan::model::assign(val,
                      stan::math::elt_multiply(mu_tmp, eta_tmp2),
                      "assigning variable val");
                    current_statement__ = 461;
                    mark = (mark + 1);
                    current_statement__ = 462;
                    stan::model::assign(e_eta_q,
                      stan::math::add(stan::model::deep_copy(e_eta_q),
                        stan::math::multiply(
                          (stan::model::rvalue(a_beta, "a_beta",
                             stan::model::index_uni(mark)) *
                          stan::model::rvalue(a_scale, "a_scale",
                            stan::model::index_uni(mark))),
                          stan::math::subtract(val,
                            stan::model::rvalue(a_xbar, "a_xbar",
                              stan::model::index_uni(mark))))),
                      "assigning variable e_eta_q");
                  }
                }
                current_statement__ = 467;
                mark3 = (mark3 + 1);
                current_statement__ = 498;
                if (stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(16), stan::model::index_uni(m)),
                      1)) {
                  current_statement__ = 496;
                  for (int j = 1; j <=
                       stan::model::rvalue(size_which_interactions,
                         "size_which_interactions",
                         stan::model::index_uni(mark3)); ++j) {
                    int j_shift = std::numeric_limits<int>::min();
                    current_statement__ = 468;
                    j_shift = (stan::math::logical_eq(mark3, 1) ? 0 : 
                      stan::math::sum(
                        stan::model::rvalue(size_which_interactions,
                          "size_which_interactions",
                          stan::model::index_min_max(1, (mark3 - 1)))));
                    int sel = std::numeric_limits<int>::min();
                    current_statement__ = 469;
                    sel = stan::model::rvalue(which_interactions,
                            "which_interactions",
                            stan::model::index_uni((j + j_shift)));
                    current_statement__ = 470;
                    stan::math::validate_non_negative_index("val",
                      "nrow_e_Xq", nrow_e_Xq);
                    Eigen::Matrix<local_scalar_t__,-1,1> val =
                      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_e_Xq,
                        DUMMY_VAR__);
                    current_statement__ = 472;
                    stan::math::validate_non_negative_index("mu_tmp2",
                      "nrow_y_Xq[sel]",
                      stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                        stan::model::index_uni(sel)));
                    Eigen::Matrix<local_scalar_t__,-1,1> mu_tmp2 =
                      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(
                        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                          stan::model::index_uni(sel)), DUMMY_VAR__);
                    current_statement__ = 474;
                    stan::math::validate_non_negative_index("eta_tmp2",
                      "nrow_y_Xq[sel]",
                      stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                        stan::model::index_uni(sel)));
                    Eigen::Matrix<local_scalar_t__,-1,1> eta_tmp2 =
                      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(
                        stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                          stan::model::index_uni(sel)), DUMMY_VAR__);
                    current_statement__ = 490;
                    if (stan::math::logical_eq(sel, 1)) {
                      int bMat1_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 486;
                      bMat1_colshift = 0;
                      int bMat2_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 487;
                      bMat2_colshift = 0;
                      current_statement__ = 488;
                      stan::model::assign(eta_tmp2,
                        evaluate_eta(y1_xq_eta, y1_z1q_eta, y1_z2q_eta,
                          y1_z1q_id_eta, y1_z2q_id_eta, yGamma1, yBeta1,
                          bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                          stan::model::rvalue(intercept_type,
                            "intercept_type", stan::model::index_uni(1)),
                          y1_offset_eta, pstream__),
                        "assigning variable eta_tmp2");
                    } else {
                      current_statement__ = 485;
                      if (stan::math::logical_eq(sel, 2)) {
                        int bMat1_colshift = std::numeric_limits<int>::min();
                        current_statement__ = 481;
                        bMat1_colshift = stan::model::rvalue(bK1_len,
                                           "bK1_len",
                                           stan::model::index_uni(1));
                        int bMat2_colshift = std::numeric_limits<int>::min();
                        current_statement__ = 482;
                        bMat2_colshift = stan::model::rvalue(bK2_len,
                                           "bK2_len",
                                           stan::model::index_uni(1));
                        current_statement__ = 483;
                        stan::model::assign(eta_tmp2,
                          evaluate_eta(y2_xq_eta, y2_z1q_eta, y2_z2q_eta,
                            y2_z1q_id_eta, y2_z2q_id_eta, yGamma2, yBeta2,
                            bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                            stan::model::rvalue(intercept_type,
                              "intercept_type", stan::model::index_uni(2)),
                            y2_offset_eta, pstream__),
                          "assigning variable eta_tmp2");
                      } else {
                        current_statement__ = 480;
                        if (stan::math::logical_eq(sel, 3)) {
                          int bMat1_colshift =
                            std::numeric_limits<int>::min();
                          current_statement__ = 476;
                          bMat1_colshift = stan::math::sum(
                                             stan::model::rvalue(bK1_len,
                                               "bK1_len",
                                               stan::model::index_min_max(1,
                                                 2)));
                          int bMat2_colshift =
                            std::numeric_limits<int>::min();
                          current_statement__ = 477;
                          bMat2_colshift = stan::math::sum(
                                             stan::model::rvalue(bK2_len,
                                               "bK2_len",
                                               stan::model::index_min_max(1,
                                                 2)));
                          current_statement__ = 478;
                          stan::model::assign(eta_tmp2,
                            evaluate_eta(y3_xq_eta, y3_z1q_eta, y3_z2q_eta,
                              y3_z1q_id_eta, y3_z2q_id_eta, yGamma3, yBeta3,
                              bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                              stan::model::rvalue(intercept_type,
                                "intercept_type", stan::model::index_uni(3)),
                              y3_offset_eta, pstream__),
                            "assigning variable eta_tmp2");
                        }
                      }
                    }
                    current_statement__ = 491;
                    stan::model::assign(mu_tmp2,
                      evaluate_mu(eta_tmp2,
                        stan::model::rvalue(family, "family",
                          stan::model::index_uni(sel)),
                        stan::model::rvalue(link, "link",
                          stan::model::index_uni(sel)), pstream__),
                      "assigning variable mu_tmp2");
                    current_statement__ = 492;
                    stan::model::assign(val,
                      stan::math::elt_multiply(mu_tmp, mu_tmp2),
                      "assigning variable val");
                    current_statement__ = 493;
                    mark = (mark + 1);
                    current_statement__ = 494;
                    stan::model::assign(e_eta_q,
                      stan::math::add(stan::model::deep_copy(e_eta_q),
                        stan::math::multiply(
                          (stan::model::rvalue(a_beta, "a_beta",
                             stan::model::index_uni(mark)) *
                          stan::model::rvalue(a_scale, "a_scale",
                            stan::model::index_uni(mark))),
                          stan::math::subtract(val,
                            stan::model::rvalue(a_xbar, "a_xbar",
                              stan::model::index_uni(mark))))),
                      "assigning variable e_eta_q");
                  }
                }
              } else {
                current_statement__ = 389;
                mark3 = (mark3 + 2);
              }
              current_statement__ = 501;
              mark2 = (mark2 + 1);
              current_statement__ = 504;
              if ((stan::math::primitive_value(
                     stan::math::logical_eq(
                       stan::model::rvalue(has_assoc, "has_assoc",
                         stan::model::index_uni(5), stan::model::index_uni(m)),
                       1))
                  ||
                  stan::math::primitive_value(
                    stan::math::logical_eq(
                      stan::model::rvalue(has_assoc, "has_assoc",
                        stan::model::index_uni(12), stan::model::index_uni(m)),
                      1)))) {
                current_statement__ = 502;
                std::stringstream errmsg_stream__;
                stan::math::stan_print(&errmsg_stream__,
                  "muslope association structure has been removed.");
                throw std::domain_error(errmsg_stream__.str());
              }
              current_statement__ = 539;
              if (stan::math::logical_eq(
                    stan::model::rvalue(has_assoc, "has_assoc",
                      stan::model::index_uni(6), stan::model::index_uni(m)),
                    1)) {
                current_statement__ = 505;
                stan::math::validate_non_negative_index("eta_auc_tmp",
                  "nrow_y_Xq_auc", nrow_y_Xq_auc);
                Eigen::Matrix<local_scalar_t__,-1,1> eta_auc_tmp =
                  Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_y_Xq_auc,
                    DUMMY_VAR__);
                current_statement__ = 507;
                stan::math::validate_non_negative_index("mu_auc_tmp",
                  "nrow_y_Xq_auc", nrow_y_Xq_auc);
                Eigen::Matrix<local_scalar_t__,-1,1> mu_auc_tmp =
                  Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_y_Xq_auc,
                    DUMMY_VAR__);
                current_statement__ = 509;
                stan::math::validate_non_negative_index("val",
                  "nrow_y_Xq[m]",
                  stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                    stan::model::index_uni(m)));
                Eigen::Matrix<local_scalar_t__,-1,1> val =
                  Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::model::rvalue(
                                                                   nrow_y_Xq,
                                                                   "nrow_y_Xq",
                                                                   stan::model::index_uni(
                                                                    m)),
                    DUMMY_VAR__);
                current_statement__ = 525;
                if (stan::math::logical_eq(m, 1)) {
                  int bMat1_colshift = std::numeric_limits<int>::min();
                  current_statement__ = 521;
                  bMat1_colshift = 0;
                  int bMat2_colshift = std::numeric_limits<int>::min();
                  current_statement__ = 522;
                  bMat2_colshift = 0;
                  current_statement__ = 523;
                  stan::model::assign(eta_auc_tmp,
                    evaluate_eta(y1_xq_auc, y1_z1q_auc, y1_z2q_auc,
                      y1_z1q_id_auc, y1_z2q_id_auc, yGamma1, yBeta1, bMat1,
                      bMat2, bMat1_colshift, bMat2_colshift,
                      stan::model::rvalue(intercept_type, "intercept_type",
                        stan::model::index_uni(1)), y1_offset_auc, pstream__),
                    "assigning variable eta_auc_tmp");
                } else {
                  current_statement__ = 520;
                  if (stan::math::logical_eq(m, 2)) {
                    int bMat1_colshift = std::numeric_limits<int>::min();
                    current_statement__ = 516;
                    bMat1_colshift = stan::model::rvalue(bK1_len, "bK1_len",
                                       stan::model::index_uni(1));
                    int bMat2_colshift = std::numeric_limits<int>::min();
                    current_statement__ = 517;
                    bMat2_colshift = stan::model::rvalue(bK2_len, "bK2_len",
                                       stan::model::index_uni(1));
                    current_statement__ = 518;
                    stan::model::assign(eta_auc_tmp,
                      evaluate_eta(y2_xq_auc, y2_z1q_auc, y2_z2q_auc,
                        y2_z1q_id_auc, y2_z2q_id_auc, yGamma2, yBeta2, bMat1,
                        bMat2, bMat1_colshift, bMat2_colshift,
                        stan::model::rvalue(intercept_type, "intercept_type",
                          stan::model::index_uni(2)), y2_offset_auc,
                        pstream__), "assigning variable eta_auc_tmp");
                  } else {
                    current_statement__ = 515;
                    if (stan::math::logical_eq(m, 3)) {
                      int bMat1_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 511;
                      bMat1_colshift = stan::math::sum(
                                         stan::model::rvalue(bK1_len,
                                           "bK1_len",
                                           stan::model::index_min_max(1, 2)));
                      int bMat2_colshift = std::numeric_limits<int>::min();
                      current_statement__ = 512;
                      bMat2_colshift = stan::math::sum(
                                         stan::model::rvalue(bK2_len,
                                           "bK2_len",
                                           stan::model::index_min_max(1, 2)));
                      current_statement__ = 513;
                      stan::model::assign(eta_auc_tmp,
                        evaluate_eta(y3_xq_auc, y3_z1q_auc, y3_z2q_auc,
                          y3_z1q_id_auc, y3_z2q_id_auc, yGamma3, yBeta3,
                          bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                          stan::model::rvalue(intercept_type,
                            "intercept_type", stan::model::index_uni(3)),
                          y3_offset_auc, pstream__),
                        "assigning variable eta_auc_tmp");
                    }
                  }
                }
                current_statement__ = 526;
                stan::model::assign(mu_auc_tmp,
                  evaluate_mu(eta_auc_tmp,
                    stan::model::rvalue(family, "family",
                      stan::model::index_uni(m)),
                    stan::model::rvalue(link, "link",
                      stan::model::index_uni(m)), pstream__),
                  "assigning variable mu_auc_tmp");
                current_statement__ = 527;
                mark = (mark + 1);
                current_statement__ = 536;
                for (int r = 1; r <=
                     stan::model::rvalue(nrow_y_Xq, "nrow_y_Xq",
                       stan::model::index_uni(m)); ++r) {
                  current_statement__ = 528;
                  stan::math::validate_non_negative_index("val_tmp",
                    "auc_qnodes", auc_qnodes);
                  Eigen::Matrix<local_scalar_t__,-1,1> val_tmp =
                    Eigen::Matrix<local_scalar_t__,-1,1>::Constant(auc_qnodes,
                      DUMMY_VAR__);
                  current_statement__ = 530;
                  stan::math::validate_non_negative_index("wgt_tmp",
                    "auc_qnodes", auc_qnodes);
                  Eigen::Matrix<local_scalar_t__,-1,1> wgt_tmp =
                    Eigen::Matrix<local_scalar_t__,-1,1>::Constant(auc_qnodes,
                      DUMMY_VAR__);
                  current_statement__ = 532;
                  stan::model::assign(val_tmp,
                    stan::model::rvalue(mu_auc_tmp, "mu_auc_tmp",
                      stan::model::index_min_max((((r - 1) * auc_qnodes) +
                        1), (r * auc_qnodes))), "assigning variable val_tmp");
                  current_statement__ = 533;
                  stan::model::assign(wgt_tmp,
                    stan::model::rvalue(auc_qwts, "auc_qwts",
                      stan::model::index_min_max((((r - 1) * auc_qnodes) +
                        1), (r * auc_qnodes))), "assigning variable wgt_tmp");
                  current_statement__ = 534;
                  stan::model::assign(val,
                    stan::math::sum(
                      stan::math::elt_multiply(wgt_tmp, val_tmp)),
                    "assigning variable val", stan::model::index_uni(r));
                }
                current_statement__ = 537;
                stan::model::assign(e_eta_q,
                  stan::math::add(stan::model::deep_copy(e_eta_q),
                    stan::math::multiply(
                      (stan::model::rvalue(a_beta, "a_beta",
                         stan::model::index_uni(mark)) *
                      stan::model::rvalue(a_scale, "a_scale",
                        stan::model::index_uni(mark))),
                      stan::math::subtract(val,
                        stan::model::rvalue(a_xbar, "a_xbar",
                          stan::model::index_uni(mark))))),
                  "assigning variable e_eta_q");
              }
            }
            current_statement__ = 544;
            if (stan::math::logical_gt(sum_size_which_b, 0)) {
              current_statement__ = 542;
              std::stringstream errmsg_stream__;
              stan::math::stan_print(&errmsg_stream__,
                "shared_b has been removed.");
              throw std::domain_error(errmsg_stream__.str());
            }
            current_statement__ = 547;
            if (stan::math::logical_gt(sum_size_which_coef, 0)) {
              current_statement__ = 545;
              std::stringstream errmsg_stream__;
              stan::math::stan_print(&errmsg_stream__,
                "shared_coef has been removed.");
              throw std::domain_error(errmsg_stream__.str());
            }
          }
          {
            current_statement__ = 550;
            stan::math::validate_non_negative_index("log_basehaz",
              "nrow_e_Xq", nrow_e_Xq);
            Eigen::Matrix<local_scalar_t__,-1,1> log_basehaz =
              Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_e_Xq,
                DUMMY_VAR__);
            current_statement__ = 552;
            stan::math::validate_non_negative_index("log_haz_q", "nrow_e_Xq",
              nrow_e_Xq);
            Eigen::Matrix<local_scalar_t__,-1,1> log_haz_q =
              Eigen::Matrix<local_scalar_t__,-1,1>::Constant(nrow_e_Xq,
                DUMMY_VAR__);
            current_statement__ = 554;
            stan::math::validate_non_negative_index("log_haz_etimes",
              "Nevents", Nevents);
            Eigen::Matrix<local_scalar_t__,-1,1> log_haz_etimes =
              Eigen::Matrix<local_scalar_t__,-1,1>::Constant(Nevents,
                DUMMY_VAR__);
            current_statement__ = 556;
            stan::math::validate_non_negative_index("log_haz_qtimes",
              "Npat_times_qnodes", Npat_times_qnodes);
            Eigen::Matrix<local_scalar_t__,-1,1> log_haz_qtimes =
              Eigen::Matrix<local_scalar_t__,-1,1>::Constant(Npat_times_qnodes,
                DUMMY_VAR__);
            current_statement__ = 560;
            if (stan::math::logical_eq(basehaz_type, 1)) {
              current_statement__ = 559;
              stan::model::assign(log_basehaz,
                stan::math::add(
                  stan::math::add((norm_const +
                    stan::math::log(
                      stan::model::rvalue(e_aux, "e_aux",
                        stan::model::index_uni(1)))),
                    stan::math::multiply(basehaz_X,
                      stan::math::subtract(e_aux, 1))),
                  stan::model::rvalue(e_gamma, "e_gamma",
                    stan::model::index_uni(1))),
                "assigning variable log_basehaz");
            } else {
              current_statement__ = 558;
              stan::model::assign(log_basehaz,
                stan::math::add(norm_const,
                  stan::math::multiply(basehaz_X, e_aux)),
                "assigning variable log_basehaz");
            }
            current_statement__ = 561;
            stan::model::assign(log_haz_q,
              stan::math::add(log_basehaz, e_eta_q),
              "assigning variable log_haz_q");
            current_statement__ = 562;
            stan::model::assign(log_haz_etimes,
              stan::math::head(log_haz_q, Nevents),
              "assigning variable log_haz_etimes");
            current_statement__ = 563;
            stan::model::assign(log_haz_qtimes,
              stan::math::tail(log_haz_q, Npat_times_qnodes),
              "assigning variable log_haz_qtimes");
            current_statement__ = 569;
            if ((stan::math::primitive_value(
                   stan::math::logical_eq(has_weights, 0))
                &&
                stan::math::primitive_value(
                  stan::math::logical_eq(prior_PD, 0)))) {
              current_statement__ = 567;
              lp_accum__.add((stan::math::sum(log_haz_etimes) -
                stan::math::dot_product(qwts, stan::math::exp(log_haz_qtimes))));
            } else {
              current_statement__ = 566;
              if (stan::math::logical_eq(prior_PD, 0)) {
                current_statement__ = 564;
                lp_accum__.add((stan::math::dot_product(e_weights,
                                  log_haz_etimes) -
                  stan::math::dot_product(e_weights_rep,
                    stan::math::elt_multiply(qwts,
                      stan::math::exp(log_haz_qtimes)))));
              }
            }
          }
        }
        current_statement__ = 573;
        if (stan::math::logical_eq(
              stan::model::rvalue(has_aux, "has_aux",
                stan::model::index_uni(1)), 1)) {
          current_statement__ = 572;
          lp_accum__.add(aux_lpdf<false>(
                           stan::model::rvalue(yAux1_unscaled,
                             "yAux1_unscaled", stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_dist_for_aux,
                             "y_prior_dist_for_aux",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_scale_for_aux,
                             "y_prior_scale_for_aux",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_df_for_aux,
                             "y_prior_df_for_aux", stan::model::index_uni(1)),
                           pstream__));
        }
        current_statement__ = 575;
        if ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
            stan::math::primitive_value(
              stan::math::logical_eq(
                stan::model::rvalue(has_aux, "has_aux",
                  stan::model::index_uni(2)), 1)))) {
          current_statement__ = 574;
          lp_accum__.add(aux_lpdf<false>(
                           stan::model::rvalue(yAux2_unscaled,
                             "yAux2_unscaled", stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_dist_for_aux,
                             "y_prior_dist_for_aux",
                             stan::model::index_uni(2)),
                           stan::model::rvalue(y_prior_scale_for_aux,
                             "y_prior_scale_for_aux",
                             stan::model::index_uni(2)),
                           stan::model::rvalue(y_prior_df_for_aux,
                             "y_prior_df_for_aux", stan::model::index_uni(2)),
                           pstream__));
        }
        current_statement__ = 577;
        if ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
            stan::math::primitive_value(
              stan::math::logical_eq(
                stan::model::rvalue(has_aux, "has_aux",
                  stan::model::index_uni(3)), 1)))) {
          current_statement__ = 576;
          lp_accum__.add(aux_lpdf<false>(
                           stan::model::rvalue(yAux3_unscaled,
                             "yAux3_unscaled", stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_dist_for_aux,
                             "y_prior_dist_for_aux",
                             stan::model::index_uni(3)),
                           stan::model::rvalue(y_prior_scale_for_aux,
                             "y_prior_scale_for_aux",
                             stan::model::index_uni(3)),
                           stan::model::rvalue(y_prior_df_for_aux,
                             "y_prior_df_for_aux", stan::model::index_uni(3)),
                           pstream__));
        }
        current_statement__ = 579;
        if (stan::math::logical_gt(
              stan::model::rvalue(intercept_type, "intercept_type",
                stan::model::index_uni(1)), 0)) {
          current_statement__ = 578;
          lp_accum__.add(gamma_custom_lpdf<false>(
                           stan::model::rvalue(yGamma1, "yGamma1",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_dist_for_intercept,
                             "y_prior_dist_for_intercept",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_mean_for_intercept,
                             "y_prior_mean_for_intercept",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_scale_for_intercept,
                             "y_prior_scale_for_intercept",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_df_for_intercept,
                             "y_prior_df_for_intercept",
                             stan::model::index_uni(1)), pstream__));
        }
        current_statement__ = 581;
        if ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(intercept_type, "intercept_type",
                  stan::model::index_uni(2)), 0)))) {
          current_statement__ = 580;
          lp_accum__.add(gamma_custom_lpdf<false>(
                           stan::model::rvalue(yGamma2, "yGamma2",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_dist_for_intercept,
                             "y_prior_dist_for_intercept",
                             stan::model::index_uni(2)),
                           stan::model::rvalue(y_prior_mean_for_intercept,
                             "y_prior_mean_for_intercept",
                             stan::model::index_uni(2)),
                           stan::model::rvalue(y_prior_scale_for_intercept,
                             "y_prior_scale_for_intercept",
                             stan::model::index_uni(2)),
                           stan::model::rvalue(y_prior_df_for_intercept,
                             "y_prior_df_for_intercept",
                             stan::model::index_uni(2)), pstream__));
        }
        current_statement__ = 583;
        if ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(intercept_type, "intercept_type",
                  stan::model::index_uni(3)), 0)))) {
          current_statement__ = 582;
          lp_accum__.add(gamma_custom_lpdf<false>(
                           stan::model::rvalue(yGamma3, "yGamma3",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_dist_for_intercept,
                             "y_prior_dist_for_intercept",
                             stan::model::index_uni(3)),
                           stan::model::rvalue(y_prior_mean_for_intercept,
                             "y_prior_mean_for_intercept",
                             stan::model::index_uni(3)),
                           stan::model::rvalue(y_prior_scale_for_intercept,
                             "y_prior_scale_for_intercept",
                             stan::model::index_uni(3)),
                           stan::model::rvalue(y_prior_df_for_intercept,
                             "y_prior_df_for_intercept",
                             stan::model::index_uni(3)), pstream__));
        }
        current_statement__ = 585;
        if (stan::math::logical_gt(
              stan::model::rvalue(yK, "yK", stan::model::index_uni(1)), 0)) {
          current_statement__ = 584;
          lp_accum__.add(beta_custom_lpdf<false>(z_yBeta1,
                           stan::model::rvalue(y_prior_dist, "y_prior_dist",
                             stan::model::index_uni(1)), y_prior_scale1,
                           y_prior_df1,
                           stan::model::rvalue(y_global_prior_df,
                             "y_global_prior_df", stan::model::index_uni(1)),
                           yLocal1, yGlobal1, yMix1, yOol1,
                           stan::model::rvalue(y_slab_df, "y_slab_df",
                             stan::model::index_uni(1)), y_caux1, pstream__));
        }
        current_statement__ = 587;
        if ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(yK, "yK", stan::model::index_uni(2)), 0)))) {
          current_statement__ = 586;
          lp_accum__.add(beta_custom_lpdf<false>(z_yBeta2,
                           stan::model::rvalue(y_prior_dist, "y_prior_dist",
                             stan::model::index_uni(2)), y_prior_scale2,
                           y_prior_df2,
                           stan::model::rvalue(y_global_prior_df,
                             "y_global_prior_df", stan::model::index_uni(2)),
                           yLocal2, yGlobal2, yMix2, yOol2,
                           stan::model::rvalue(y_slab_df, "y_slab_df",
                             stan::model::index_uni(2)), y_caux2, pstream__));
        }
        current_statement__ = 589;
        if ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(yK, "yK", stan::model::index_uni(3)), 0)))) {
          current_statement__ = 588;
          lp_accum__.add(beta_custom_lpdf<false>(z_yBeta3,
                           stan::model::rvalue(y_prior_dist, "y_prior_dist",
                             stan::model::index_uni(3)), y_prior_scale3,
                           y_prior_df3,
                           stan::model::rvalue(y_global_prior_df,
                             "y_global_prior_df", stan::model::index_uni(3)),
                           yLocal3, yGlobal3, yMix3, yOol3,
                           stan::model::rvalue(y_slab_df, "y_slab_df",
                             stan::model::index_uni(3)), y_caux3, pstream__));
        }
        current_statement__ = 606;
        if (stan::math::logical_eq(prior_dist_for_cov, 1)) {
          current_statement__ = 604;
          lp_accum__.add(decov_lpdf<false>(z_b, z_T, rho, zeta, tau,
                           b_prior_regularization, delta, b_prior_shape, t,
                           p, pstream__));
        } else {
          current_statement__ = 603;
          if (stan::math::logical_eq(prior_dist_for_cov, 2)) {
            current_statement__ = 595;
            if (stan::math::logical_gt(bK1, 0)) {
              current_statement__ = 590;
              lp_accum__.add(stan::math::student_t_lpdf<false>(bSd1,
                               b1_prior_df, 0, b1_prior_scale));
              current_statement__ = 591;
              lp_accum__.add(stan::math::normal_lpdf<false>(
                               stan::math::to_vector(z_bMat1), 0, 1));
              current_statement__ = 593;
              if (stan::math::logical_gt(bK1, 1)) {
                current_statement__ = 592;
                lp_accum__.add(stan::math::lkj_corr_cholesky_lpdf<false>(
                                 bCholesky1, b1_prior_regularization));
              }
            }
            current_statement__ = 601;
            if (stan::math::logical_gt(bK2, 0)) {
              current_statement__ = 596;
              lp_accum__.add(stan::math::student_t_lpdf<false>(bSd2,
                               b2_prior_df, 0, b2_prior_scale));
              current_statement__ = 597;
              lp_accum__.add(stan::math::normal_lpdf<false>(
                               stan::math::to_vector(z_bMat2), 0, 1));
              current_statement__ = 599;
              if (stan::math::logical_gt(bK2, 1)) {
                current_statement__ = 598;
                lp_accum__.add(stan::math::lkj_corr_cholesky_lpdf<false>(
                                 bCholesky2, b2_prior_regularization));
              }
            }
          }
        }
        current_statement__ = 607;
        lp_accum__.add(beta_custom_lpdf<false>(e_z_beta, e_prior_dist,
                         e_prior_scale, e_prior_df, e_global_prior_df,
                         e_local, e_global, e_mix, e_ool, e_slab_df, e_caux,
                         pstream__));
        current_statement__ = 608;
        lp_accum__.add(beta_custom_lpdf<false>(a_z_beta, a_prior_dist,
                         a_prior_scale, a_prior_df, a_global_prior_df,
                         a_local, a_global, a_mix, a_ool, a_slab_df, a_caux,
                         pstream__));
        current_statement__ = 609;
        lp_accum__.add(basehaz_lpdf<false>(e_aux_unscaled,
                         e_prior_dist_for_aux, e_prior_scale_for_aux,
                         e_prior_df_for_aux, pstream__));
        current_statement__ = 611;
        if (stan::math::logical_eq(e_has_intercept, 1)) {
          current_statement__ = 610;
          lp_accum__.add(gamma_custom_lpdf<false>(
                           stan::model::rvalue(e_gamma, "e_gamma",
                             stan::model::index_uni(1)),
                           e_prior_dist_for_intercept,
                           e_prior_mean_for_intercept,
                           e_prior_scale_for_intercept,
                           e_prior_df_for_intercept, pstream__));
        }
      }
    } 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__ =
      "model_jm_namespace::write_array";
    // suppress unused var warning
    (void) function__;
    try {
      std::vector<double> yGamma1 =
        std::vector<double>(yGamma1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 1;
      yGamma1 = in__.template read_constrain_lub<
                  std::vector<local_scalar_t__>,
                  jacobian__>(lb(
                                stan::model::rvalue(intercept_type,
                                  "intercept_type", stan::model::index_uni(1)),
                                pstream__),
                  ub(
                    stan::model::rvalue(intercept_type, "intercept_type",
                      stan::model::index_uni(1)), pstream__), lp__,
                  yGamma1_1dim__);
      std::vector<double> yGamma2 =
        std::vector<double>(yGamma2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 2;
      yGamma2 = in__.template read_constrain_lub<
                  std::vector<local_scalar_t__>,
                  jacobian__>(lb(
                                stan::model::rvalue(intercept_type,
                                  "intercept_type", stan::model::index_uni(2)),
                                pstream__),
                  ub(
                    stan::model::rvalue(intercept_type, "intercept_type",
                      stan::model::index_uni(2)), pstream__), lp__,
                  yGamma2_1dim__);
      std::vector<double> yGamma3 =
        std::vector<double>(yGamma3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 3;
      yGamma3 = in__.template read_constrain_lub<
                  std::vector<local_scalar_t__>,
                  jacobian__>(lb(
                                stan::model::rvalue(intercept_type,
                                  "intercept_type", stan::model::index_uni(3)),
                                pstream__),
                  ub(
                    stan::model::rvalue(intercept_type, "intercept_type",
                      stan::model::index_uni(3)), pstream__), lp__,
                  yGamma3_1dim__);
      Eigen::Matrix<double,-1,1> z_yBeta1 =
        Eigen::Matrix<double,-1,1>::Constant(z_yBeta1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 4;
      z_yBeta1 = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta1_1dim__);
      Eigen::Matrix<double,-1,1> z_yBeta2 =
        Eigen::Matrix<double,-1,1>::Constant(z_yBeta2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 5;
      z_yBeta2 = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta2_1dim__);
      Eigen::Matrix<double,-1,1> z_yBeta3 =
        Eigen::Matrix<double,-1,1>::Constant(z_yBeta3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 6;
      z_yBeta3 = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta3_1dim__);
      Eigen::Matrix<double,-1,1> z_b =
        Eigen::Matrix<double,-1,1>::Constant(z_b_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 7;
      z_b = in__.template read<
              Eigen::Matrix<local_scalar_t__,-1,1>>(z_b_1dim__);
      Eigen::Matrix<double,-1,1> z_T =
        Eigen::Matrix<double,-1,1>::Constant(z_T_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 8;
      z_T = in__.template read<
              Eigen::Matrix<local_scalar_t__,-1,1>>(z_T_1dim__);
      Eigen::Matrix<double,-1,1> rho =
        Eigen::Matrix<double,-1,1>::Constant(rho_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 9;
      rho = in__.template read_constrain_lub<
              Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, 1, lp__,
              rho_1dim__);
      Eigen::Matrix<double,-1,1> zeta =
        Eigen::Matrix<double,-1,1>::Constant(zeta_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 10;
      zeta = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               zeta_1dim__);
      Eigen::Matrix<double,-1,1> tau =
        Eigen::Matrix<double,-1,1>::Constant(tau_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 11;
      tau = in__.template read_constrain_lb<
              Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
              tau_1dim__);
      Eigen::Matrix<double,-1,1> bSd1 =
        Eigen::Matrix<double,-1,1>::Constant(bSd1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 12;
      bSd1 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               bSd1_1dim__);
      Eigen::Matrix<double,-1,-1> z_bMat1 =
        Eigen::Matrix<double,-1,-1>::Constant(z_bMat1_1dim__, z_bMat1_2dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 13;
      z_bMat1 = in__.template read<
                  Eigen::Matrix<local_scalar_t__,-1,-1>>(z_bMat1_1dim__,
                  z_bMat1_2dim__);
      Eigen::Matrix<double,-1,-1> bCholesky1 =
        Eigen::Matrix<double,-1,-1>::Constant(bCholesky1_1dim__,
          bCholesky1_2dim__, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 14;
      bCholesky1 = in__.template read_constrain_cholesky_factor_corr<
                     Eigen::Matrix<local_scalar_t__,-1,-1>, jacobian__>(lp__,
                     bCholesky1_2dim__);
      Eigen::Matrix<double,-1,1> bSd2 =
        Eigen::Matrix<double,-1,1>::Constant(bSd2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 15;
      bSd2 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               bSd2_1dim__);
      Eigen::Matrix<double,-1,-1> z_bMat2 =
        Eigen::Matrix<double,-1,-1>::Constant(z_bMat2_1dim__, z_bMat2_2dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 16;
      z_bMat2 = in__.template read<
                  Eigen::Matrix<local_scalar_t__,-1,-1>>(z_bMat2_1dim__,
                  z_bMat2_2dim__);
      Eigen::Matrix<double,-1,-1> bCholesky2 =
        Eigen::Matrix<double,-1,-1>::Constant(bCholesky2_1dim__,
          bCholesky2_2dim__, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 17;
      bCholesky2 = in__.template read_constrain_cholesky_factor_corr<
                     Eigen::Matrix<local_scalar_t__,-1,-1>, jacobian__>(lp__,
                     bCholesky2_2dim__);
      std::vector<double> yAux1_unscaled =
        std::vector<double>(yAux1_unscaled_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 18;
      yAux1_unscaled = in__.template read_constrain_lb<
                         std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                         yAux1_unscaled_1dim__);
      std::vector<double> yAux2_unscaled =
        std::vector<double>(yAux2_unscaled_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 19;
      yAux2_unscaled = in__.template read_constrain_lb<
                         std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                         yAux2_unscaled_1dim__);
      std::vector<double> yAux3_unscaled =
        std::vector<double>(yAux3_unscaled_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 20;
      yAux3_unscaled = in__.template read_constrain_lb<
                         std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                         yAux3_unscaled_1dim__);
      std::vector<double> yGlobal1 =
        std::vector<double>(yHs1, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 21;
      yGlobal1 = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, yHs1);
      std::vector<double> yGlobal2 =
        std::vector<double>(yHs2, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 22;
      yGlobal2 = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, yHs2);
      std::vector<double> yGlobal3 =
        std::vector<double>(yHs3, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 23;
      yGlobal3 = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, yHs3);
      std::vector<Eigen::Matrix<double,-1,1>> yLocal1 =
        std::vector<Eigen::Matrix<double,-1,1>>(yHs1,
          Eigen::Matrix<double,-1,1>::Constant(yLocal1_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 24;
      yLocal1 = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, yHs1, yLocal1_2dim__);
      std::vector<Eigen::Matrix<double,-1,1>> yLocal2 =
        std::vector<Eigen::Matrix<double,-1,1>>(yHs2,
          Eigen::Matrix<double,-1,1>::Constant(yLocal2_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 25;
      yLocal2 = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, yHs2, yLocal2_2dim__);
      std::vector<Eigen::Matrix<double,-1,1>> yLocal3 =
        std::vector<Eigen::Matrix<double,-1,1>>(yHs3,
          Eigen::Matrix<double,-1,1>::Constant(yLocal3_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 26;
      yLocal3 = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, yHs3, yLocal3_2dim__);
      std::vector<double> y_caux1 =
        std::vector<double>(y_caux1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 27;
      y_caux1 = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                  y_caux1_1dim__);
      std::vector<double> y_caux2 =
        std::vector<double>(y_caux2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 28;
      y_caux2 = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                  y_caux2_1dim__);
      std::vector<double> y_caux3 =
        std::vector<double>(y_caux3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 29;
      y_caux3 = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                  y_caux3_1dim__);
      std::vector<double> yOol1 =
        std::vector<double>(yOol1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 30;
      yOol1 = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, yOol1_1dim__);
      std::vector<double> yOol2 =
        std::vector<double>(yOol2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 31;
      yOol2 = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, yOol2_1dim__);
      std::vector<double> yOol3 =
        std::vector<double>(yOol3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 32;
      yOol3 = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, yOol3_1dim__);
      std::vector<Eigen::Matrix<double,-1,1>> yMix1 =
        std::vector<Eigen::Matrix<double,-1,1>>(yMix1_1dim__,
          Eigen::Matrix<double,-1,1>::Constant(yMix1_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 33;
      yMix1 = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, yMix1_1dim__, yMix1_2dim__);
      std::vector<Eigen::Matrix<double,-1,1>> yMix2 =
        std::vector<Eigen::Matrix<double,-1,1>>(yMix2_1dim__,
          Eigen::Matrix<double,-1,1>::Constant(yMix2_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 34;
      yMix2 = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, yMix2_1dim__, yMix2_2dim__);
      std::vector<Eigen::Matrix<double,-1,1>> yMix3 =
        std::vector<Eigen::Matrix<double,-1,1>>(yMix3_1dim__,
          Eigen::Matrix<double,-1,1>::Constant(yMix3_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 35;
      yMix3 = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, yMix3_1dim__, yMix3_2dim__);
      std::vector<double> e_gamma =
        std::vector<double>(e_has_intercept,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 36;
      e_gamma = in__.template read<
                  std::vector<local_scalar_t__>>(e_has_intercept);
      Eigen::Matrix<double,-1,1> e_z_beta =
        Eigen::Matrix<double,-1,1>::Constant(e_K,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 37;
      e_z_beta = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(e_K);
      Eigen::Matrix<double,-1,1> e_aux_unscaled =
        Eigen::Matrix<double,-1,1>::Constant(basehaz_df,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 38;
      e_aux_unscaled = in__.template read_constrain_lb<
                         Eigen::Matrix<local_scalar_t__,-1,1>,
                         jacobian__>((stan::math::logical_eq(basehaz_type, 1) ? 0 : 
                         stan::math::negative_infinity()), lp__, basehaz_df);
      std::vector<double> e_global =
        std::vector<double>(e_hs, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 39;
      e_global = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, e_hs);
      std::vector<Eigen::Matrix<double,-1,1>> e_local =
        std::vector<Eigen::Matrix<double,-1,1>>(e_hs,
          Eigen::Matrix<double,-1,1>::Constant(e_local_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 40;
      e_local = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, e_hs, e_local_2dim__);
      std::vector<double> e_caux =
        std::vector<double>(e_caux_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 41;
      e_caux = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                 jacobian__>(0, lp__, e_caux_1dim__);
      std::vector<Eigen::Matrix<double,-1,1>> e_mix =
        std::vector<Eigen::Matrix<double,-1,1>>(e_mix_1dim__,
          Eigen::Matrix<double,-1,1>::Constant(e_K,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 42;
      e_mix = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, e_mix_1dim__, e_K);
      std::vector<double> e_ool =
        std::vector<double>(e_ool_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 43;
      e_ool = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, e_ool_1dim__);
      Eigen::Matrix<double,-1,1> a_z_beta =
        Eigen::Matrix<double,-1,1>::Constant(a_K,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 44;
      a_z_beta = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(a_K);
      std::vector<double> a_global =
        std::vector<double>(a_hs, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 45;
      a_global = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, a_hs);
      std::vector<Eigen::Matrix<double,-1,1>> a_local =
        std::vector<Eigen::Matrix<double,-1,1>>(a_hs,
          Eigen::Matrix<double,-1,1>::Constant(a_local_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 46;
      a_local = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, a_hs, a_local_2dim__);
      std::vector<double> a_caux =
        std::vector<double>(a_caux_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 47;
      a_caux = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                 jacobian__>(0, lp__, a_caux_1dim__);
      std::vector<Eigen::Matrix<double,-1,1>> a_mix =
        std::vector<Eigen::Matrix<double,-1,1>>(a_mix_1dim__,
          Eigen::Matrix<double,-1,1>::Constant(a_K,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 48;
      a_mix = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, a_mix_1dim__, a_K);
      std::vector<double> a_ool =
        std::vector<double>(a_ool_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 49;
      a_ool = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, a_ool_1dim__);
      Eigen::Matrix<double,-1,1> e_beta =
        Eigen::Matrix<double,-1,1>::Constant(e_K,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> a_beta =
        Eigen::Matrix<double,-1,1>::Constant(a_K,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> e_aux =
        Eigen::Matrix<double,-1,1>::Constant(basehaz_df,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> yBeta1 =
        Eigen::Matrix<double,-1,1>::Constant(yBeta1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> yBeta2 =
        Eigen::Matrix<double,-1,1>::Constant(yBeta2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> yBeta3 =
        Eigen::Matrix<double,-1,1>::Constant(yBeta3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      std::vector<double> yAux1 =
        std::vector<double>(yAux1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      std::vector<double> yAux2 =
        std::vector<double>(yAux2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      std::vector<double> yAux3 =
        std::vector<double>(yAux3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> theta_L =
        Eigen::Matrix<double,-1,1>::Constant(len_theta_L,
          std::numeric_limits<double>::quiet_NaN());
      double yAuxMaximum = std::numeric_limits<double>::quiet_NaN();
      Eigen::Matrix<double,-1,-1> bMat1 =
        Eigen::Matrix<double,-1,-1>::Constant(bMat1_1dim__, bK1,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,-1> bMat2 =
        Eigen::Matrix<double,-1,-1>::Constant(bMat2_1dim__, bK2,
          std::numeric_limits<double>::quiet_NaN());
      out__.write(yGamma1);
      out__.write(yGamma2);
      out__.write(yGamma3);
      out__.write(z_yBeta1);
      out__.write(z_yBeta2);
      out__.write(z_yBeta3);
      out__.write(z_b);
      out__.write(z_T);
      out__.write(rho);
      out__.write(zeta);
      out__.write(tau);
      out__.write(bSd1);
      out__.write(z_bMat1);
      out__.write(bCholesky1);
      out__.write(bSd2);
      out__.write(z_bMat2);
      out__.write(bCholesky2);
      out__.write(yAux1_unscaled);
      out__.write(yAux2_unscaled);
      out__.write(yAux3_unscaled);
      out__.write(yGlobal1);
      out__.write(yGlobal2);
      out__.write(yGlobal3);
      for (int sym1__ = 1; sym1__ <= yLocal1_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= yHs1; ++sym2__) {
          out__.write(yLocal1[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      for (int sym1__ = 1; sym1__ <= yLocal2_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= yHs2; ++sym2__) {
          out__.write(yLocal2[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      for (int sym1__ = 1; sym1__ <= yLocal3_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= yHs3; ++sym2__) {
          out__.write(yLocal3[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      out__.write(y_caux1);
      out__.write(y_caux2);
      out__.write(y_caux3);
      out__.write(yOol1);
      out__.write(yOol2);
      out__.write(yOol3);
      for (int sym1__ = 1; sym1__ <= yMix1_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= yMix1_1dim__; ++sym2__) {
          out__.write(yMix1[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      for (int sym1__ = 1; sym1__ <= yMix2_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= yMix2_1dim__; ++sym2__) {
          out__.write(yMix2[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      for (int sym1__ = 1; sym1__ <= yMix3_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= yMix3_1dim__; ++sym2__) {
          out__.write(yMix3[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      out__.write(e_gamma);
      out__.write(e_z_beta);
      out__.write(e_aux_unscaled);
      out__.write(e_global);
      for (int sym1__ = 1; sym1__ <= e_local_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= e_hs; ++sym2__) {
          out__.write(e_local[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      out__.write(e_caux);
      for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= e_mix_1dim__; ++sym2__) {
          out__.write(e_mix[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      out__.write(e_ool);
      out__.write(a_z_beta);
      out__.write(a_global);
      for (int sym1__ = 1; sym1__ <= a_local_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= a_hs; ++sym2__) {
          out__.write(a_local[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      out__.write(a_caux);
      for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= a_mix_1dim__; ++sym2__) {
          out__.write(a_mix[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      out__.write(a_ool);
      if (stan::math::logical_negation(
            (stan::math::primitive_value(emit_transformed_parameters__) ||
            stan::math::primitive_value(emit_generated_quantities__)))) {
        return ;
      }
      current_statement__ = 60;
      yAuxMaximum = 1.0;
      current_statement__ = 76;
      if (stan::math::logical_eq(
            stan::model::rvalue(has_aux, "has_aux", stan::model::index_uni(1)),
            1)) {
        current_statement__ = 72;
        stan::model::assign(yAux1,
          make_aux(
            stan::model::rvalue(yAux1_unscaled, "yAux1_unscaled",
              stan::model::index_uni(1)),
            stan::model::rvalue(y_prior_dist_for_aux, "y_prior_dist_for_aux",
              stan::model::index_uni(1)),
            stan::model::rvalue(y_prior_mean_for_aux, "y_prior_mean_for_aux",
              stan::model::index_uni(1)),
            stan::model::rvalue(y_prior_scale_for_aux,
              "y_prior_scale_for_aux", stan::model::index_uni(1)), pstream__),
          "assigning variable yAux1", stan::model::index_uni(1));
        current_statement__ = 74;
        if (stan::math::logical_gt(
              stan::model::rvalue(yAux1, "yAux1", stan::model::index_uni(1)),
              yAuxMaximum)) {
          current_statement__ = 73;
          yAuxMaximum = stan::model::rvalue(yAux1, "yAux1",
                          stan::model::index_uni(1));
        }
      }
      current_statement__ = 78;
      if (stan::math::logical_gt(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(1)), 0)) {
        current_statement__ = 77;
        stan::model::assign(yBeta1,
          make_beta(z_yBeta1,
            stan::model::rvalue(y_prior_dist, "y_prior_dist",
              stan::model::index_uni(1)), y_prior_mean1, y_prior_scale1,
            y_prior_df1,
            stan::model::rvalue(y_global_prior_scale, "y_global_prior_scale",
              stan::model::index_uni(1)), yGlobal1, yLocal1, yOol1, yMix1,
            yAux1,
            stan::model::rvalue(family, "family", stan::model::index_uni(1)),
            stan::model::rvalue(y_slab_scale, "y_slab_scale",
              stan::model::index_uni(1)), y_caux1, pstream__),
          "assigning variable yBeta1");
      }
      current_statement__ = 87;
      if (stan::math::logical_gt(M, 1)) {
        current_statement__ = 83;
        if (stan::math::logical_eq(
              stan::model::rvalue(has_aux, "has_aux",
                stan::model::index_uni(2)), 1)) {
          current_statement__ = 79;
          stan::model::assign(yAux2,
            make_aux(
              stan::model::rvalue(yAux2_unscaled, "yAux2_unscaled",
                stan::model::index_uni(1)),
              stan::model::rvalue(y_prior_dist_for_aux,
                "y_prior_dist_for_aux", stan::model::index_uni(2)),
              stan::model::rvalue(y_prior_mean_for_aux,
                "y_prior_mean_for_aux", stan::model::index_uni(2)),
              stan::model::rvalue(y_prior_scale_for_aux,
                "y_prior_scale_for_aux", stan::model::index_uni(2)),
              pstream__), "assigning variable yAux2",
            stan::model::index_uni(1));
          current_statement__ = 81;
          if (stan::math::logical_gt(
                stan::model::rvalue(yAux2, "yAux2", stan::model::index_uni(1)),
                yAuxMaximum)) {
            current_statement__ = 80;
            yAuxMaximum = stan::model::rvalue(yAux2, "yAux2",
                            stan::model::index_uni(1));
          }
        }
        current_statement__ = 85;
        if (stan::math::logical_gt(
              stan::model::rvalue(yK, "yK", stan::model::index_uni(2)), 0)) {
          current_statement__ = 84;
          stan::model::assign(yBeta2,
            make_beta(z_yBeta2,
              stan::model::rvalue(y_prior_dist, "y_prior_dist",
                stan::model::index_uni(2)), y_prior_mean2, y_prior_scale2,
              y_prior_df2,
              stan::model::rvalue(y_global_prior_scale,
                "y_global_prior_scale", stan::model::index_uni(2)), yGlobal2,
              yLocal2, yOol2, yMix2, yAux2,
              stan::model::rvalue(family, "family", stan::model::index_uni(2)),
              stan::model::rvalue(y_slab_scale, "y_slab_scale",
                stan::model::index_uni(2)), y_caux2, pstream__),
            "assigning variable yBeta2");
        }
      }
      current_statement__ = 96;
      if (stan::math::logical_gt(M, 2)) {
        current_statement__ = 92;
        if (stan::math::logical_eq(
              stan::model::rvalue(has_aux, "has_aux",
                stan::model::index_uni(3)), 1)) {
          current_statement__ = 88;
          stan::model::assign(yAux3,
            make_aux(
              stan::model::rvalue(yAux3_unscaled, "yAux3_unscaled",
                stan::model::index_uni(1)),
              stan::model::rvalue(y_prior_dist_for_aux,
                "y_prior_dist_for_aux", stan::model::index_uni(3)),
              stan::model::rvalue(y_prior_mean_for_aux,
                "y_prior_mean_for_aux", stan::model::index_uni(3)),
              stan::model::rvalue(y_prior_scale_for_aux,
                "y_prior_scale_for_aux", stan::model::index_uni(3)),
              pstream__), "assigning variable yAux3",
            stan::model::index_uni(1));
          current_statement__ = 90;
          if (stan::math::logical_gt(
                stan::model::rvalue(yAux3, "yAux3", stan::model::index_uni(1)),
                yAuxMaximum)) {
            current_statement__ = 89;
            yAuxMaximum = stan::model::rvalue(yAux3, "yAux3",
                            stan::model::index_uni(1));
          }
        }
        current_statement__ = 94;
        if (stan::math::logical_gt(
              stan::model::rvalue(yK, "yK", stan::model::index_uni(3)), 0)) {
          current_statement__ = 93;
          stan::model::assign(yBeta3,
            make_beta(z_yBeta3,
              stan::model::rvalue(y_prior_dist, "y_prior_dist",
                stan::model::index_uni(3)), y_prior_mean3, y_prior_scale3,
              y_prior_df3,
              stan::model::rvalue(y_global_prior_scale,
                "y_global_prior_scale", stan::model::index_uni(3)), yGlobal3,
              yLocal3, yOol3, yMix3, yAux3,
              stan::model::rvalue(family, "family", stan::model::index_uni(3)),
              stan::model::rvalue(y_slab_scale, "y_slab_scale",
                stan::model::index_uni(3)), y_caux3, pstream__),
            "assigning variable yBeta3");
        }
      }
      current_statement__ = 114;
      if (stan::math::logical_eq(prior_dist_for_cov, 1)) {
        int mark = std::numeric_limits<int>::min();
        current_statement__ = 107;
        mark = 1;
        current_statement__ = 108;
        stan::model::assign(theta_L,
          make_theta_L(len_theta_L, p, yAuxMaximum, tau, b_prior_scale, zeta,
            rho, z_T, pstream__), "assigning variable theta_L");
        current_statement__ = 110;
        if (stan::math::logical_gt(bK1, 0)) {
          current_statement__ = 109;
          stan::model::assign(bMat1,
            make_b_matrix(z_b, theta_L, p, l, 1, pstream__),
            "assigning variable bMat1");
        }
        current_statement__ = 112;
        if (stan::math::logical_gt(bK2, 0)) {
          current_statement__ = 111;
          stan::model::assign(bMat2,
            make_b_matrix(z_b, theta_L, p, l, 2, pstream__),
            "assigning variable bMat2");
        }
      } else {
        current_statement__ = 106;
        if (stan::math::logical_eq(prior_dist_for_cov, 2)) {
          current_statement__ = 100;
          if (stan::math::logical_eq(bK1, 1)) {
            current_statement__ = 99;
            stan::model::assign(bMat1,
              stan::math::transpose(
                stan::math::multiply(
                  stan::model::rvalue(bSd1, "bSd1", stan::model::index_uni(1)),
                  z_bMat1)), "assigning variable bMat1");
          } else {
            current_statement__ = 98;
            if (stan::math::logical_gt(bK1, 1)) {
              current_statement__ = 97;
              stan::model::assign(bMat1,
                stan::math::transpose(
                  stan::math::multiply(
                    stan::math::diag_pre_multiply(bSd1, bCholesky1), z_bMat1)),
                "assigning variable bMat1");
            }
          }
          current_statement__ = 104;
          if (stan::math::logical_eq(bK2, 1)) {
            current_statement__ = 103;
            stan::model::assign(bMat2,
              stan::math::transpose(
                stan::math::multiply(
                  stan::model::rvalue(bSd2, "bSd2", stan::model::index_uni(1)),
                  z_bMat2)), "assigning variable bMat2");
          } else {
            current_statement__ = 102;
            if (stan::math::logical_gt(bK2, 1)) {
              current_statement__ = 101;
              stan::model::assign(bMat2,
                stan::math::transpose(
                  stan::math::multiply(
                    stan::math::diag_pre_multiply(bSd2, bCholesky2), z_bMat2)),
                "assigning variable bMat2");
            }
          }
        }
      }
      current_statement__ = 115;
      stan::model::assign(e_beta,
        make_beta(e_z_beta, e_prior_dist, e_prior_mean, e_prior_scale,
          e_prior_df, e_global_prior_scale, e_global, e_local, e_ool, e_mix,
          stan::math::rep_array(1.0, 0), 0, e_slab_scale, e_caux, pstream__),
        "assigning variable e_beta");
      current_statement__ = 116;
      stan::model::assign(a_beta,
        make_beta(a_z_beta, a_prior_dist, a_prior_mean, a_prior_scale,
          a_prior_df, a_global_prior_scale, a_global, a_local, a_ool, a_mix,
          stan::math::rep_array(1.0, 0), 0, a_slab_scale, a_caux, pstream__),
        "assigning variable a_beta");
      current_statement__ = 117;
      stan::model::assign(e_aux,
        make_basehaz_coef(e_aux_unscaled, e_prior_dist_for_aux,
          e_prior_mean_for_aux, e_prior_scale_for_aux, pstream__),
        "assigning variable e_aux");
      if (emit_transformed_parameters__) {
        out__.write(e_beta);
        out__.write(a_beta);
        out__.write(e_aux);
        out__.write(yBeta1);
        out__.write(yBeta2);
        out__.write(yBeta3);
        out__.write(yAux1);
        out__.write(yAux2);
        out__.write(yAux3);
        out__.write(theta_L);
        out__.write(yAuxMaximum);
        out__.write(bMat1);
        out__.write(bMat2);
      }
      if (stan::math::logical_negation(emit_generated_quantities__)) {
        return ;
      }
      double e_alpha = std::numeric_limits<double>::quiet_NaN();
      std::vector<double> mean_PPD =
        std::vector<double>(M, std::numeric_limits<double>::quiet_NaN());
      std::vector<double> yAlpha1 =
        std::vector<double>(yAlpha1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      std::vector<double> yAlpha2 =
        std::vector<double>(yAlpha2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      std::vector<double> yAlpha3 =
        std::vector<double>(yAlpha3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> bCov1 =
        Eigen::Matrix<double,-1,1>::Constant(bCov1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> bCov2 =
        Eigen::Matrix<double,-1,1>::Constant(bCov2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> b1 =
        Eigen::Matrix<double,-1,1>::Constant(b1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 70;
      stan::model::assign(b1,
        stan::math::to_vector(stan::math::transpose(bMat1)),
        "assigning variable b1");
      Eigen::Matrix<double,-1,1> b2 =
        Eigen::Matrix<double,-1,1>::Constant(b2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 71;
      stan::model::assign(b2,
        stan::math::to_vector(stan::math::transpose(bMat2)),
        "assigning variable b2");
      {
        int bMat1_colshift = std::numeric_limits<int>::min();
        current_statement__ = 118;
        bMat1_colshift = 0;
        int bMat2_colshift = std::numeric_limits<int>::min();
        current_statement__ = 119;
        bMat2_colshift = 0;
        current_statement__ = 124;
        if (stan::math::logical_gt(M, 0)) {
          current_statement__ = 120;
          stan::math::validate_non_negative_index("yEta1", "yNeta[1]",
            stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)));
          Eigen::Matrix<double,-1,1> yEta1 =
            Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(yNeta,
                                                   "yNeta",
                                                   stan::model::index_uni(1)),
              std::numeric_limits<double>::quiet_NaN());
          current_statement__ = 121;
          stan::model::assign(yEta1,
            evaluate_mu(
              evaluate_eta(yX1, y1_Z1, y1_Z2, y1_Z1_id, y1_Z2_id, yGamma1,
                yBeta1, bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                stan::model::rvalue(intercept_type, "intercept_type",
                  stan::model::index_uni(1)), y1_offset, pstream__),
              stan::model::rvalue(family, "family", stan::model::index_uni(1)),
              stan::model::rvalue(link, "link", stan::model::index_uni(1)),
              pstream__), "assigning variable yEta1");
          current_statement__ = 122;
          stan::model::assign(mean_PPD,
            mean_PPD_rng(yEta1, yAux1,
              stan::model::rvalue(family, "family", stan::model::index_uni(1)),
              base_rng__, pstream__), "assigning variable mean_PPD",
            stan::model::index_uni(1));
        }
        current_statement__ = 132;
        if (stan::math::logical_gt(M, 1)) {
          current_statement__ = 125;
          stan::math::validate_non_negative_index("yEta2", "yNeta[2]",
            stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)));
          Eigen::Matrix<double,-1,1> yEta2 =
            Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(yNeta,
                                                   "yNeta",
                                                   stan::model::index_uni(2)),
              std::numeric_limits<double>::quiet_NaN());
          current_statement__ = 127;
          bMat1_colshift = (bMat1_colshift +
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)));
          current_statement__ = 128;
          bMat2_colshift = (bMat2_colshift +
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)));
          current_statement__ = 129;
          stan::model::assign(yEta2,
            evaluate_mu(
              evaluate_eta(yX2, y2_Z1, y2_Z2, y2_Z1_id, y2_Z2_id, yGamma2,
                yBeta2, bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                stan::model::rvalue(intercept_type, "intercept_type",
                  stan::model::index_uni(2)), y2_offset, pstream__),
              stan::model::rvalue(family, "family", stan::model::index_uni(2)),
              stan::model::rvalue(link, "link", stan::model::index_uni(2)),
              pstream__), "assigning variable yEta2");
          current_statement__ = 130;
          stan::model::assign(mean_PPD,
            mean_PPD_rng(yEta2, yAux2,
              stan::model::rvalue(family, "family", stan::model::index_uni(2)),
              base_rng__, pstream__), "assigning variable mean_PPD",
            stan::model::index_uni(2));
        }
        current_statement__ = 140;
        if (stan::math::logical_gt(M, 2)) {
          current_statement__ = 133;
          stan::math::validate_non_negative_index("yEta3", "yNeta[3]",
            stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)));
          Eigen::Matrix<double,-1,1> yEta3 =
            Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(yNeta,
                                                   "yNeta",
                                                   stan::model::index_uni(3)),
              std::numeric_limits<double>::quiet_NaN());
          current_statement__ = 135;
          bMat1_colshift = (bMat1_colshift +
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)));
          current_statement__ = 136;
          bMat2_colshift = (bMat2_colshift +
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)));
          current_statement__ = 137;
          stan::model::assign(yEta3,
            evaluate_mu(
              evaluate_eta(yX3, y3_Z1, y3_Z2, y3_Z1_id, y3_Z2_id, yGamma3,
                yBeta3, bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                stan::model::rvalue(intercept_type, "intercept_type",
                  stan::model::index_uni(3)), y3_offset, pstream__),
              stan::model::rvalue(family, "family", stan::model::index_uni(3)),
              stan::model::rvalue(link, "link", stan::model::index_uni(3)),
              pstream__), "assigning variable yEta3");
          current_statement__ = 138;
          stan::model::assign(mean_PPD,
            mean_PPD_rng(yEta3, yAux3,
              stan::model::rvalue(family, "family", stan::model::index_uni(3)),
              base_rng__, pstream__), "assigning variable mean_PPD",
            stan::model::index_uni(3));
        }
      }
      current_statement__ = 143;
      if (stan::math::logical_gt(
            stan::model::rvalue(intercept_type, "intercept_type",
              stan::model::index_uni(1)), 0)) {
        current_statement__ = 142;
        stan::model::assign(yAlpha1,
          (stan::model::rvalue(yGamma1, "yGamma1", stan::model::index_uni(1))
          - stan::math::dot_product(yXbar1, yBeta1)),
          "assigning variable yAlpha1", stan::model::index_uni(1));
      }
      current_statement__ = 145;
      if ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
          stan::math::primitive_value(
            stan::math::logical_gt(
              stan::model::rvalue(intercept_type, "intercept_type",
                stan::model::index_uni(2)), 0)))) {
        current_statement__ = 144;
        stan::model::assign(yAlpha2,
          (stan::model::rvalue(yGamma2, "yGamma2", stan::model::index_uni(1))
          - stan::math::dot_product(yXbar2, yBeta2)),
          "assigning variable yAlpha2", stan::model::index_uni(1));
      }
      current_statement__ = 147;
      if ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
          stan::math::primitive_value(
            stan::math::logical_gt(
              stan::model::rvalue(intercept_type, "intercept_type",
                stan::model::index_uni(3)), 0)))) {
        current_statement__ = 146;
        stan::model::assign(yAlpha3,
          (stan::model::rvalue(yGamma3, "yGamma3", stan::model::index_uni(1))
          - stan::math::dot_product(yXbar3, yBeta3)),
          "assigning variable yAlpha3", stan::model::index_uni(1));
      }
      current_statement__ = 153;
      if ((stan::math::primitive_value(
             stan::math::logical_eq(prior_dist_for_cov, 2))
          && stan::math::primitive_value(stan::math::logical_eq(bK1, 1)))) {
        current_statement__ = 151;
        stan::model::assign(bCov1,
          (stan::model::rvalue(bSd1, "bSd1", stan::model::index_uni(1)) *
          stan::model::rvalue(bSd1, "bSd1", stan::model::index_uni(1))),
          "assigning variable bCov1", stan::model::index_uni(1));
      } else {
        current_statement__ = 150;
        if ((stan::math::primitive_value(
               stan::math::logical_eq(prior_dist_for_cov, 2))
            && stan::math::primitive_value(stan::math::logical_gt(bK1, 1)))) {
          current_statement__ = 148;
          stan::model::assign(bCov1,
            stan::model::rvalue(
              stan::math::to_vector(
                stan::math::quad_form_diag(
                  stan::math::multiply_lower_tri_self_transpose(bCholesky1),
                  bSd1)),
              "to_vector(quad_form_diag(multiply_lower_tri_self_transpose(bCholesky1),\nbSd1))",
              stan::model::index_multi(bCov1_idx)),
            "assigning variable bCov1");
        }
      }
      current_statement__ = 159;
      if ((stan::math::primitive_value(
             stan::math::logical_eq(prior_dist_for_cov, 2))
          && stan::math::primitive_value(stan::math::logical_eq(bK2, 1)))) {
        current_statement__ = 157;
        stan::model::assign(bCov2,
          (stan::model::rvalue(bSd2, "bSd2", stan::model::index_uni(1)) *
          stan::model::rvalue(bSd2, "bSd2", stan::model::index_uni(1))),
          "assigning variable bCov2", stan::model::index_uni(1));
      } else {
        current_statement__ = 156;
        if ((stan::math::primitive_value(
               stan::math::logical_eq(prior_dist_for_cov, 2))
            && stan::math::primitive_value(stan::math::logical_gt(bK2, 1)))) {
          current_statement__ = 154;
          stan::model::assign(bCov2,
            stan::model::rvalue(
              stan::math::to_vector(
                stan::math::quad_form_diag(
                  stan::math::multiply_lower_tri_self_transpose(bCholesky2),
                  bSd2)),
              "to_vector(quad_form_diag(multiply_lower_tri_self_transpose(bCholesky2),\nbSd2))",
              stan::model::index_multi(bCov2_idx)),
            "assigning variable bCov2");
        }
      }
      current_statement__ = 162;
      if (stan::math::logical_eq(e_has_intercept, 1)) {
        current_statement__ = 161;
        e_alpha = (((stan::model::rvalue(e_gamma, "e_gamma",
                       stan::model::index_uni(1))
          + norm_const) - stan::math::dot_product(e_xbar, e_beta)) -
          stan::math::dot_product(a_xbar,
            stan::math::elt_multiply(a_beta, a_scale)));
      } else {
        current_statement__ = 160;
        e_alpha = ((norm_const - stan::math::dot_product(e_xbar, e_beta)) -
          stan::math::dot_product(a_xbar,
            stan::math::elt_multiply(a_beta, a_scale)));
      }
      out__.write(e_alpha);
      out__.write(mean_PPD);
      out__.write(yAlpha1);
      out__.write(yAlpha2);
      out__.write(yAlpha3);
      out__.write(bCov1);
      out__.write(bCov2);
      out__.write(b1);
      out__.write(b2);
    } 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;
      std::vector<local_scalar_t__> yGamma1 =
        std::vector<local_scalar_t__>(yGamma1_1dim__, DUMMY_VAR__);
      current_statement__ = 1;
      stan::model::assign(yGamma1,
        in__.read<std::vector<local_scalar_t__>>(yGamma1_1dim__),
        "assigning variable yGamma1");
      out__.write_free_lub(lb(
                             stan::model::rvalue(intercept_type,
                               "intercept_type", stan::model::index_uni(1)),
                             pstream__),
        ub(
          stan::model::rvalue(intercept_type, "intercept_type",
            stan::model::index_uni(1)), pstream__), yGamma1);
      std::vector<local_scalar_t__> yGamma2 =
        std::vector<local_scalar_t__>(yGamma2_1dim__, DUMMY_VAR__);
      current_statement__ = 2;
      stan::model::assign(yGamma2,
        in__.read<std::vector<local_scalar_t__>>(yGamma2_1dim__),
        "assigning variable yGamma2");
      out__.write_free_lub(lb(
                             stan::model::rvalue(intercept_type,
                               "intercept_type", stan::model::index_uni(2)),
                             pstream__),
        ub(
          stan::model::rvalue(intercept_type, "intercept_type",
            stan::model::index_uni(2)), pstream__), yGamma2);
      std::vector<local_scalar_t__> yGamma3 =
        std::vector<local_scalar_t__>(yGamma3_1dim__, DUMMY_VAR__);
      current_statement__ = 3;
      stan::model::assign(yGamma3,
        in__.read<std::vector<local_scalar_t__>>(yGamma3_1dim__),
        "assigning variable yGamma3");
      out__.write_free_lub(lb(
                             stan::model::rvalue(intercept_type,
                               "intercept_type", stan::model::index_uni(3)),
                             pstream__),
        ub(
          stan::model::rvalue(intercept_type, "intercept_type",
            stan::model::index_uni(3)), pstream__), yGamma3);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta1_1dim__,
          DUMMY_VAR__);
      current_statement__ = 4;
      stan::model::assign(z_yBeta1,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta1_1dim__),
        "assigning variable z_yBeta1");
      out__.write(z_yBeta1);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta2_1dim__,
          DUMMY_VAR__);
      current_statement__ = 5;
      stan::model::assign(z_yBeta2,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta2_1dim__),
        "assigning variable z_yBeta2");
      out__.write(z_yBeta2);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta3_1dim__,
          DUMMY_VAR__);
      current_statement__ = 6;
      stan::model::assign(z_yBeta3,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta3_1dim__),
        "assigning variable z_yBeta3");
      out__.write(z_yBeta3);
      Eigen::Matrix<local_scalar_t__,-1,1> z_b =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_b_1dim__,
          DUMMY_VAR__);
      current_statement__ = 7;
      stan::model::assign(z_b,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(z_b_1dim__),
        "assigning variable z_b");
      out__.write(z_b);
      Eigen::Matrix<local_scalar_t__,-1,1> z_T =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_T_1dim__,
          DUMMY_VAR__);
      current_statement__ = 8;
      stan::model::assign(z_T,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(z_T_1dim__),
        "assigning variable z_T");
      out__.write(z_T);
      Eigen::Matrix<local_scalar_t__,-1,1> rho =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(rho_1dim__,
          DUMMY_VAR__);
      current_statement__ = 9;
      stan::model::assign(rho,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(rho_1dim__),
        "assigning variable rho");
      out__.write_free_lub(0, 1, rho);
      Eigen::Matrix<local_scalar_t__,-1,1> zeta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(zeta_1dim__,
          DUMMY_VAR__);
      current_statement__ = 10;
      stan::model::assign(zeta,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(zeta_1dim__),
        "assigning variable zeta");
      out__.write_free_lb(0, zeta);
      Eigen::Matrix<local_scalar_t__,-1,1> tau =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(tau_1dim__,
          DUMMY_VAR__);
      current_statement__ = 11;
      stan::model::assign(tau,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(tau_1dim__),
        "assigning variable tau");
      out__.write_free_lb(0, tau);
      Eigen::Matrix<local_scalar_t__,-1,1> bSd1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(bSd1_1dim__,
          DUMMY_VAR__);
      current_statement__ = 12;
      stan::model::assign(bSd1,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(bSd1_1dim__),
        "assigning variable bSd1");
      out__.write_free_lb(0, bSd1);
      Eigen::Matrix<local_scalar_t__,-1,-1> z_bMat1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(z_bMat1_1dim__,
          z_bMat1_2dim__, DUMMY_VAR__);
      current_statement__ = 13;
      stan::model::assign(z_bMat1,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,-1>>(z_bMat1_1dim__,
          z_bMat1_2dim__), "assigning variable z_bMat1");
      out__.write(z_bMat1);
      Eigen::Matrix<local_scalar_t__,-1,-1> bCholesky1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bCholesky1_1dim__,
          bCholesky1_2dim__, DUMMY_VAR__);
      current_statement__ = 14;
      stan::model::assign(bCholesky1,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,-1>>(bCholesky1_1dim__,
          bCholesky1_2dim__), "assigning variable bCholesky1");
      out__.write_free_cholesky_factor_corr(bCholesky1);
      Eigen::Matrix<local_scalar_t__,-1,1> bSd2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(bSd2_1dim__,
          DUMMY_VAR__);
      current_statement__ = 15;
      stan::model::assign(bSd2,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(bSd2_1dim__),
        "assigning variable bSd2");
      out__.write_free_lb(0, bSd2);
      Eigen::Matrix<local_scalar_t__,-1,-1> z_bMat2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(z_bMat2_1dim__,
          z_bMat2_2dim__, DUMMY_VAR__);
      current_statement__ = 16;
      stan::model::assign(z_bMat2,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,-1>>(z_bMat2_1dim__,
          z_bMat2_2dim__), "assigning variable z_bMat2");
      out__.write(z_bMat2);
      Eigen::Matrix<local_scalar_t__,-1,-1> bCholesky2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bCholesky2_1dim__,
          bCholesky2_2dim__, DUMMY_VAR__);
      current_statement__ = 17;
      stan::model::assign(bCholesky2,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,-1>>(bCholesky2_1dim__,
          bCholesky2_2dim__), "assigning variable bCholesky2");
      out__.write_free_cholesky_factor_corr(bCholesky2);
      std::vector<local_scalar_t__> yAux1_unscaled =
        std::vector<local_scalar_t__>(yAux1_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 18;
      stan::model::assign(yAux1_unscaled,
        in__.read<std::vector<local_scalar_t__>>(yAux1_unscaled_1dim__),
        "assigning variable yAux1_unscaled");
      out__.write_free_lb(0, yAux1_unscaled);
      std::vector<local_scalar_t__> yAux2_unscaled =
        std::vector<local_scalar_t__>(yAux2_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 19;
      stan::model::assign(yAux2_unscaled,
        in__.read<std::vector<local_scalar_t__>>(yAux2_unscaled_1dim__),
        "assigning variable yAux2_unscaled");
      out__.write_free_lb(0, yAux2_unscaled);
      std::vector<local_scalar_t__> yAux3_unscaled =
        std::vector<local_scalar_t__>(yAux3_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 20;
      stan::model::assign(yAux3_unscaled,
        in__.read<std::vector<local_scalar_t__>>(yAux3_unscaled_1dim__),
        "assigning variable yAux3_unscaled");
      out__.write_free_lb(0, yAux3_unscaled);
      std::vector<local_scalar_t__> yGlobal1 =
        std::vector<local_scalar_t__>(yHs1, DUMMY_VAR__);
      current_statement__ = 21;
      stan::model::assign(yGlobal1,
        in__.read<std::vector<local_scalar_t__>>(yHs1),
        "assigning variable yGlobal1");
      out__.write_free_lb(0, yGlobal1);
      std::vector<local_scalar_t__> yGlobal2 =
        std::vector<local_scalar_t__>(yHs2, DUMMY_VAR__);
      current_statement__ = 22;
      stan::model::assign(yGlobal2,
        in__.read<std::vector<local_scalar_t__>>(yHs2),
        "assigning variable yGlobal2");
      out__.write_free_lb(0, yGlobal2);
      std::vector<local_scalar_t__> yGlobal3 =
        std::vector<local_scalar_t__>(yHs3, DUMMY_VAR__);
      current_statement__ = 23;
      stan::model::assign(yGlobal3,
        in__.read<std::vector<local_scalar_t__>>(yHs3),
        "assigning variable yGlobal3");
      out__.write_free_lb(0, yGlobal3);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs1,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal1_2dim__,
            DUMMY_VAR__));
      current_statement__ = 24;
      for (int sym1__ = 1; sym1__ <= yLocal1_2dim__; ++sym1__) {
        current_statement__ = 24;
        for (int sym2__ = 1; sym2__ <= yHs1; ++sym2__) {
          current_statement__ = 24;
          stan::model::assign(yLocal1, in__.read<local_scalar_t__>(),
            "assigning variable yLocal1", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, yLocal1);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs2,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal2_2dim__,
            DUMMY_VAR__));
      current_statement__ = 25;
      for (int sym1__ = 1; sym1__ <= yLocal2_2dim__; ++sym1__) {
        current_statement__ = 25;
        for (int sym2__ = 1; sym2__ <= yHs2; ++sym2__) {
          current_statement__ = 25;
          stan::model::assign(yLocal2, in__.read<local_scalar_t__>(),
            "assigning variable yLocal2", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, yLocal2);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs3,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal3_2dim__,
            DUMMY_VAR__));
      current_statement__ = 26;
      for (int sym1__ = 1; sym1__ <= yLocal3_2dim__; ++sym1__) {
        current_statement__ = 26;
        for (int sym2__ = 1; sym2__ <= yHs3; ++sym2__) {
          current_statement__ = 26;
          stan::model::assign(yLocal3, in__.read<local_scalar_t__>(),
            "assigning variable yLocal3", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, yLocal3);
      std::vector<local_scalar_t__> y_caux1 =
        std::vector<local_scalar_t__>(y_caux1_1dim__, DUMMY_VAR__);
      current_statement__ = 27;
      stan::model::assign(y_caux1,
        in__.read<std::vector<local_scalar_t__>>(y_caux1_1dim__),
        "assigning variable y_caux1");
      out__.write_free_lb(0, y_caux1);
      std::vector<local_scalar_t__> y_caux2 =
        std::vector<local_scalar_t__>(y_caux2_1dim__, DUMMY_VAR__);
      current_statement__ = 28;
      stan::model::assign(y_caux2,
        in__.read<std::vector<local_scalar_t__>>(y_caux2_1dim__),
        "assigning variable y_caux2");
      out__.write_free_lb(0, y_caux2);
      std::vector<local_scalar_t__> y_caux3 =
        std::vector<local_scalar_t__>(y_caux3_1dim__, DUMMY_VAR__);
      current_statement__ = 29;
      stan::model::assign(y_caux3,
        in__.read<std::vector<local_scalar_t__>>(y_caux3_1dim__),
        "assigning variable y_caux3");
      out__.write_free_lb(0, y_caux3);
      std::vector<local_scalar_t__> yOol1 =
        std::vector<local_scalar_t__>(yOol1_1dim__, DUMMY_VAR__);
      current_statement__ = 30;
      stan::model::assign(yOol1,
        in__.read<std::vector<local_scalar_t__>>(yOol1_1dim__),
        "assigning variable yOol1");
      out__.write_free_lb(0, yOol1);
      std::vector<local_scalar_t__> yOol2 =
        std::vector<local_scalar_t__>(yOol2_1dim__, DUMMY_VAR__);
      current_statement__ = 31;
      stan::model::assign(yOol2,
        in__.read<std::vector<local_scalar_t__>>(yOol2_1dim__),
        "assigning variable yOol2");
      out__.write_free_lb(0, yOol2);
      std::vector<local_scalar_t__> yOol3 =
        std::vector<local_scalar_t__>(yOol3_1dim__, DUMMY_VAR__);
      current_statement__ = 32;
      stan::model::assign(yOol3,
        in__.read<std::vector<local_scalar_t__>>(yOol3_1dim__),
        "assigning variable yOol3");
      out__.write_free_lb(0, yOol3);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix1_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix1_2dim__,
            DUMMY_VAR__));
      current_statement__ = 33;
      for (int sym1__ = 1; sym1__ <= yMix1_2dim__; ++sym1__) {
        current_statement__ = 33;
        for (int sym2__ = 1; sym2__ <= yMix1_1dim__; ++sym2__) {
          current_statement__ = 33;
          stan::model::assign(yMix1, in__.read<local_scalar_t__>(),
            "assigning variable yMix1", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, yMix1);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix2_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix2_2dim__,
            DUMMY_VAR__));
      current_statement__ = 34;
      for (int sym1__ = 1; sym1__ <= yMix2_2dim__; ++sym1__) {
        current_statement__ = 34;
        for (int sym2__ = 1; sym2__ <= yMix2_1dim__; ++sym2__) {
          current_statement__ = 34;
          stan::model::assign(yMix2, in__.read<local_scalar_t__>(),
            "assigning variable yMix2", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, yMix2);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix3_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix3_2dim__,
            DUMMY_VAR__));
      current_statement__ = 35;
      for (int sym1__ = 1; sym1__ <= yMix3_2dim__; ++sym1__) {
        current_statement__ = 35;
        for (int sym2__ = 1; sym2__ <= yMix3_1dim__; ++sym2__) {
          current_statement__ = 35;
          stan::model::assign(yMix3, in__.read<local_scalar_t__>(),
            "assigning variable yMix3", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, yMix3);
      std::vector<local_scalar_t__> e_gamma =
        std::vector<local_scalar_t__>(e_has_intercept, DUMMY_VAR__);
      current_statement__ = 36;
      stan::model::assign(e_gamma,
        in__.read<std::vector<local_scalar_t__>>(e_has_intercept),
        "assigning variable e_gamma");
      out__.write(e_gamma);
      Eigen::Matrix<local_scalar_t__,-1,1> e_z_beta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(e_K, DUMMY_VAR__);
      current_statement__ = 37;
      stan::model::assign(e_z_beta,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(e_K),
        "assigning variable e_z_beta");
      out__.write(e_z_beta);
      Eigen::Matrix<local_scalar_t__,-1,1> e_aux_unscaled =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(basehaz_df,
          DUMMY_VAR__);
      current_statement__ = 38;
      stan::model::assign(e_aux_unscaled,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(basehaz_df),
        "assigning variable e_aux_unscaled");
      out__.write_free_lb((stan::math::logical_eq(basehaz_type, 1) ? 0 : 
        stan::math::negative_infinity()), e_aux_unscaled);
      std::vector<local_scalar_t__> e_global =
        std::vector<local_scalar_t__>(e_hs, DUMMY_VAR__);
      current_statement__ = 39;
      stan::model::assign(e_global,
        in__.read<std::vector<local_scalar_t__>>(e_hs),
        "assigning variable e_global");
      out__.write_free_lb(0, e_global);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> e_local =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(e_hs,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(e_local_2dim__,
            DUMMY_VAR__));
      current_statement__ = 40;
      for (int sym1__ = 1; sym1__ <= e_local_2dim__; ++sym1__) {
        current_statement__ = 40;
        for (int sym2__ = 1; sym2__ <= e_hs; ++sym2__) {
          current_statement__ = 40;
          stan::model::assign(e_local, in__.read<local_scalar_t__>(),
            "assigning variable e_local", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, e_local);
      std::vector<local_scalar_t__> e_caux =
        std::vector<local_scalar_t__>(e_caux_1dim__, DUMMY_VAR__);
      current_statement__ = 41;
      stan::model::assign(e_caux,
        in__.read<std::vector<local_scalar_t__>>(e_caux_1dim__),
        "assigning variable e_caux");
      out__.write_free_lb(0, e_caux);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> e_mix =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(e_mix_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(e_K, DUMMY_VAR__));
      current_statement__ = 42;
      for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
        current_statement__ = 42;
        for (int sym2__ = 1; sym2__ <= e_mix_1dim__; ++sym2__) {
          current_statement__ = 42;
          stan::model::assign(e_mix, in__.read<local_scalar_t__>(),
            "assigning variable e_mix", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, e_mix);
      std::vector<local_scalar_t__> e_ool =
        std::vector<local_scalar_t__>(e_ool_1dim__, DUMMY_VAR__);
      current_statement__ = 43;
      stan::model::assign(e_ool,
        in__.read<std::vector<local_scalar_t__>>(e_ool_1dim__),
        "assigning variable e_ool");
      out__.write_free_lb(0, e_ool);
      Eigen::Matrix<local_scalar_t__,-1,1> a_z_beta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(a_K, DUMMY_VAR__);
      current_statement__ = 44;
      stan::model::assign(a_z_beta,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(a_K),
        "assigning variable a_z_beta");
      out__.write(a_z_beta);
      std::vector<local_scalar_t__> a_global =
        std::vector<local_scalar_t__>(a_hs, DUMMY_VAR__);
      current_statement__ = 45;
      stan::model::assign(a_global,
        in__.read<std::vector<local_scalar_t__>>(a_hs),
        "assigning variable a_global");
      out__.write_free_lb(0, a_global);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> a_local =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(a_hs,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(a_local_2dim__,
            DUMMY_VAR__));
      current_statement__ = 46;
      for (int sym1__ = 1; sym1__ <= a_local_2dim__; ++sym1__) {
        current_statement__ = 46;
        for (int sym2__ = 1; sym2__ <= a_hs; ++sym2__) {
          current_statement__ = 46;
          stan::model::assign(a_local, in__.read<local_scalar_t__>(),
            "assigning variable a_local", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, a_local);
      std::vector<local_scalar_t__> a_caux =
        std::vector<local_scalar_t__>(a_caux_1dim__, DUMMY_VAR__);
      current_statement__ = 47;
      stan::model::assign(a_caux,
        in__.read<std::vector<local_scalar_t__>>(a_caux_1dim__),
        "assigning variable a_caux");
      out__.write_free_lb(0, a_caux);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> a_mix =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(a_mix_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(a_K, DUMMY_VAR__));
      current_statement__ = 48;
      for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
        current_statement__ = 48;
        for (int sym2__ = 1; sym2__ <= a_mix_1dim__; ++sym2__) {
          current_statement__ = 48;
          stan::model::assign(a_mix, in__.read<local_scalar_t__>(),
            "assigning variable a_mix", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, a_mix);
      std::vector<local_scalar_t__> a_ool =
        std::vector<local_scalar_t__>(a_ool_1dim__, DUMMY_VAR__);
      current_statement__ = 49;
      stan::model::assign(a_ool,
        in__.read<std::vector<local_scalar_t__>>(a_ool_1dim__),
        "assigning variable a_ool");
      out__.write_free_lb(0, a_ool);
    } 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", "yGamma1",
        "double", std::vector<size_t>{static_cast<size_t>(yGamma1_1dim__)});
      current_statement__ = 2;
      context__.validate_dims("parameter initialization", "yGamma2",
        "double", std::vector<size_t>{static_cast<size_t>(yGamma2_1dim__)});
      current_statement__ = 3;
      context__.validate_dims("parameter initialization", "yGamma3",
        "double", std::vector<size_t>{static_cast<size_t>(yGamma3_1dim__)});
      current_statement__ = 4;
      context__.validate_dims("parameter initialization", "z_yBeta1",
        "double", std::vector<size_t>{static_cast<size_t>(z_yBeta1_1dim__)});
      current_statement__ = 5;
      context__.validate_dims("parameter initialization", "z_yBeta2",
        "double", std::vector<size_t>{static_cast<size_t>(z_yBeta2_1dim__)});
      current_statement__ = 6;
      context__.validate_dims("parameter initialization", "z_yBeta3",
        "double", std::vector<size_t>{static_cast<size_t>(z_yBeta3_1dim__)});
      current_statement__ = 7;
      context__.validate_dims("parameter initialization", "z_b", "double",
        std::vector<size_t>{static_cast<size_t>(z_b_1dim__)});
      current_statement__ = 8;
      context__.validate_dims("parameter initialization", "z_T", "double",
        std::vector<size_t>{static_cast<size_t>(z_T_1dim__)});
      current_statement__ = 9;
      context__.validate_dims("parameter initialization", "rho", "double",
        std::vector<size_t>{static_cast<size_t>(rho_1dim__)});
      current_statement__ = 10;
      context__.validate_dims("parameter initialization", "zeta", "double",
        std::vector<size_t>{static_cast<size_t>(zeta_1dim__)});
      current_statement__ = 11;
      context__.validate_dims("parameter initialization", "tau", "double",
        std::vector<size_t>{static_cast<size_t>(tau_1dim__)});
      current_statement__ = 12;
      context__.validate_dims("parameter initialization", "bSd1", "double",
        std::vector<size_t>{static_cast<size_t>(bSd1_1dim__)});
      current_statement__ = 13;
      context__.validate_dims("parameter initialization", "z_bMat1",
        "double",
        std::vector<size_t>{static_cast<size_t>(z_bMat1_1dim__),
          static_cast<size_t>(z_bMat1_2dim__)});
      current_statement__ = 14;
      context__.validate_dims("parameter initialization", "bCholesky1",
        "double",
        std::vector<size_t>{static_cast<size_t>(bCholesky1_1dim__),
          static_cast<size_t>(bCholesky1_2dim__)});
      current_statement__ = 15;
      context__.validate_dims("parameter initialization", "bSd2", "double",
        std::vector<size_t>{static_cast<size_t>(bSd2_1dim__)});
      current_statement__ = 16;
      context__.validate_dims("parameter initialization", "z_bMat2",
        "double",
        std::vector<size_t>{static_cast<size_t>(z_bMat2_1dim__),
          static_cast<size_t>(z_bMat2_2dim__)});
      current_statement__ = 17;
      context__.validate_dims("parameter initialization", "bCholesky2",
        "double",
        std::vector<size_t>{static_cast<size_t>(bCholesky2_1dim__),
          static_cast<size_t>(bCholesky2_2dim__)});
      current_statement__ = 18;
      context__.validate_dims("parameter initialization", "yAux1_unscaled",
        "double",
        std::vector<size_t>{static_cast<size_t>(yAux1_unscaled_1dim__)});
      current_statement__ = 19;
      context__.validate_dims("parameter initialization", "yAux2_unscaled",
        "double",
        std::vector<size_t>{static_cast<size_t>(yAux2_unscaled_1dim__)});
      current_statement__ = 20;
      context__.validate_dims("parameter initialization", "yAux3_unscaled",
        "double",
        std::vector<size_t>{static_cast<size_t>(yAux3_unscaled_1dim__)});
      current_statement__ = 21;
      context__.validate_dims("parameter initialization", "yGlobal1",
        "double", std::vector<size_t>{static_cast<size_t>(yHs1)});
      current_statement__ = 22;
      context__.validate_dims("parameter initialization", "yGlobal2",
        "double", std::vector<size_t>{static_cast<size_t>(yHs2)});
      current_statement__ = 23;
      context__.validate_dims("parameter initialization", "yGlobal3",
        "double", std::vector<size_t>{static_cast<size_t>(yHs3)});
      current_statement__ = 24;
      context__.validate_dims("parameter initialization", "yLocal1",
        "double",
        std::vector<size_t>{static_cast<size_t>(yHs1),
          static_cast<size_t>(yLocal1_2dim__)});
      current_statement__ = 25;
      context__.validate_dims("parameter initialization", "yLocal2",
        "double",
        std::vector<size_t>{static_cast<size_t>(yHs2),
          static_cast<size_t>(yLocal2_2dim__)});
      current_statement__ = 26;
      context__.validate_dims("parameter initialization", "yLocal3",
        "double",
        std::vector<size_t>{static_cast<size_t>(yHs3),
          static_cast<size_t>(yLocal3_2dim__)});
      current_statement__ = 27;
      context__.validate_dims("parameter initialization", "y_caux1",
        "double", std::vector<size_t>{static_cast<size_t>(y_caux1_1dim__)});
      current_statement__ = 28;
      context__.validate_dims("parameter initialization", "y_caux2",
        "double", std::vector<size_t>{static_cast<size_t>(y_caux2_1dim__)});
      current_statement__ = 29;
      context__.validate_dims("parameter initialization", "y_caux3",
        "double", std::vector<size_t>{static_cast<size_t>(y_caux3_1dim__)});
      current_statement__ = 30;
      context__.validate_dims("parameter initialization", "yOol1", "double",
        std::vector<size_t>{static_cast<size_t>(yOol1_1dim__)});
      current_statement__ = 31;
      context__.validate_dims("parameter initialization", "yOol2", "double",
        std::vector<size_t>{static_cast<size_t>(yOol2_1dim__)});
      current_statement__ = 32;
      context__.validate_dims("parameter initialization", "yOol3", "double",
        std::vector<size_t>{static_cast<size_t>(yOol3_1dim__)});
      current_statement__ = 33;
      context__.validate_dims("parameter initialization", "yMix1", "double",
        std::vector<size_t>{static_cast<size_t>(yMix1_1dim__),
          static_cast<size_t>(yMix1_2dim__)});
      current_statement__ = 34;
      context__.validate_dims("parameter initialization", "yMix2", "double",
        std::vector<size_t>{static_cast<size_t>(yMix2_1dim__),
          static_cast<size_t>(yMix2_2dim__)});
      current_statement__ = 35;
      context__.validate_dims("parameter initialization", "yMix3", "double",
        std::vector<size_t>{static_cast<size_t>(yMix3_1dim__),
          static_cast<size_t>(yMix3_2dim__)});
      current_statement__ = 36;
      context__.validate_dims("parameter initialization", "e_gamma",
        "double", std::vector<size_t>{static_cast<size_t>(e_has_intercept)});
      current_statement__ = 37;
      context__.validate_dims("parameter initialization", "e_z_beta",
        "double", std::vector<size_t>{static_cast<size_t>(e_K)});
      current_statement__ = 38;
      context__.validate_dims("parameter initialization", "e_aux_unscaled",
        "double", std::vector<size_t>{static_cast<size_t>(basehaz_df)});
      current_statement__ = 39;
      context__.validate_dims("parameter initialization", "e_global",
        "double", std::vector<size_t>{static_cast<size_t>(e_hs)});
      current_statement__ = 40;
      context__.validate_dims("parameter initialization", "e_local",
        "double",
        std::vector<size_t>{static_cast<size_t>(e_hs),
          static_cast<size_t>(e_local_2dim__)});
      current_statement__ = 41;
      context__.validate_dims("parameter initialization", "e_caux", "double",
        std::vector<size_t>{static_cast<size_t>(e_caux_1dim__)});
      current_statement__ = 42;
      context__.validate_dims("parameter initialization", "e_mix", "double",
        std::vector<size_t>{static_cast<size_t>(e_mix_1dim__),
          static_cast<size_t>(e_K)});
      current_statement__ = 43;
      context__.validate_dims("parameter initialization", "e_ool", "double",
        std::vector<size_t>{static_cast<size_t>(e_ool_1dim__)});
      current_statement__ = 44;
      context__.validate_dims("parameter initialization", "a_z_beta",
        "double", std::vector<size_t>{static_cast<size_t>(a_K)});
      current_statement__ = 45;
      context__.validate_dims("parameter initialization", "a_global",
        "double", std::vector<size_t>{static_cast<size_t>(a_hs)});
      current_statement__ = 46;
      context__.validate_dims("parameter initialization", "a_local",
        "double",
        std::vector<size_t>{static_cast<size_t>(a_hs),
          static_cast<size_t>(a_local_2dim__)});
      current_statement__ = 47;
      context__.validate_dims("parameter initialization", "a_caux", "double",
        std::vector<size_t>{static_cast<size_t>(a_caux_1dim__)});
      current_statement__ = 48;
      context__.validate_dims("parameter initialization", "a_mix", "double",
        std::vector<size_t>{static_cast<size_t>(a_mix_1dim__),
          static_cast<size_t>(a_K)});
      current_statement__ = 49;
      context__.validate_dims("parameter initialization", "a_ool", "double",
        std::vector<size_t>{static_cast<size_t>(a_ool_1dim__)});
      int pos__ = std::numeric_limits<int>::min();
      pos__ = 1;
      std::vector<local_scalar_t__> yGamma1 =
        std::vector<local_scalar_t__>(yGamma1_1dim__, DUMMY_VAR__);
      current_statement__ = 1;
      yGamma1 = context__.vals_r("yGamma1");
      out__.write_free_lub(lb(
                             stan::model::rvalue(intercept_type,
                               "intercept_type", stan::model::index_uni(1)),
                             pstream__),
        ub(
          stan::model::rvalue(intercept_type, "intercept_type",
            stan::model::index_uni(1)), pstream__), yGamma1);
      std::vector<local_scalar_t__> yGamma2 =
        std::vector<local_scalar_t__>(yGamma2_1dim__, DUMMY_VAR__);
      current_statement__ = 2;
      yGamma2 = context__.vals_r("yGamma2");
      out__.write_free_lub(lb(
                             stan::model::rvalue(intercept_type,
                               "intercept_type", stan::model::index_uni(2)),
                             pstream__),
        ub(
          stan::model::rvalue(intercept_type, "intercept_type",
            stan::model::index_uni(2)), pstream__), yGamma2);
      std::vector<local_scalar_t__> yGamma3 =
        std::vector<local_scalar_t__>(yGamma3_1dim__, DUMMY_VAR__);
      current_statement__ = 3;
      yGamma3 = context__.vals_r("yGamma3");
      out__.write_free_lub(lb(
                             stan::model::rvalue(intercept_type,
                               "intercept_type", stan::model::index_uni(3)),
                             pstream__),
        ub(
          stan::model::rvalue(intercept_type, "intercept_type",
            stan::model::index_uni(3)), pstream__), yGamma3);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta1_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_yBeta1_flat__;
        current_statement__ = 4;
        z_yBeta1_flat__ = context__.vals_r("z_yBeta1");
        current_statement__ = 4;
        pos__ = 1;
        current_statement__ = 4;
        for (int sym1__ = 1; sym1__ <= z_yBeta1_1dim__; ++sym1__) {
          current_statement__ = 4;
          stan::model::assign(z_yBeta1, z_yBeta1_flat__[(pos__ - 1)],
            "assigning variable z_yBeta1", stan::model::index_uni(sym1__));
          current_statement__ = 4;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_yBeta1);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta2_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_yBeta2_flat__;
        current_statement__ = 5;
        z_yBeta2_flat__ = context__.vals_r("z_yBeta2");
        current_statement__ = 5;
        pos__ = 1;
        current_statement__ = 5;
        for (int sym1__ = 1; sym1__ <= z_yBeta2_1dim__; ++sym1__) {
          current_statement__ = 5;
          stan::model::assign(z_yBeta2, z_yBeta2_flat__[(pos__ - 1)],
            "assigning variable z_yBeta2", stan::model::index_uni(sym1__));
          current_statement__ = 5;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_yBeta2);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta3_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_yBeta3_flat__;
        current_statement__ = 6;
        z_yBeta3_flat__ = context__.vals_r("z_yBeta3");
        current_statement__ = 6;
        pos__ = 1;
        current_statement__ = 6;
        for (int sym1__ = 1; sym1__ <= z_yBeta3_1dim__; ++sym1__) {
          current_statement__ = 6;
          stan::model::assign(z_yBeta3, z_yBeta3_flat__[(pos__ - 1)],
            "assigning variable z_yBeta3", stan::model::index_uni(sym1__));
          current_statement__ = 6;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_yBeta3);
      Eigen::Matrix<local_scalar_t__,-1,1> z_b =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_b_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_b_flat__;
        current_statement__ = 7;
        z_b_flat__ = context__.vals_r("z_b");
        current_statement__ = 7;
        pos__ = 1;
        current_statement__ = 7;
        for (int sym1__ = 1; sym1__ <= z_b_1dim__; ++sym1__) {
          current_statement__ = 7;
          stan::model::assign(z_b, z_b_flat__[(pos__ - 1)],
            "assigning variable z_b", stan::model::index_uni(sym1__));
          current_statement__ = 7;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_b);
      Eigen::Matrix<local_scalar_t__,-1,1> z_T =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_T_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_T_flat__;
        current_statement__ = 8;
        z_T_flat__ = context__.vals_r("z_T");
        current_statement__ = 8;
        pos__ = 1;
        current_statement__ = 8;
        for (int sym1__ = 1; sym1__ <= z_T_1dim__; ++sym1__) {
          current_statement__ = 8;
          stan::model::assign(z_T, z_T_flat__[(pos__ - 1)],
            "assigning variable z_T", stan::model::index_uni(sym1__));
          current_statement__ = 8;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_T);
      Eigen::Matrix<local_scalar_t__,-1,1> rho =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(rho_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> rho_flat__;
        current_statement__ = 9;
        rho_flat__ = context__.vals_r("rho");
        current_statement__ = 9;
        pos__ = 1;
        current_statement__ = 9;
        for (int sym1__ = 1; sym1__ <= rho_1dim__; ++sym1__) {
          current_statement__ = 9;
          stan::model::assign(rho, rho_flat__[(pos__ - 1)],
            "assigning variable rho", stan::model::index_uni(sym1__));
          current_statement__ = 9;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lub(0, 1, rho);
      Eigen::Matrix<local_scalar_t__,-1,1> zeta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(zeta_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> zeta_flat__;
        current_statement__ = 10;
        zeta_flat__ = context__.vals_r("zeta");
        current_statement__ = 10;
        pos__ = 1;
        current_statement__ = 10;
        for (int sym1__ = 1; sym1__ <= zeta_1dim__; ++sym1__) {
          current_statement__ = 10;
          stan::model::assign(zeta, zeta_flat__[(pos__ - 1)],
            "assigning variable zeta", stan::model::index_uni(sym1__));
          current_statement__ = 10;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, zeta);
      Eigen::Matrix<local_scalar_t__,-1,1> tau =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(tau_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> tau_flat__;
        current_statement__ = 11;
        tau_flat__ = context__.vals_r("tau");
        current_statement__ = 11;
        pos__ = 1;
        current_statement__ = 11;
        for (int sym1__ = 1; sym1__ <= tau_1dim__; ++sym1__) {
          current_statement__ = 11;
          stan::model::assign(tau, tau_flat__[(pos__ - 1)],
            "assigning variable tau", stan::model::index_uni(sym1__));
          current_statement__ = 11;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, tau);
      Eigen::Matrix<local_scalar_t__,-1,1> bSd1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(bSd1_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> bSd1_flat__;
        current_statement__ = 12;
        bSd1_flat__ = context__.vals_r("bSd1");
        current_statement__ = 12;
        pos__ = 1;
        current_statement__ = 12;
        for (int sym1__ = 1; sym1__ <= bSd1_1dim__; ++sym1__) {
          current_statement__ = 12;
          stan::model::assign(bSd1, bSd1_flat__[(pos__ - 1)],
            "assigning variable bSd1", stan::model::index_uni(sym1__));
          current_statement__ = 12;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, bSd1);
      Eigen::Matrix<local_scalar_t__,-1,-1> z_bMat1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(z_bMat1_1dim__,
          z_bMat1_2dim__, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_bMat1_flat__;
        current_statement__ = 13;
        z_bMat1_flat__ = context__.vals_r("z_bMat1");
        current_statement__ = 13;
        pos__ = 1;
        current_statement__ = 13;
        for (int sym1__ = 1; sym1__ <= z_bMat1_2dim__; ++sym1__) {
          current_statement__ = 13;
          for (int sym2__ = 1; sym2__ <= z_bMat1_1dim__; ++sym2__) {
            current_statement__ = 13;
            stan::model::assign(z_bMat1, z_bMat1_flat__[(pos__ - 1)],
              "assigning variable z_bMat1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 13;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write(z_bMat1);
      Eigen::Matrix<local_scalar_t__,-1,-1> bCholesky1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bCholesky1_1dim__,
          bCholesky1_2dim__, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> bCholesky1_flat__;
        current_statement__ = 14;
        bCholesky1_flat__ = context__.vals_r("bCholesky1");
        current_statement__ = 14;
        pos__ = 1;
        current_statement__ = 14;
        for (int sym1__ = 1; sym1__ <= bCholesky1_2dim__; ++sym1__) {
          current_statement__ = 14;
          for (int sym2__ = 1; sym2__ <= bCholesky1_1dim__; ++sym2__) {
            current_statement__ = 14;
            stan::model::assign(bCholesky1, bCholesky1_flat__[(pos__ - 1)],
              "assigning variable bCholesky1",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 14;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_cholesky_factor_corr(bCholesky1);
      Eigen::Matrix<local_scalar_t__,-1,1> bSd2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(bSd2_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> bSd2_flat__;
        current_statement__ = 15;
        bSd2_flat__ = context__.vals_r("bSd2");
        current_statement__ = 15;
        pos__ = 1;
        current_statement__ = 15;
        for (int sym1__ = 1; sym1__ <= bSd2_1dim__; ++sym1__) {
          current_statement__ = 15;
          stan::model::assign(bSd2, bSd2_flat__[(pos__ - 1)],
            "assigning variable bSd2", stan::model::index_uni(sym1__));
          current_statement__ = 15;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, bSd2);
      Eigen::Matrix<local_scalar_t__,-1,-1> z_bMat2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(z_bMat2_1dim__,
          z_bMat2_2dim__, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_bMat2_flat__;
        current_statement__ = 16;
        z_bMat2_flat__ = context__.vals_r("z_bMat2");
        current_statement__ = 16;
        pos__ = 1;
        current_statement__ = 16;
        for (int sym1__ = 1; sym1__ <= z_bMat2_2dim__; ++sym1__) {
          current_statement__ = 16;
          for (int sym2__ = 1; sym2__ <= z_bMat2_1dim__; ++sym2__) {
            current_statement__ = 16;
            stan::model::assign(z_bMat2, z_bMat2_flat__[(pos__ - 1)],
              "assigning variable z_bMat2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 16;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write(z_bMat2);
      Eigen::Matrix<local_scalar_t__,-1,-1> bCholesky2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bCholesky2_1dim__,
          bCholesky2_2dim__, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> bCholesky2_flat__;
        current_statement__ = 17;
        bCholesky2_flat__ = context__.vals_r("bCholesky2");
        current_statement__ = 17;
        pos__ = 1;
        current_statement__ = 17;
        for (int sym1__ = 1; sym1__ <= bCholesky2_2dim__; ++sym1__) {
          current_statement__ = 17;
          for (int sym2__ = 1; sym2__ <= bCholesky2_1dim__; ++sym2__) {
            current_statement__ = 17;
            stan::model::assign(bCholesky2, bCholesky2_flat__[(pos__ - 1)],
              "assigning variable bCholesky2",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 17;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_cholesky_factor_corr(bCholesky2);
      std::vector<local_scalar_t__> yAux1_unscaled =
        std::vector<local_scalar_t__>(yAux1_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 18;
      yAux1_unscaled = context__.vals_r("yAux1_unscaled");
      out__.write_free_lb(0, yAux1_unscaled);
      std::vector<local_scalar_t__> yAux2_unscaled =
        std::vector<local_scalar_t__>(yAux2_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 19;
      yAux2_unscaled = context__.vals_r("yAux2_unscaled");
      out__.write_free_lb(0, yAux2_unscaled);
      std::vector<local_scalar_t__> yAux3_unscaled =
        std::vector<local_scalar_t__>(yAux3_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 20;
      yAux3_unscaled = context__.vals_r("yAux3_unscaled");
      out__.write_free_lb(0, yAux3_unscaled);
      std::vector<local_scalar_t__> yGlobal1 =
        std::vector<local_scalar_t__>(yHs1, DUMMY_VAR__);
      current_statement__ = 21;
      yGlobal1 = context__.vals_r("yGlobal1");
      out__.write_free_lb(0, yGlobal1);
      std::vector<local_scalar_t__> yGlobal2 =
        std::vector<local_scalar_t__>(yHs2, DUMMY_VAR__);
      current_statement__ = 22;
      yGlobal2 = context__.vals_r("yGlobal2");
      out__.write_free_lb(0, yGlobal2);
      std::vector<local_scalar_t__> yGlobal3 =
        std::vector<local_scalar_t__>(yHs3, DUMMY_VAR__);
      current_statement__ = 23;
      yGlobal3 = context__.vals_r("yGlobal3");
      out__.write_free_lb(0, yGlobal3);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs1,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal1_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> yLocal1_flat__;
        current_statement__ = 24;
        yLocal1_flat__ = context__.vals_r("yLocal1");
        current_statement__ = 24;
        pos__ = 1;
        current_statement__ = 24;
        for (int sym1__ = 1; sym1__ <= yLocal1_2dim__; ++sym1__) {
          current_statement__ = 24;
          for (int sym2__ = 1; sym2__ <= yHs1; ++sym2__) {
            current_statement__ = 24;
            stan::model::assign(yLocal1, yLocal1_flat__[(pos__ - 1)],
              "assigning variable yLocal1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 24;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, yLocal1);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs2,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal2_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> yLocal2_flat__;
        current_statement__ = 25;
        yLocal2_flat__ = context__.vals_r("yLocal2");
        current_statement__ = 25;
        pos__ = 1;
        current_statement__ = 25;
        for (int sym1__ = 1; sym1__ <= yLocal2_2dim__; ++sym1__) {
          current_statement__ = 25;
          for (int sym2__ = 1; sym2__ <= yHs2; ++sym2__) {
            current_statement__ = 25;
            stan::model::assign(yLocal2, yLocal2_flat__[(pos__ - 1)],
              "assigning variable yLocal2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 25;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, yLocal2);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs3,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal3_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> yLocal3_flat__;
        current_statement__ = 26;
        yLocal3_flat__ = context__.vals_r("yLocal3");
        current_statement__ = 26;
        pos__ = 1;
        current_statement__ = 26;
        for (int sym1__ = 1; sym1__ <= yLocal3_2dim__; ++sym1__) {
          current_statement__ = 26;
          for (int sym2__ = 1; sym2__ <= yHs3; ++sym2__) {
            current_statement__ = 26;
            stan::model::assign(yLocal3, yLocal3_flat__[(pos__ - 1)],
              "assigning variable yLocal3", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 26;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, yLocal3);
      std::vector<local_scalar_t__> y_caux1 =
        std::vector<local_scalar_t__>(y_caux1_1dim__, DUMMY_VAR__);
      current_statement__ = 27;
      y_caux1 = context__.vals_r("y_caux1");
      out__.write_free_lb(0, y_caux1);
      std::vector<local_scalar_t__> y_caux2 =
        std::vector<local_scalar_t__>(y_caux2_1dim__, DUMMY_VAR__);
      current_statement__ = 28;
      y_caux2 = context__.vals_r("y_caux2");
      out__.write_free_lb(0, y_caux2);
      std::vector<local_scalar_t__> y_caux3 =
        std::vector<local_scalar_t__>(y_caux3_1dim__, DUMMY_VAR__);
      current_statement__ = 29;
      y_caux3 = context__.vals_r("y_caux3");
      out__.write_free_lb(0, y_caux3);
      std::vector<local_scalar_t__> yOol1 =
        std::vector<local_scalar_t__>(yOol1_1dim__, DUMMY_VAR__);
      current_statement__ = 30;
      yOol1 = context__.vals_r("yOol1");
      out__.write_free_lb(0, yOol1);
      std::vector<local_scalar_t__> yOol2 =
        std::vector<local_scalar_t__>(yOol2_1dim__, DUMMY_VAR__);
      current_statement__ = 31;
      yOol2 = context__.vals_r("yOol2");
      out__.write_free_lb(0, yOol2);
      std::vector<local_scalar_t__> yOol3 =
        std::vector<local_scalar_t__>(yOol3_1dim__, DUMMY_VAR__);
      current_statement__ = 32;
      yOol3 = context__.vals_r("yOol3");
      out__.write_free_lb(0, yOol3);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix1_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix1_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> yMix1_flat__;
        current_statement__ = 33;
        yMix1_flat__ = context__.vals_r("yMix1");
        current_statement__ = 33;
        pos__ = 1;
        current_statement__ = 33;
        for (int sym1__ = 1; sym1__ <= yMix1_2dim__; ++sym1__) {
          current_statement__ = 33;
          for (int sym2__ = 1; sym2__ <= yMix1_1dim__; ++sym2__) {
            current_statement__ = 33;
            stan::model::assign(yMix1, yMix1_flat__[(pos__ - 1)],
              "assigning variable yMix1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 33;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, yMix1);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix2_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix2_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> yMix2_flat__;
        current_statement__ = 34;
        yMix2_flat__ = context__.vals_r("yMix2");
        current_statement__ = 34;
        pos__ = 1;
        current_statement__ = 34;
        for (int sym1__ = 1; sym1__ <= yMix2_2dim__; ++sym1__) {
          current_statement__ = 34;
          for (int sym2__ = 1; sym2__ <= yMix2_1dim__; ++sym2__) {
            current_statement__ = 34;
            stan::model::assign(yMix2, yMix2_flat__[(pos__ - 1)],
              "assigning variable yMix2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 34;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, yMix2);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix3_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix3_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> yMix3_flat__;
        current_statement__ = 35;
        yMix3_flat__ = context__.vals_r("yMix3");
        current_statement__ = 35;
        pos__ = 1;
        current_statement__ = 35;
        for (int sym1__ = 1; sym1__ <= yMix3_2dim__; ++sym1__) {
          current_statement__ = 35;
          for (int sym2__ = 1; sym2__ <= yMix3_1dim__; ++sym2__) {
            current_statement__ = 35;
            stan::model::assign(yMix3, yMix3_flat__[(pos__ - 1)],
              "assigning variable yMix3", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 35;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, yMix3);
      std::vector<local_scalar_t__> e_gamma =
        std::vector<local_scalar_t__>(e_has_intercept, DUMMY_VAR__);
      current_statement__ = 36;
      e_gamma = context__.vals_r("e_gamma");
      out__.write(e_gamma);
      Eigen::Matrix<local_scalar_t__,-1,1> e_z_beta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(e_K, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> e_z_beta_flat__;
        current_statement__ = 37;
        e_z_beta_flat__ = context__.vals_r("e_z_beta");
        current_statement__ = 37;
        pos__ = 1;
        current_statement__ = 37;
        for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
          current_statement__ = 37;
          stan::model::assign(e_z_beta, e_z_beta_flat__[(pos__ - 1)],
            "assigning variable e_z_beta", stan::model::index_uni(sym1__));
          current_statement__ = 37;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(e_z_beta);
      Eigen::Matrix<local_scalar_t__,-1,1> e_aux_unscaled =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(basehaz_df,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> e_aux_unscaled_flat__;
        current_statement__ = 38;
        e_aux_unscaled_flat__ = context__.vals_r("e_aux_unscaled");
        current_statement__ = 38;
        pos__ = 1;
        current_statement__ = 38;
        for (int sym1__ = 1; sym1__ <= basehaz_df; ++sym1__) {
          current_statement__ = 38;
          stan::model::assign(e_aux_unscaled, e_aux_unscaled_flat__[(pos__ -
            1)], "assigning variable e_aux_unscaled",
            stan::model::index_uni(sym1__));
          current_statement__ = 38;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb((stan::math::logical_eq(basehaz_type, 1) ? 0 : 
        stan::math::negative_infinity()), e_aux_unscaled);
      std::vector<local_scalar_t__> e_global =
        std::vector<local_scalar_t__>(e_hs, DUMMY_VAR__);
      current_statement__ = 39;
      e_global = context__.vals_r("e_global");
      out__.write_free_lb(0, e_global);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> e_local =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(e_hs,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(e_local_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> e_local_flat__;
        current_statement__ = 40;
        e_local_flat__ = context__.vals_r("e_local");
        current_statement__ = 40;
        pos__ = 1;
        current_statement__ = 40;
        for (int sym1__ = 1; sym1__ <= e_local_2dim__; ++sym1__) {
          current_statement__ = 40;
          for (int sym2__ = 1; sym2__ <= e_hs; ++sym2__) {
            current_statement__ = 40;
            stan::model::assign(e_local, e_local_flat__[(pos__ - 1)],
              "assigning variable e_local", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 40;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, e_local);
      std::vector<local_scalar_t__> e_caux =
        std::vector<local_scalar_t__>(e_caux_1dim__, DUMMY_VAR__);
      current_statement__ = 41;
      e_caux = context__.vals_r("e_caux");
      out__.write_free_lb(0, e_caux);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> e_mix =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(e_mix_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(e_K, DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> e_mix_flat__;
        current_statement__ = 42;
        e_mix_flat__ = context__.vals_r("e_mix");
        current_statement__ = 42;
        pos__ = 1;
        current_statement__ = 42;
        for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
          current_statement__ = 42;
          for (int sym2__ = 1; sym2__ <= e_mix_1dim__; ++sym2__) {
            current_statement__ = 42;
            stan::model::assign(e_mix, e_mix_flat__[(pos__ - 1)],
              "assigning variable e_mix", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 42;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, e_mix);
      std::vector<local_scalar_t__> e_ool =
        std::vector<local_scalar_t__>(e_ool_1dim__, DUMMY_VAR__);
      current_statement__ = 43;
      e_ool = context__.vals_r("e_ool");
      out__.write_free_lb(0, e_ool);
      Eigen::Matrix<local_scalar_t__,-1,1> a_z_beta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(a_K, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> a_z_beta_flat__;
        current_statement__ = 44;
        a_z_beta_flat__ = context__.vals_r("a_z_beta");
        current_statement__ = 44;
        pos__ = 1;
        current_statement__ = 44;
        for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
          current_statement__ = 44;
          stan::model::assign(a_z_beta, a_z_beta_flat__[(pos__ - 1)],
            "assigning variable a_z_beta", stan::model::index_uni(sym1__));
          current_statement__ = 44;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(a_z_beta);
      std::vector<local_scalar_t__> a_global =
        std::vector<local_scalar_t__>(a_hs, DUMMY_VAR__);
      current_statement__ = 45;
      a_global = context__.vals_r("a_global");
      out__.write_free_lb(0, a_global);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> a_local =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(a_hs,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(a_local_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> a_local_flat__;
        current_statement__ = 46;
        a_local_flat__ = context__.vals_r("a_local");
        current_statement__ = 46;
        pos__ = 1;
        current_statement__ = 46;
        for (int sym1__ = 1; sym1__ <= a_local_2dim__; ++sym1__) {
          current_statement__ = 46;
          for (int sym2__ = 1; sym2__ <= a_hs; ++sym2__) {
            current_statement__ = 46;
            stan::model::assign(a_local, a_local_flat__[(pos__ - 1)],
              "assigning variable a_local", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 46;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, a_local);
      std::vector<local_scalar_t__> a_caux =
        std::vector<local_scalar_t__>(a_caux_1dim__, DUMMY_VAR__);
      current_statement__ = 47;
      a_caux = context__.vals_r("a_caux");
      out__.write_free_lb(0, a_caux);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> a_mix =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(a_mix_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(a_K, DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> a_mix_flat__;
        current_statement__ = 48;
        a_mix_flat__ = context__.vals_r("a_mix");
        current_statement__ = 48;
        pos__ = 1;
        current_statement__ = 48;
        for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
          current_statement__ = 48;
          for (int sym2__ = 1; sym2__ <= a_mix_1dim__; ++sym2__) {
            current_statement__ = 48;
            stan::model::assign(a_mix, a_mix_flat__[(pos__ - 1)],
              "assigning variable a_mix", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 48;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, a_mix);
      std::vector<local_scalar_t__> a_ool =
        std::vector<local_scalar_t__>(a_ool_1dim__, DUMMY_VAR__);
      current_statement__ = 49;
      a_ool = context__.vals_r("a_ool");
      out__.write_free_lb(0, a_ool);
    } 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>{"yGamma1", "yGamma2", "yGamma3",
                "z_yBeta1", "z_yBeta2", "z_yBeta3", "z_b", "z_T", "rho",
                "zeta", "tau", "bSd1", "z_bMat1", "bCholesky1", "bSd2",
                "z_bMat2", "bCholesky2", "yAux1_unscaled", "yAux2_unscaled",
                "yAux3_unscaled", "yGlobal1", "yGlobal2", "yGlobal3",
                "yLocal1", "yLocal2", "yLocal3", "y_caux1", "y_caux2",
                "y_caux3", "yOol1", "yOol2", "yOol3", "yMix1", "yMix2",
                "yMix3", "e_gamma", "e_z_beta", "e_aux_unscaled", "e_global",
                "e_local", "e_caux", "e_mix", "e_ool", "a_z_beta",
                "a_global", "a_local", "a_caux", "a_mix", "a_ool"};
    if (emit_transformed_parameters__) {
      std::vector<std::string>
        temp{"e_beta", "a_beta", "e_aux", "yBeta1", "yBeta2", "yBeta3",
             "yAux1", "yAux2", "yAux3", "theta_L", "yAuxMaximum", "bMat1",
             "bMat2"};
      names__.reserve(names__.size() + temp.size());
      names__.insert(names__.end(), temp.begin(), temp.end());
    }
    if (emit_generated_quantities__) {
      std::vector<std::string>
        temp{"e_alpha", "mean_PPD", "yAlpha1", "yAlpha2", "yAlpha3", "bCov1",
             "bCov2", "b1", "b2"};
      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>(
                                                                    yGamma1_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yGamma2_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yGamma3_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_yBeta1_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_yBeta2_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_yBeta3_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_b_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_T_1dim__)},
                std::vector<size_t>{static_cast<size_t>(rho_1dim__)},
                std::vector<size_t>{static_cast<size_t>(zeta_1dim__)},
                std::vector<size_t>{static_cast<size_t>(tau_1dim__)},
                std::vector<size_t>{static_cast<size_t>(bSd1_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_bMat1_1dim__),
                  static_cast<size_t>(z_bMat1_2dim__)},
                std::vector<size_t>{static_cast<size_t>(bCholesky1_1dim__),
                  static_cast<size_t>(bCholesky1_2dim__)},
                std::vector<size_t>{static_cast<size_t>(bSd2_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_bMat2_1dim__),
                  static_cast<size_t>(z_bMat2_2dim__)},
                std::vector<size_t>{static_cast<size_t>(bCholesky2_1dim__),
                  static_cast<size_t>(bCholesky2_2dim__)},
                std::vector<size_t>{static_cast<size_t>(yAux1_unscaled_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yAux2_unscaled_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yAux3_unscaled_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yHs1)},
                std::vector<size_t>{static_cast<size_t>(yHs2)},
                std::vector<size_t>{static_cast<size_t>(yHs3)},
                std::vector<size_t>{static_cast<size_t>(yHs1),
                  static_cast<size_t>(yLocal1_2dim__)},
                std::vector<size_t>{static_cast<size_t>(yHs2),
                  static_cast<size_t>(yLocal2_2dim__)},
                std::vector<size_t>{static_cast<size_t>(yHs3),
                  static_cast<size_t>(yLocal3_2dim__)},
                std::vector<size_t>{static_cast<size_t>(y_caux1_1dim__)},
                std::vector<size_t>{static_cast<size_t>(y_caux2_1dim__)},
                std::vector<size_t>{static_cast<size_t>(y_caux3_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yOol1_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yOol2_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yOol3_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yMix1_1dim__),
                  static_cast<size_t>(yMix1_2dim__)},
                std::vector<size_t>{static_cast<size_t>(yMix2_1dim__),
                  static_cast<size_t>(yMix2_2dim__)},
                std::vector<size_t>{static_cast<size_t>(yMix3_1dim__),
                  static_cast<size_t>(yMix3_2dim__)},
                std::vector<size_t>{static_cast<size_t>(e_has_intercept)},
                std::vector<size_t>{static_cast<size_t>(e_K)},
                std::vector<size_t>{static_cast<size_t>(basehaz_df)},
                std::vector<size_t>{static_cast<size_t>(e_hs)},
                std::vector<size_t>{static_cast<size_t>(e_hs),
                  static_cast<size_t>(e_local_2dim__)},
                std::vector<size_t>{static_cast<size_t>(e_caux_1dim__)},
                std::vector<size_t>{static_cast<size_t>(e_mix_1dim__),
                  static_cast<size_t>(e_K)},
                std::vector<size_t>{static_cast<size_t>(e_ool_1dim__)},
                std::vector<size_t>{static_cast<size_t>(a_K)},
                std::vector<size_t>{static_cast<size_t>(a_hs)},
                std::vector<size_t>{static_cast<size_t>(a_hs),
                  static_cast<size_t>(a_local_2dim__)},
                std::vector<size_t>{static_cast<size_t>(a_caux_1dim__)},
                std::vector<size_t>{static_cast<size_t>(a_mix_1dim__),
                  static_cast<size_t>(a_K)},
                std::vector<size_t>{static_cast<size_t>(a_ool_1dim__)}};
    if (emit_transformed_parameters__) {
      std::vector<std::vector<size_t>>
        temp{std::vector<size_t>{static_cast<size_t>(e_K)},
             std::vector<size_t>{static_cast<size_t>(a_K)},
             std::vector<size_t>{static_cast<size_t>(basehaz_df)},
             std::vector<size_t>{static_cast<size_t>(yBeta1_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yBeta2_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yBeta3_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yAux1_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yAux2_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yAux3_1dim__)},
             std::vector<size_t>{static_cast<size_t>(len_theta_L)},
             std::vector<size_t>{},
             std::vector<size_t>{static_cast<size_t>(bMat1_1dim__),
               static_cast<size_t>(bK1)},
             std::vector<size_t>{static_cast<size_t>(bMat2_1dim__),
               static_cast<size_t>(bK2)}};
      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>{},
             std::vector<size_t>{static_cast<size_t>(M)},
             std::vector<size_t>{static_cast<size_t>(yAlpha1_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yAlpha2_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yAlpha3_1dim__)},
             std::vector<size_t>{static_cast<size_t>(bCov1_1dim__)},
             std::vector<size_t>{static_cast<size_t>(bCov2_1dim__)},
             std::vector<size_t>{static_cast<size_t>(b1_1dim__)},
             std::vector<size_t>{static_cast<size_t>(b2_1dim__)}};
      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__ <= yGamma1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGamma1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yGamma2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGamma2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yGamma3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGamma3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_yBeta1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_yBeta1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_yBeta2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_yBeta2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_yBeta3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_yBeta3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_b_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_b" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_T_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_T" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= rho_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "rho" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= zeta_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "zeta" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= tau_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "tau" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= bSd1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "bSd1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_bMat1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= z_bMat1_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_bMat1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= bCholesky1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= bCholesky1_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "bCholesky1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= bSd2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "bSd2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_bMat2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= z_bMat2_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_bMat2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= bCholesky2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= bCholesky2_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "bCholesky2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yAux1_unscaled_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yAux1_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yAux2_unscaled_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yAux2_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yAux3_unscaled_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yAux3_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yHs1; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGlobal1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yHs2; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGlobal2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yHs3; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGlobal3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yLocal1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yHs1; ++sym2__) {
        param_names__.emplace_back(std::string() + "yLocal1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yLocal2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yHs2; ++sym2__) {
        param_names__.emplace_back(std::string() + "yLocal2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yLocal3_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yHs3; ++sym2__) {
        param_names__.emplace_back(std::string() + "yLocal3" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= y_caux1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "y_caux1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= y_caux2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "y_caux2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= y_caux3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "y_caux3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yOol1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yOol1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yOol2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yOol2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yOol3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yOol3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yMix1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yMix1_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "yMix1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yMix2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yMix2_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "yMix2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yMix3_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yMix3_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "yMix3" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= e_has_intercept; ++sym1__) {
      param_names__.emplace_back(std::string() + "e_gamma" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
      param_names__.emplace_back(std::string() + "e_z_beta" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= basehaz_df; ++sym1__) {
      param_names__.emplace_back(std::string() + "e_aux_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= e_hs; ++sym1__) {
      param_names__.emplace_back(std::string() + "e_global" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= e_local_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= e_hs; ++sym2__) {
        param_names__.emplace_back(std::string() + "e_local" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= e_caux_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "e_caux" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= e_mix_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "e_mix" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= e_ool_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "e_ool" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
      param_names__.emplace_back(std::string() + "a_z_beta" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= a_hs; ++sym1__) {
      param_names__.emplace_back(std::string() + "a_global" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= a_local_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= a_hs; ++sym2__) {
        param_names__.emplace_back(std::string() + "a_local" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= a_caux_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "a_caux" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= a_mix_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "a_mix" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= a_ool_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "a_ool" + '.' +
        std::to_string(sym1__));
    }
    if (emit_transformed_parameters__) {
      for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
        param_names__.emplace_back(std::string() + "e_beta" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
        param_names__.emplace_back(std::string() + "a_beta" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= basehaz_df; ++sym1__) {
        param_names__.emplace_back(std::string() + "e_aux" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yBeta1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yBeta1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yBeta2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yBeta2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yBeta3_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yBeta3" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAux1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAux1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAux2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAux2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAux3_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAux3" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= len_theta_L; ++sym1__) {
        param_names__.emplace_back(std::string() + "theta_L" + '.' +
          std::to_string(sym1__));
      }
      param_names__.emplace_back(std::string() + "yAuxMaximum");
      for (int sym1__ = 1; sym1__ <= bK1; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= bMat1_1dim__; ++sym2__) {
          param_names__.emplace_back(std::string() + "bMat1" + '.' +
            std::to_string(sym2__) + '.' + std::to_string(sym1__));
        }
      }
      for (int sym1__ = 1; sym1__ <= bK2; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= bMat2_1dim__; ++sym2__) {
          param_names__.emplace_back(std::string() + "bMat2" + '.' +
            std::to_string(sym2__) + '.' + std::to_string(sym1__));
        }
      }
    }
    if (emit_generated_quantities__) {
      param_names__.emplace_back(std::string() + "e_alpha");
      for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
        param_names__.emplace_back(std::string() + "mean_PPD" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAlpha1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAlpha1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAlpha2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAlpha2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAlpha3_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAlpha3" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= bCov1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "bCov1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= bCov2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "bCov2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= b1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "b1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= b2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "b2" + '.' +
          std::to_string(sym1__));
      }
    }
  }
  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__ <= yGamma1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGamma1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yGamma2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGamma2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yGamma3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGamma3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_yBeta1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_yBeta1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_yBeta2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_yBeta2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_yBeta3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_yBeta3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_b_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_b" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_T_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_T" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= rho_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "rho" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= zeta_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "zeta" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= tau_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "tau" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= bSd1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "bSd1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_bMat1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= z_bMat1_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_bMat1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= ((bCholesky1_1dim__ * (bCholesky1_1dim__ -
         1)) / 2); ++sym1__) {
      param_names__.emplace_back(std::string() + "bCholesky1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= bSd2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "bSd2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_bMat2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= z_bMat2_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_bMat2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= ((bCholesky2_1dim__ * (bCholesky2_1dim__ -
         1)) / 2); ++sym1__) {
      param_names__.emplace_back(std::string() + "bCholesky2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yAux1_unscaled_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yAux1_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yAux2_unscaled_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yAux2_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yAux3_unscaled_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yAux3_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yHs1; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGlobal1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yHs2; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGlobal2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yHs3; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGlobal3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yLocal1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yHs1; ++sym2__) {
        param_names__.emplace_back(std::string() + "yLocal1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yLocal2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yHs2; ++sym2__) {
        param_names__.emplace_back(std::string() + "yLocal2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yLocal3_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yHs3; ++sym2__) {
        param_names__.emplace_back(std::string() + "yLocal3" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= y_caux1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "y_caux1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= y_caux2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "y_caux2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= y_caux3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "y_caux3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yOol1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yOol1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yOol2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yOol2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yOol3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yOol3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yMix1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yMix1_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "yMix1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yMix2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yMix2_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "yMix2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yMix3_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yMix3_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "yMix3" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= e_has_intercept; ++sym1__) {
      param_names__.emplace_back(std::string() + "e_gamma" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
      param_names__.emplace_back(std::string() + "e_z_beta" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= basehaz_df; ++sym1__) {
      param_names__.emplace_back(std::string() + "e_aux_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= e_hs; ++sym1__) {
      param_names__.emplace_back(std::string() + "e_global" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= e_local_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= e_hs; ++sym2__) {
        param_names__.emplace_back(std::string() + "e_local" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= e_caux_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "e_caux" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= e_mix_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "e_mix" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= e_ool_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "e_ool" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
      param_names__.emplace_back(std::string() + "a_z_beta" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= a_hs; ++sym1__) {
      param_names__.emplace_back(std::string() + "a_global" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= a_local_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= a_hs; ++sym2__) {
        param_names__.emplace_back(std::string() + "a_local" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= a_caux_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "a_caux" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= a_mix_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "a_mix" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= a_ool_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "a_ool" + '.' +
        std::to_string(sym1__));
    }
    if (emit_transformed_parameters__) {
      for (int sym1__ = 1; sym1__ <= e_K; ++sym1__) {
        param_names__.emplace_back(std::string() + "e_beta" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= a_K; ++sym1__) {
        param_names__.emplace_back(std::string() + "a_beta" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= basehaz_df; ++sym1__) {
        param_names__.emplace_back(std::string() + "e_aux" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yBeta1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yBeta1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yBeta2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yBeta2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yBeta3_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yBeta3" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAux1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAux1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAux2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAux2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAux3_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAux3" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= len_theta_L; ++sym1__) {
        param_names__.emplace_back(std::string() + "theta_L" + '.' +
          std::to_string(sym1__));
      }
      param_names__.emplace_back(std::string() + "yAuxMaximum");
      for (int sym1__ = 1; sym1__ <= bK1; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= bMat1_1dim__; ++sym2__) {
          param_names__.emplace_back(std::string() + "bMat1" + '.' +
            std::to_string(sym2__) + '.' + std::to_string(sym1__));
        }
      }
      for (int sym1__ = 1; sym1__ <= bK2; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= bMat2_1dim__; ++sym2__) {
          param_names__.emplace_back(std::string() + "bMat2" + '.' +
            std::to_string(sym2__) + '.' + std::to_string(sym1__));
        }
      }
    }
    if (emit_generated_quantities__) {
      param_names__.emplace_back(std::string() + "e_alpha");
      for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
        param_names__.emplace_back(std::string() + "mean_PPD" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAlpha1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAlpha1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAlpha2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAlpha2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAlpha3_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAlpha3" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= bCov1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "bCov1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= bCov2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "bCov2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= b1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "b1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= b2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "b2" + '.' +
          std::to_string(sym1__));
      }
    }
  }
  inline std::string get_constrained_sizedtypes() const {
    return std::string("[{\"name\":\"yGamma1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yGamma1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGamma2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yGamma2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGamma3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yGamma3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"z_yBeta1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_yBeta1_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_yBeta2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_yBeta2_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_yBeta3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_yBeta3_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_b\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_b_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_T\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_T_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"rho\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(rho_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"zeta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(zeta_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(tau_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"bSd1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bSd1_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_bMat1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(z_bMat1_1dim__) + ",\"cols\":" + std::to_string(z_bMat1_2dim__) + "},\"block\":\"parameters\"},{\"name\":\"bCholesky1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(bCholesky1_1dim__) + ",\"cols\":" + std::to_string(bCholesky1_2dim__) + "},\"block\":\"parameters\"},{\"name\":\"bSd2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bSd2_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_bMat2\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(z_bMat2_1dim__) + ",\"cols\":" + std::to_string(z_bMat2_2dim__) + "},\"block\":\"parameters\"},{\"name\":\"bCholesky2\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(bCholesky2_1dim__) + ",\"cols\":" + std::to_string(bCholesky2_2dim__) + "},\"block\":\"parameters\"},{\"name\":\"yAux1_unscaled\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux1_unscaled_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yAux2_unscaled\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux2_unscaled_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yAux3_unscaled\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux3_unscaled_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGlobal1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs1) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGlobal2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs2) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGlobal3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs3) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yLocal1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs1) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yLocal1_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yLocal2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs2) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yLocal2_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yLocal3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs3) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yLocal3_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"y_caux1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(y_caux1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y_caux2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(y_caux2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y_caux3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(y_caux3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yOol1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yOol1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yOol2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yOol2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yOol3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yOol3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yMix1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yMix1_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yMix1_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yMix2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yMix2_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yMix2_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yMix3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yMix3_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yMix3_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"e_gamma\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(e_has_intercept) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"e_z_beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(e_K) + "},\"block\":\"parameters\"},{\"name\":\"e_aux_unscaled\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(basehaz_df) + "},\"block\":\"parameters\"},{\"name\":\"e_global\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(e_hs) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"e_local\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(e_hs) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(e_local_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"e_caux\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(e_caux_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"e_mix\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(e_mix_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(e_K) + "}},\"block\":\"parameters\"},{\"name\":\"e_ool\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(e_ool_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"a_z_beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(a_K) + "},\"block\":\"parameters\"},{\"name\":\"a_global\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(a_hs) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"a_local\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(a_hs) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(a_local_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"a_caux\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(a_caux_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"a_mix\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(a_mix_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(a_K) + "}},\"block\":\"parameters\"},{\"name\":\"a_ool\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(a_ool_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"e_beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(e_K) + "},\"block\":\"transformed_parameters\"},{\"name\":\"a_beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(a_K) + "},\"block\":\"transformed_parameters\"},{\"name\":\"e_aux\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(basehaz_df) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yBeta1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(yBeta1_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yBeta2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(yBeta2_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yBeta3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(yBeta3_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yAux1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"yAux2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"yAux3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"theta_L\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(len_theta_L) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yAuxMaximum\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"bMat1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(bMat1_1dim__) + ",\"cols\":" + std::to_string(bK1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"bMat2\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(bMat2_1dim__) + ",\"cols\":" + std::to_string(bK2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"e_alpha\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"mean_PPD\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"yAlpha1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAlpha1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"yAlpha2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAlpha2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"yAlpha3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAlpha3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"bCov1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bCov1_1dim__) + "},\"block\":\"generated_quantities\"},{\"name\":\"bCov2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bCov2_1dim__) + "},\"block\":\"generated_quantities\"},{\"name\":\"b1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(b1_1dim__) + "},\"block\":\"generated_quantities\"},{\"name\":\"b2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(b2_1dim__) + "},\"block\":\"generated_quantities\"}]");
  }
  inline std::string get_unconstrained_sizedtypes() const {
    return std::string("[{\"name\":\"yGamma1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yGamma1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGamma2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yGamma2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGamma3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yGamma3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"z_yBeta1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_yBeta1_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_yBeta2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_yBeta2_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_yBeta3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_yBeta3_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_b\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_b_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_T\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_T_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"rho\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(rho_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"zeta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(zeta_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(tau_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"bSd1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bSd1_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_bMat1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(z_bMat1_1dim__) + ",\"cols\":" + std::to_string(z_bMat1_2dim__) + "},\"block\":\"parameters\"},{\"name\":\"bCholesky1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(((bCholesky1_1dim__ * (bCholesky1_1dim__ - 1)) /2)) + "},\"block\":\"parameters\"},{\"name\":\"bSd2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bSd2_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_bMat2\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(z_bMat2_1dim__) + ",\"cols\":" + std::to_string(z_bMat2_2dim__) + "},\"block\":\"parameters\"},{\"name\":\"bCholesky2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(((bCholesky2_1dim__ * (bCholesky2_1dim__ - 1)) /2)) + "},\"block\":\"parameters\"},{\"name\":\"yAux1_unscaled\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux1_unscaled_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yAux2_unscaled\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux2_unscaled_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yAux3_unscaled\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux3_unscaled_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGlobal1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs1) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGlobal2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs2) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGlobal3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs3) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yLocal1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs1) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yLocal1_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yLocal2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs2) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yLocal2_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yLocal3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs3) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yLocal3_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"y_caux1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(y_caux1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y_caux2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(y_caux2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y_caux3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(y_caux3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yOol1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yOol1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yOol2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yOol2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yOol3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yOol3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yMix1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yMix1_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yMix1_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yMix2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yMix2_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yMix2_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yMix3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yMix3_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yMix3_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"e_gamma\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(e_has_intercept) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"e_z_beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(e_K) + "},\"block\":\"parameters\"},{\"name\":\"e_aux_unscaled\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(basehaz_df) + "},\"block\":\"parameters\"},{\"name\":\"e_global\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(e_hs) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"e_local\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(e_hs) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(e_local_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"e_caux\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(e_caux_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"e_mix\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(e_mix_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(e_K) + "}},\"block\":\"parameters\"},{\"name\":\"e_ool\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(e_ool_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"a_z_beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(a_K) + "},\"block\":\"parameters\"},{\"name\":\"a_global\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(a_hs) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"a_local\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(a_hs) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(a_local_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"a_caux\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(a_caux_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"a_mix\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(a_mix_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(a_K) + "}},\"block\":\"parameters\"},{\"name\":\"a_ool\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(a_ool_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"e_beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(e_K) + "},\"block\":\"transformed_parameters\"},{\"name\":\"a_beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(a_K) + "},\"block\":\"transformed_parameters\"},{\"name\":\"e_aux\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(basehaz_df) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yBeta1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(yBeta1_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yBeta2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(yBeta2_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yBeta3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(yBeta3_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yAux1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"yAux2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"yAux3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"theta_L\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(len_theta_L) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yAuxMaximum\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"bMat1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(bMat1_1dim__) + ",\"cols\":" + std::to_string(bK1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"bMat2\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(bMat2_1dim__) + ",\"cols\":" + std::to_string(bK2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"e_alpha\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"mean_PPD\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"yAlpha1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAlpha1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"yAlpha2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAlpha2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"yAlpha3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAlpha3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"bCov1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bCov1_1dim__) + "},\"block\":\"generated_quantities\"},{\"name\":\"bCov2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bCov2_1dim__) + "},\"block\":\"generated_quantities\"},{\"name\":\"b1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(b1_1dim__) + "},\"block\":\"generated_quantities\"},{\"name\":\"b2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(b2_1dim__) + "},\"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__ =
      ((((((((((((((((((((((((((((((((((((((((((((((((yGamma1_1dim__ +
      yGamma2_1dim__) + yGamma3_1dim__) + z_yBeta1_1dim__) + z_yBeta2_1dim__)
      + z_yBeta3_1dim__) + z_b_1dim__) + z_T_1dim__) + rho_1dim__) +
      zeta_1dim__) + tau_1dim__) + bSd1_1dim__) + (z_bMat1_1dim__ *
      z_bMat1_2dim__)) + (bCholesky1_1dim__ * bCholesky1_2dim__)) +
      bSd2_1dim__) + (z_bMat2_1dim__ * z_bMat2_2dim__)) + (bCholesky2_1dim__
      * bCholesky2_2dim__)) + yAux1_unscaled_1dim__) + yAux2_unscaled_1dim__)
      + yAux3_unscaled_1dim__) + yHs1) + yHs2) + yHs3) + (yHs1 *
      yLocal1_2dim__)) + (yHs2 * yLocal2_2dim__)) + (yHs3 * yLocal3_2dim__))
      + y_caux1_1dim__) + y_caux2_1dim__) + y_caux3_1dim__) + yOol1_1dim__) +
      yOol2_1dim__) + yOol3_1dim__) + (yMix1_1dim__ * yMix1_2dim__)) +
      (yMix2_1dim__ * yMix2_2dim__)) + (yMix3_1dim__ * yMix3_2dim__)) +
      e_has_intercept) + e_K) + basehaz_df) + e_hs) + (e_hs *
      e_local_2dim__)) + e_caux_1dim__) + (e_mix_1dim__ * e_K)) +
      e_ool_1dim__) + a_K) + a_hs) + (a_hs * a_local_2dim__)) +
      a_caux_1dim__) + (a_mix_1dim__ * a_K)) + a_ool_1dim__);
    const size_t num_transformed = emit_transformed_parameters *
      (((((((((((((e_K + a_K) + basehaz_df) + yBeta1_1dim__) + yBeta2_1dim__)
      + yBeta3_1dim__) + yAux1_1dim__) + yAux2_1dim__) + yAux3_1dim__) +
      len_theta_L) + 1) + (bMat1_1dim__ * bK1)) + (bMat2_1dim__ * bK2)));
    const size_t num_gen_quantities = emit_generated_quantities * (((((((((1
      + M) + yAlpha1_1dim__) + yAlpha2_1dim__) + yAlpha3_1dim__) +
      bCov1_1dim__) + bCov2_1dim__) + b1_1dim__) + b2_1dim__));
    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__ =
      ((((((((((((((((((((((((((((((((((((((((((((((((yGamma1_1dim__ +
      yGamma2_1dim__) + yGamma3_1dim__) + z_yBeta1_1dim__) + z_yBeta2_1dim__)
      + z_yBeta3_1dim__) + z_b_1dim__) + z_T_1dim__) + rho_1dim__) +
      zeta_1dim__) + tau_1dim__) + bSd1_1dim__) + (z_bMat1_1dim__ *
      z_bMat1_2dim__)) + (bCholesky1_1dim__ * bCholesky1_2dim__)) +
      bSd2_1dim__) + (z_bMat2_1dim__ * z_bMat2_2dim__)) + (bCholesky2_1dim__
      * bCholesky2_2dim__)) + yAux1_unscaled_1dim__) + yAux2_unscaled_1dim__)
      + yAux3_unscaled_1dim__) + yHs1) + yHs2) + yHs3) + (yHs1 *
      yLocal1_2dim__)) + (yHs2 * yLocal2_2dim__)) + (yHs3 * yLocal3_2dim__))
      + y_caux1_1dim__) + y_caux2_1dim__) + y_caux3_1dim__) + yOol1_1dim__) +
      yOol2_1dim__) + yOol3_1dim__) + (yMix1_1dim__ * yMix1_2dim__)) +
      (yMix2_1dim__ * yMix2_2dim__)) + (yMix3_1dim__ * yMix3_2dim__)) +
      e_has_intercept) + e_K) + basehaz_df) + e_hs) + (e_hs *
      e_local_2dim__)) + e_caux_1dim__) + (e_mix_1dim__ * e_K)) +
      e_ool_1dim__) + a_K) + a_hs) + (a_hs * a_local_2dim__)) +
      a_caux_1dim__) + (a_mix_1dim__ * a_K)) + a_ool_1dim__);
    const size_t num_transformed = emit_transformed_parameters *
      (((((((((((((e_K + a_K) + basehaz_df) + yBeta1_1dim__) + yBeta2_1dim__)
      + yBeta3_1dim__) + yAux1_1dim__) + yAux2_1dim__) + yAux3_1dim__) +
      len_theta_L) + 1) + (bMat1_1dim__ * bK1)) + (bMat2_1dim__ * bK2)));
    const size_t num_gen_quantities = emit_generated_quantities * (((((((((1
      + M) + yAlpha1_1dim__) + yAlpha2_1dim__) + yAlpha3_1dim__) +
      bCov1_1dim__) + bCov2_1dim__) + b1_1dim__) + b2_1dim__));
    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 = model_jm_namespace::model_jm;
#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 model_jm_namespace::profiles__;
}
#endif
#endif
