// 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_continuous_namespace {
using stan::model::model_base_crtp;
using namespace stan::math;
stan::math::profile_map profiles__;
static constexpr std::array<const char*, 1129> locations_array__ =
  {" (found before start of program)",
  " (in 'continuous', line 905, column 2 to line 906, column 66)",
  " (in 'continuous', line 909, column 2 to column 56)",
  " (in 'continuous', line 910, column 2 to column 33)",
  " (in 'continuous', line 911, column 2 to column 73)",
  " (in 'continuous', line 912, column 2 to column 33)",
  " (in 'continuous', line 913, column 2 to column 37)",
  " (in 'continuous', line 914, column 2 to column 35)",
  " (in 'continuous', line 915, column 2 to column 67)",
  " (in 'continuous', line 916, column 2 to column 55)",
  " (in 'continuous', line 917, column 2 to column 16)",
  " (in 'continuous', line 918, column 2 to column 22)",
  " (in 'continuous', line 919, column 2 to column 39)",
  " (in 'continuous', line 920, column 2 to column 42)",
  " (in 'continuous', line 921, column 2 to column 25)",
  " (in 'continuous', line 922, column 2 to column 29)",
  " (in 'continuous', line 924, column 2 to column 65)",
  " (in 'continuous', line 925, column 2 to column 87)",
  " (in 'continuous', line 926, column 2 to column 37)",
  " (in 'continuous', line 927, column 2 to column 45)",
  " (in 'continuous', line 928, column 2 to column 39)",
  " (in 'continuous', line 929, column 2 to column 75)",
  " (in 'continuous', line 930, column 2 to column 59)",
  " (in 'continuous', line 934, column 2 to line 937, column 54)",
  " (in 'continuous', line 938, column 2 to column 22)",
  " (in 'continuous', line 941, column 2 to column 17)",
  " (in 'continuous', line 942, column 2 to column 31)",
  " (in 'continuous', line 943, column 2 to column 60)",
  " (in 'continuous', line 944, column 2 to column 14)",
  " (in 'continuous', line 945, column 2 to column 30)",
  " (in 'continuous', line 1309, column 2 to column 61)",
  " (in 'continuous', line 1310, column 2 to column 34)",
  " (in 'continuous', line 1311, column 2 to column 40)",
  " (in 'continuous', line 968, column 4 to column 18)",
  " (in 'continuous', line 970, column 6 to column 30)",
  " (in 'continuous', line 971, column 6 to column 17)",
  " (in 'continuous', line 973, column 8 to column 33)",
  " (in 'continuous', line 974, column 8 to column 19)",
  " (in 'continuous', line 972, column 34 to line 975, column 7)",
  " (in 'continuous', line 972, column 6 to line 975, column 7)",
  " (in 'continuous', line 976, column 6 to column 49)",
  " (in 'continuous', line 977, column 6 to column 31)",
  " (in 'continuous', line 969, column 19 to line 978, column 5)",
  " (in 'continuous', line 969, column 4 to line 978, column 5)",
  " (in 'continuous', line 967, column 28 to line 979, column 3)",
  " (in 'continuous', line 967, column 7 to line 979, column 3)",
  " (in 'continuous', line 966, column 4 to column 87)",
  " (in 'continuous', line 965, column 7 to line 979, column 3)",
  " (in 'continuous', line 964, column 4 to column 66)",
  " (in 'continuous', line 963, column 7 to line 979, column 3)",
  " (in 'continuous', line 958, column 4 to column 43)",
  " (in 'continuous', line 961, column 9 to column 79)",
  " (in 'continuous', line 960, column 6 to column 78)",
  " (in 'continuous', line 959, column 4 to line 961, column 79)",
  " (in 'continuous', line 957, column 28 to line 962, column 3)",
  " (in 'continuous', line 957, column 7 to line 979, column 3)",
  " (in 'continuous', line 952, column 4 to column 43)",
  " (in 'continuous', line 955, column 9 to column 75)",
  " (in 'continuous', line 954, column 6 to column 74)",
  " (in 'continuous', line 953, column 4 to line 955, column 75)",
  " (in 'continuous', line 951, column 28 to line 956, column 3)",
  " (in 'continuous', line 951, column 7 to line 979, column 3)",
  " (in 'continuous', line 949, column 4 to column 75)",
  " (in 'continuous', line 948, column 43 to line 950, column 3)",
  " (in 'continuous', line 948, column 28 to line 950, column 3)",
  " (in 'continuous', line 948, column 7 to line 979, column 3)",
  " (in 'continuous', line 947, column 28 to column 70)",
  " (in 'continuous', line 947, column 7 to line 979, column 3)",
  " (in 'continuous', line 946, column 28 to column 42)",
  " (in 'continuous', line 946, column 2 to line 979, column 3)",
  " (in 'continuous', line 982, column 4 to column 80)",
  " (in 'continuous', line 983, column 38 to column 55)",
  " (in 'continuous', line 983, column 4 to column 55)",
  " (in 'continuous', line 984, column 4 to column 57)",
  " (in 'continuous', line 981, column 16 to line 985, column 3)",
  " (in 'continuous', line 981, column 2 to line 985, column 3)",
  " (in 'continuous', line 1004, column 4 to column 18)",
  " (in 'continuous', line 1006, column 6 to column 32)",
  " (in 'continuous', line 1007, column 6 to column 17)",
  " (in 'continuous', line 1009, column 8 to column 35)",
  " (in 'continuous', line 1010, column 8 to column 19)",
  " (in 'continuous', line 1008, column 36 to line 1011, column 7)",
  " (in 'continuous', line 1008, column 6 to line 1011, column 7)",
  " (in 'continuous', line 1012, column 6 to column 54)",
  " (in 'continuous', line 1013, column 6 to column 34)",
  " (in 'continuous', line 1005, column 23 to line 1014, column 5)",
  " (in 'continuous', line 1005, column 4 to line 1014, column 5)",
  " (in 'continuous', line 1003, column 30 to line 1015, column 3)",
  " (in 'continuous', line 1003, column 7 to line 1015, column 3)",
  " (in 'continuous', line 1002, column 4 to column 95)",
  " (in 'continuous', line 1001, column 7 to line 1015, column 3)",
  " (in 'continuous', line 1000, column 4 to column 72)",
  " (in 'continuous', line 999, column 7 to line 1015, column 3)",
  " (in 'continuous', line 997, column 4 to line 998, column 59)",
  " (in 'continuous', line 996, column 7 to line 1015, column 3)",
  " (in 'continuous', line 994, column 4 to line 995, column 58)",
  " (in 'continuous', line 993, column 7 to line 1015, column 3)",
  " (in 'continuous', line 990, column 4 to column 45)",
  " (in 'continuous', line 991, column 4 to column 57)",
  " (in 'continuous', line 989, column 49 to line 992, column 3)",
  " (in 'continuous', line 989, column 30 to line 992, column 3)",
  " (in 'continuous', line 989, column 7 to line 1015, column 3)",
  " (in 'continuous', line 988, column 30 to column 78)",
  " (in 'continuous', line 988, column 7 to line 1015, column 3)",
  " (in 'continuous', line 987, column 25 to column 41)",
  " (in 'continuous', line 987, column 2 to line 1015, column 3)",
  " (in 'continuous', line 1020, column 4 to column 45)",
  " (in 'continuous', line 1022, column 6 to column 32)",
  " (in 'continuous', line 1021, column 4 to line 1022, column 32)",
  " (in 'continuous', line 1019, column 7 to line 1023, column 3)",
  " (in 'continuous', line 1018, column 4 to column 23)",
  " (in 'continuous', line 1017, column 2 to line 1023, column 3)",
  " (in 'continuous', line 1037, column 6 to column 78)",
  " (in 'continuous', line 1038, column 6 to column 37)",
  " (in 'continuous', line 1036, column 11 to line 1039, column 5)",
  " (in 'continuous', line 1026, column 6 to column 20)",
  " (in 'continuous', line 1027, column 6 to column 35)",
  " (in 'continuous', line 1032, column 10 to column 37)",
  " (in 'continuous', line 1033, column 10 to column 57)",
  " (in 'continuous', line 1034, column 10 to column 26)",
  " (in 'continuous', line 1031, column 25 to line 1035, column 9)",
  " (in 'continuous', line 1031, column 8 to line 1035, column 9)",
  " (in 'continuous', line 1029, column 8 to column 29)",
  " (in 'continuous', line 1028, column 6 to line 1035, column 9)",
  " (in 'continuous', line 1025, column 27 to line 1036, column 5)",
  " (in 'continuous', line 1025, column 4 to line 1039, column 5)",
  " (in 'continuous', line 1024, column 13 to line 1040, column 3)",
  " (in 'continuous', line 1024, column 2 to line 1040, column 3)",
  " (in 'continuous', line 1316, column 6 to column 26)",
  " (in 'continuous', line 1314, column 6 to column 52)",
  " (in 'continuous', line 1313, column 4 to line 1316, column 26)",
  " (in 'continuous', line 1312, column 26 to line 1317, column 3)",
  " (in 'continuous', line 1312, column 2 to line 1317, column 3)",
  " (in 'continuous', line 1319, column 4 to column 57)",
  " (in 'continuous', line 1318, column 28 to line 1320, column 3)",
  " (in 'continuous', line 1318, column 2 to line 1320, column 3)",
  " (in 'continuous', line 1322, column 11 to column 12)",
  " (in 'continuous', line 1322, column 4 to column 20)",
  " (in 'continuous', line 1324, column 9 to column 10)",
  " (in 'continuous', line 1324, column 2 to column 16)",
  " (in 'continuous', line 1329, column 7 to column 32)",
  " (in 'continuous', line 1327, column 9 to column 66)",
  " (in 'continuous', line 1326, column 17 to column 35)",
  " (in 'continuous', line 1326, column 4 to line 1327, column 66)",
  " (in 'continuous', line 1325, column 13 to line 1328, column 3)",
  " (in 'continuous', line 1325, column 2 to line 1329, column 32)",
  " (in 'continuous', line 1330, column 23 to column 38)",
  " (in 'continuous', line 1330, column 2 to column 38)",
  " (in 'continuous', line 1331, column 16 to column 39)",
  " (in 'continuous', line 1331, column 2 to column 39)",
  " (in 'continuous', line 1335, column 9 to column 58)",
  " (in 'continuous', line 1334, column 37 to column 52)",
  " (in 'continuous', line 1334, column 22 to column 52)",
  " (in 'continuous', line 1334, column 4 to line 1335, column 58)",
  " (in 'continuous', line 1332, column 15 to line 1336, column 5)",
  " (in 'continuous', line 1332, column 4 to line 1336, column 5)",
  " (in 'continuous', line 1353, column 2 to column 33)",
  " (in 'continuous', line 1350, column 11 to line 1354, column 5)",
  " (in 'continuous', line 1346, column 8 to column 32)",
  " (in 'continuous', line 1347, column 8 to column 28)",
  " (in 'continuous', line 1348, column 8 to column 34)",
  " (in 'continuous', line 1345, column 13 to line 1349, column 7)",
  " (in 'continuous', line 1342, column 8 to column 32)",
  " (in 'continuous', line 1343, column 8 to column 28)",
  " (in 'continuous', line 1344, column 8 to column 34)",
  " (in 'continuous', line 1341, column 41 to line 1345, column 7)",
  " (in 'continuous', line 1341, column 11 to line 1349, column 7)",
  " (in 'continuous', line 1340, column 8 to column 24)",
  " (in 'continuous', line 1338, column 6 to line 1349, column 7)",
  " (in 'continuous', line 1337, column 28 to line 1350, column 5)",
  " (in 'continuous', line 1337, column 4 to line 1354, column 5)",
  " (in 'continuous', line 1360, column 4 to column 31)",
  " (in 'continuous', line 1359, column 61 to line 1361, column 3)",
  " (in 'continuous', line 1359, column 7 to line 1361, column 3)",
  " (in 'continuous', line 1357, column 4 to column 30)",
  " (in 'continuous', line 1356, column 47 to line 1358, column 3)",
  " (in 'continuous', line 1356, column 1 to line 1361, column 3)",
  " (in 'continuous', line 1377, column 4 to column 38)",
  " (in 'continuous', line 1376, column 7 to line 1378, column 3)",
  " (in 'continuous', line 1374, column 4 to column 51)",
  " (in 'continuous', line 1373, column 20 to line 1375, column 3)",
  " (in 'continuous', line 1373, column 2 to line 1378, column 3)",
  " (in 'continuous', line 1370, column 11 to line 1379, column 5)",
  " (in 'continuous', line 1368, column 8 to column 28)",
  " (in 'continuous', line 1367, column 13 to line 1369, column 7)",
  " (in 'continuous', line 1365, column 8 to column 35)",
  " (in 'continuous', line 1366, column 8 to column 41)",
  " (in 'continuous', line 1364, column 24 to line 1367, column 7)",
  " (in 'continuous', line 1364, column 6 to line 1369, column 7)",
  " (in 'continuous', line 1363, column 30 to line 1370, column 5)",
  " (in 'continuous', line 1363, column 4 to line 1379, column 5)",
  " (in 'continuous', line 1438, column 13 to column 14)",
  " (in 'continuous', line 1438, column 6 to column 45)",
  " (in 'continuous', line 1439, column 13 to column 14)",
  " (in 'continuous', line 1439, column 6 to column 54)",
  " (in 'continuous', line 1441, column 8 to column 26)",
  " (in 'continuous', line 1442, column 8 to column 28)",
  " (in 'continuous', line 1448, column 10 to column 65)",
  " (in 'continuous', line 1447, column 13 to line 1448, column 65)",
  " (in 'continuous', line 1446, column 10 to column 24)",
  " (in 'continuous', line 1445, column 13 to line 1448, column 65)",
  " (in 'continuous', line 1444, column 10 to column 41)",
  " (in 'continuous', line 1443, column 8 to line 1448, column 65)",
  " (in 'continuous', line 1440, column 23 to line 1449, column 7)",
  " (in 'continuous', line 1440, column 6 to line 1449, column 7)",
  " (in 'continuous', line 1437, column 44 to line 1450, column 5)",
  " (in 'continuous', line 1437, column 11 to line 1450, column 5)",
  " (in 'continuous', line 1427, column 13 to column 14)",
  " (in 'continuous', line 1427, column 6 to column 45)",
  " (in 'continuous', line 1429, column 8 to column 26)",
  " (in 'continuous', line 1435, column 10 to column 61)",
  " (in 'continuous', line 1434, column 13 to line 1435, column 61)",
  " (in 'continuous', line 1433, column 10 to column 24)",
  " (in 'continuous', line 1432, column 13 to line 1435, column 61)",
  " (in 'continuous', line 1431, column 10 to column 41)",
  " (in 'continuous', line 1430, column 8 to line 1435, column 61)",
  " (in 'continuous', line 1428, column 23 to line 1436, column 7)",
  " (in 'continuous', line 1428, column 6 to line 1436, column 7)",
  " (in 'continuous', line 1426, column 45 to line 1437, column 5)",
  " (in 'continuous', line 1426, column 11 to line 1450, column 5)",
  " (in 'continuous', line 1423, column 13 to column 14)",
  " (in 'continuous', line 1423, column 6 to column 70)",
  " (in 'continuous', line 1425, column 8 to column 49)",
  " (in 'continuous', line 1424, column 6 to line 1425, column 49)",
  " (in 'continuous', line 1422, column 28 to line 1426, column 5)",
  " (in 'continuous', line 1422, column 11 to line 1450, column 5)",
  " (in 'continuous', line 1419, column 13 to column 14)",
  " (in 'continuous', line 1419, column 6 to column 63)",
  " (in 'continuous', line 1421, column 8 to column 48)",
  " (in 'continuous', line 1420, column 6 to line 1421, column 48)",
  " (in 'continuous', line 1418, column 28 to line 1422, column 5)",
  " (in 'continuous', line 1418, column 11 to line 1450, column 5)",
  " (in 'continuous', line 1415, column 13 to column 14)",
  " (in 'continuous', line 1415, column 6 to column 63)",
  " (in 'continuous', line 1417, column 8 to column 43)",
  " (in 'continuous', line 1416, column 6 to line 1417, column 43)",
  " (in 'continuous', line 1414, column 28 to line 1418, column 5)",
  " (in 'continuous', line 1414, column 11 to line 1450, column 5)",
  " (in 'continuous', line 1382, column 13 to column 18)",
  " (in 'continuous', line 1382, column 6 to column 30)",
  " (in 'continuous', line 1383, column 13 to column 18)",
  " (in 'continuous', line 1383, column 20 to column 21)",
  " (in 'continuous', line 1383, column 6 to column 25)",
  " (in 'continuous', line 1384, column 6 to column 37)",
  " (in 'continuous', line 1409, column 12 to column 45)",
  " (in 'continuous', line 1407, column 12 to column 44)",
  " (in 'continuous', line 1406, column 15 to line 1409, column 45)",
  " (in 'continuous', line 1405, column 12 to column 43)",
  " (in 'continuous', line 1404, column 10 to line 1409, column 45)",
  " (in 'continuous', line 1403, column 15 to line 1410, column 9)",
  " (in 'continuous', line 1402, column 12 to column 46)",
  " (in 'continuous', line 1400, column 12 to column 41)",
  " (in 'continuous', line 1399, column 15 to line 1402, column 46)",
  " (in 'continuous', line 1398, column 12 to column 47)",
  " (in 'continuous', line 1397, column 10 to line 1402, column 46)",
  " (in 'continuous', line 1396, column 24 to line 1403, column 9)",
  " (in 'continuous', line 1396, column 8 to line 1410, column 9)",
  " (in 'continuous', line 1395, column 13 to line 1411, column 7)",
  " (in 'continuous', line 1394, column 10 to column 41)",
  " (in 'continuous', line 1392, column 10 to column 45)",
  " (in 'continuous', line 1391, column 15 to line 1394, column 41)",
  " (in 'continuous', line 1390, column 12 to column 46)",
  " (in 'continuous', line 1388, column 12 to column 43)",
  " (in 'continuous', line 1387, column 10 to line 1390, column 46)",
  " (in 'continuous', line 1386, column 24 to line 1391, column 9)",
  " (in 'continuous', line 1386, column 8 to line 1394, column 41)",
  " (in 'continuous', line 1385, column 21 to line 1395, column 7)",
  " (in 'continuous', line 1385, column 6 to line 1411, column 7)",
  " (in 'continuous', line 1413, column 8 to column 50)",
  " (in 'continuous', line 1412, column 6 to line 1413, column 50)",
  " (in 'continuous', line 1380, column 19 to line 1414, column 5)",
  " (in 'continuous', line 1380, column 4 to line 1450, column 5)",
  " (in 'continuous', line 1451, column 4 to column 22)",
  " (in 'continuous', line 1321, column 24 to line 1452, column 3)",
  " (in 'continuous', line 1321, column 2 to line 1452, column 3)",
  " (in 'continuous', line 1057, column 11 to column 31)",
  " (in 'continuous', line 1057, column 4 to column 39)",
  " (in 'continuous', line 1059, column 9 to column 10)",
  " (in 'continuous', line 1059, column 2 to column 16)",
  " (in 'continuous', line 1064, column 7 to column 32)",
  " (in 'continuous', line 1062, column 9 to column 66)",
  " (in 'continuous', line 1061, column 17 to column 35)",
  " (in 'continuous', line 1061, column 4 to line 1062, column 66)",
  " (in 'continuous', line 1060, column 13 to line 1063, column 3)",
  " (in 'continuous', line 1060, column 2 to line 1064, column 32)",
  " (in 'continuous', line 1065, column 23 to column 38)",
  " (in 'continuous', line 1065, column 2 to column 38)",
  " (in 'continuous', line 1066, column 16 to column 39)",
  " (in 'continuous', line 1066, column 2 to column 39)",
  " (in 'continuous', line 1070, column 9 to column 58)",
  " (in 'continuous', line 1069, column 37 to column 52)",
  " (in 'continuous', line 1069, column 22 to column 52)",
  " (in 'continuous', line 1069, column 4 to line 1070, column 58)",
  " (in 'continuous', line 1067, column 15 to line 1071, column 5)",
  " (in 'continuous', line 1067, column 4 to line 1071, column 5)",
  " (in 'continuous', line 1082, column 2 to column 33)",
  " (in 'continuous', line 1079, column 11 to line 1083, column 5)",
  " (in 'continuous', line 1078, column 8 to column 35)",
  " (in 'continuous', line 1076, column 8 to column 35)",
  " (in 'continuous', line 1075, column 11 to line 1078, column 35)",
  " (in 'continuous', line 1074, column 8 to column 24)",
  " (in 'continuous', line 1073, column 6 to line 1078, column 35)",
  " (in 'continuous', line 1072, column 28 to line 1079, column 5)",
  " (in 'continuous', line 1072, column 4 to line 1083, column 5)",
  " (in 'continuous', line 1170, column 13 to column 14)",
  " (in 'continuous', line 1170, column 6 to column 25)",
  " (in 'continuous', line 1180, column 8 to column 60)",
  " (in 'continuous', line 1179, column 11 to line 1180, column 60)",
  " (in 'continuous', line 1178, column 8 to column 46)",
  " (in 'continuous', line 1177, column 11 to line 1180, column 60)",
  " (in 'continuous', line 1176, column 8 to column 69)",
  " (in 'continuous', line 1175, column 11 to line 1180, column 60)",
  " (in 'continuous', line 1174, column 8 to column 47)",
  " (in 'continuous', line 1173, column 11 to line 1180, column 60)",
  " (in 'continuous', line 1172, column 8 to column 47)",
  " (in 'continuous', line 1171, column 6 to line 1180, column 60)",
  " (in 'continuous', line 1181, column 6 to column 47)",
  " (in 'continuous', line 1168, column 11 to line 1182, column 5)",
  " (in 'continuous', line 1124, column 4 to column 31)",
  " (in 'continuous', line 1123, column 61 to line 1125, column 3)",
  " (in 'continuous', line 1123, column 7 to line 1125, column 3)",
  " (in 'continuous', line 1121, column 4 to column 30)",
  " (in 'continuous', line 1120, column 47 to line 1122, column 3)",
  " (in 'continuous', line 1120, column 1 to line 1125, column 3)",
  " (in 'continuous', line 1140, column 4 to column 38)",
  " (in 'continuous', line 1139, column 7 to line 1141, column 3)",
  " (in 'continuous', line 1137, column 4 to column 51)",
  " (in 'continuous', line 1136, column 20 to line 1138, column 3)",
  " (in 'continuous', line 1136, column 2 to line 1141, column 3)",
  " (in 'continuous', line 1133, column 13 to line 1142, column 7)",
  " (in 'continuous', line 1131, column 10 to column 30)",
  " (in 'continuous', line 1130, column 15 to line 1132, column 9)",
  " (in 'continuous', line 1129, column 10 to column 43)",
  " (in 'continuous', line 1128, column 26 to line 1130, column 9)",
  " (in 'continuous', line 1128, column 8 to line 1132, column 9)",
  " (in 'continuous', line 1127, column 32 to line 1133, column 7)",
  " (in 'continuous', line 1127, column 6 to line 1142, column 7)",
  " (in 'continuous', line 1160, column 15 to column 16)",
  " (in 'continuous', line 1160, column 8 to column 21)",
  " (in 'continuous', line 1161, column 15 to column 16)",
  " (in 'continuous', line 1161, column 8 to column 23)",
  " (in 'continuous', line 1162, column 8 to column 37)",
  " (in 'continuous', line 1163, column 8 to column 47)",
  " (in 'continuous', line 1164, column 8 to line 1166, column 75)",
  " (in 'continuous', line 1159, column 46 to line 1167, column 7)",
  " (in 'continuous', line 1159, column 13 to line 1167, column 7)",
  " (in 'continuous', line 1156, column 15 to column 16)",
  " (in 'continuous', line 1156, column 8 to column 21)",
  " (in 'continuous', line 1157, column 8 to column 37)",
  " (in 'continuous', line 1158, column 8 to column 58)",
  " (in 'continuous', line 1155, column 47 to line 1159, column 7)",
  " (in 'continuous', line 1155, column 13 to line 1167, column 7)",
  " (in 'continuous', line 1153, column 8 to line 1154, column 50)",
  " (in 'continuous', line 1152, column 30 to line 1155, column 7)",
  " (in 'continuous', line 1152, column 13 to line 1167, column 7)",
  " (in 'continuous', line 1151, column 8 to column 57)",
  " (in 'continuous', line 1150, column 30 to line 1152, column 7)",
  " (in 'continuous', line 1150, column 13 to line 1167, column 7)",
  " (in 'continuous', line 1149, column 10 to column 51)",
  " (in 'continuous', line 1147, column 10 to column 51)",
  " (in 'continuous', line 1146, column 13 to line 1149, column 51)",
  " (in 'continuous', line 1145, column 10 to column 46)",
  " (in 'continuous', line 1144, column 8 to line 1149, column 51)",
  " (in 'continuous', line 1143, column 23 to line 1150, column 7)",
  " (in 'continuous', line 1143, column 6 to line 1167, column 7)",
  " (in 'continuous', line 1117, column 33 to line 1168, column 5)",
  " (in 'continuous', line 1117, column 11 to line 1182, column 5)",
  " (in 'continuous', line 1086, column 13 to column 18)",
  " (in 'continuous', line 1086, column 20 to column 21)",
  " (in 'continuous', line 1086, column 6 to column 54)",
  " (in 'continuous', line 1114, column 12 to column 65)",
  " (in 'continuous', line 1112, column 12 to column 64)",
  " (in 'continuous', line 1111, column 15 to line 1114, column 65)",
  " (in 'continuous', line 1110, column 12 to column 63)",
  " (in 'continuous', line 1109, column 10 to line 1114, column 65)",
  " (in 'continuous', line 1108, column 15 to line 1115, column 9)",
  " (in 'continuous', line 1107, column 12 to column 66)",
  " (in 'continuous', line 1105, column 12 to column 61)",
  " (in 'continuous', line 1104, column 15 to line 1107, column 66)",
  " (in 'continuous', line 1103, column 12 to column 67)",
  " (in 'continuous', line 1102, column 10 to line 1107, column 66)",
  " (in 'continuous', line 1101, column 24 to line 1108, column 9)",
  " (in 'continuous', line 1101, column 8 to line 1115, column 9)",
  " (in 'continuous', line 1100, column 13 to line 1116, column 7)",
  " (in 'continuous', line 1097, column 12 to column 36)",
  " (in 'continuous', line 1096, column 10 to line 1097, column 36)",
  " (in 'continuous', line 1098, column 10 to column 61)",
  " (in 'continuous', line 1095, column 13 to line 1099, column 9)",
  " (in 'continuous', line 1094, column 10 to column 65)",
  " (in 'continuous', line 1093, column 15 to line 1099, column 9)",
  " (in 'continuous', line 1092, column 12 to column 66)",
  " (in 'continuous', line 1090, column 12 to column 63)",
  " (in 'continuous', line 1089, column 10 to line 1092, column 66)",
  " (in 'continuous', line 1088, column 24 to line 1093, column 9)",
  " (in 'continuous', line 1088, column 8 to line 1099, column 9)",
  " (in 'continuous', line 1087, column 21 to line 1100, column 7)",
  " (in 'continuous', line 1087, column 6 to line 1116, column 7)",
  " (in 'continuous', line 1084, column 19 to line 1117, column 5)",
  " (in 'continuous', line 1084, column 4 to line 1182, column 5)",
  " (in 'continuous', line 1056, column 28 to line 1183, column 3)",
  " (in 'continuous', line 1056, column 9 to line 1183, column 3)",
  " (in 'continuous', line 1053, column 11 to column 23)",
  " (in 'continuous', line 1053, column 4 to line 1054, column 40)",
  " (in 'continuous', line 1055, column 4 to column 85)",
  " (in 'continuous', line 1052, column 33 to line 1056, column 3)",
  " (in 'continuous', line 1052, column 9 to line 1183, column 3)",
  " (in 'continuous', line 1044, column 11 to column 20)",
  " (in 'continuous', line 1044, column 4 to line 1050, column 41)",
  " (in 'continuous', line 1051, column 4 to column 58)",
  " (in 'continuous', line 1043, column 18 to line 1052, column 3)",
  " (in 'continuous', line 1043, column 2 to line 1183, column 3)",
  " (in 'continuous', line 1186, column 4 to column 42)",
  " (in 'continuous', line 1193, column 6 to column 51)",
  " (in 'continuous', line 1190, column 6 to line 1191, column 27)",
  " (in 'continuous', line 1189, column 9 to line 1193, column 51)",
  " (in 'continuous', line 1188, column 6 to column 60)",
  " (in 'continuous', line 1187, column 4 to line 1193, column 51)",
  " (in 'continuous', line 1185, column 57 to line 1194, column 3)",
  " (in 'continuous', line 1185, column 2 to line 1194, column 3)",
  " (in 'continuous', line 1230, column 4 to column 41)",
  " (in 'continuous', line 1229, column 28 to line 1231, column 3)",
  " (in 'continuous', line 1229, column 7 to line 1231, column 3)",
  " (in 'continuous', line 1225, column 4 to column 41)",
  " (in 'continuous', line 1226, column 4 to column 43)",
  " (in 'continuous', line 1227, column 4 to column 64)",
  " (in 'continuous', line 1224, column 28 to line 1228, column 3)",
  " (in 'continuous', line 1224, column 7 to line 1231, column 3)",
  " (in 'continuous', line 1221, column 4 to column 41)",
  " (in 'continuous', line 1222, column 4 to column 43)",
  " (in 'continuous', line 1220, column 28 to line 1223, column 3)",
  " (in 'continuous', line 1220, column 7 to line 1231, column 3)",
  " (in 'continuous', line 1209, column 4 to column 42)",
  " (in 'continuous', line 1210, column 4 to column 41)",
  " (in 'continuous', line 1211, column 4 to column 54)",
  " (in 'continuous', line 1212, column 4 to column 72)",
  " (in 'continuous', line 1213, column 4 to column 54)",
  " (in 'continuous', line 1215, column 4 to column 78)",
  " (in 'continuous', line 1216, column 4 to column 55)",
  " (in 'continuous', line 1217, column 4 to column 87)",
  " (in 'continuous', line 1218, column 4 to column 66)",
  " (in 'continuous', line 1208, column 28 to line 1219, column 3)",
  " (in 'continuous', line 1208, column 7 to line 1231, column 3)",
  " (in 'continuous', line 1200, column 4 to column 42)",
  " (in 'continuous', line 1201, column 4 to column 41)",
  " (in 'continuous', line 1202, column 4 to column 54)",
  " (in 'continuous', line 1203, column 4 to column 72)",
  " (in 'continuous', line 1204, column 4 to column 55)",
  " (in 'continuous', line 1205, column 4 to column 87)",
  " (in 'continuous', line 1206, column 4 to column 66)",
  " (in 'continuous', line 1199, column 28 to line 1207, column 3)",
  " (in 'continuous', line 1199, column 7 to line 1231, column 3)",
  " (in 'continuous', line 1198, column 28 to column 65)",
  " (in 'continuous', line 1198, column 7 to line 1231, column 3)",
  " (in 'continuous', line 1197, column 28 to column 65)",
  " (in 'continuous', line 1197, column 7 to line 1231, column 3)",
  " (in 'continuous', line 1239, column 6 to line 1240, column 58)",
  " (in 'continuous', line 1238, column 9 to line 1240, column 58)",
  " (in 'continuous', line 1237, column 6 to column 89)",
  " (in 'continuous', line 1236, column 4 to line 1240, column 58)",
  " (in 'continuous', line 1235, column 26 to line 1242, column 3)",
  " (in 'continuous', line 1235, column 2 to line 1242, column 3)",
  " (in 'continuous', line 1245, column 4 to column 48)",
  " (in 'continuous', line 1247, column 6 to column 44)",
  " (in 'continuous', line 1253, column 8 to column 54)",
  " (in 'continuous', line 1252, column 11 to line 1253, column 54)",
  " (in 'continuous', line 1251, column 8 to column 87)",
  " (in 'continuous', line 1250, column 11 to line 1253, column 54)",
  " (in 'continuous', line 1249, column 8 to column 63)",
  " (in 'continuous', line 1248, column 6 to line 1253, column 54)",
  " (in 'continuous', line 1246, column 35 to line 1254, column 5)",
  " (in 'continuous', line 1246, column 4 to line 1254, column 5)",
  " (in 'continuous', line 1244, column 16 to line 1255, column 3)",
  " (in 'continuous', line 1244, column 2 to line 1255, column 3)",
  " (in 'continuous', line 1291, column 4 to column 42)",
  " (in 'continuous', line 1290, column 30 to line 1292, column 3)",
  " (in 'continuous', line 1290, column 7 to line 1292, column 3)",
  " (in 'continuous', line 1286, column 4 to column 42)",
  " (in 'continuous', line 1287, column 4 to column 43)",
  " (in 'continuous', line 1288, column 4 to column 68)",
  " (in 'continuous', line 1285, column 30 to line 1289, column 3)",
  " (in 'continuous', line 1285, column 7 to line 1292, column 3)",
  " (in 'continuous', line 1282, column 4 to column 42)",
  " (in 'continuous', line 1283, column 4 to column 43)",
  " (in 'continuous', line 1281, column 30 to line 1284, column 3)",
  " (in 'continuous', line 1281, column 7 to line 1292, column 3)",
  " (in 'continuous', line 1270, column 4 to column 42)",
  " (in 'continuous', line 1271, column 4 to column 42)",
  " (in 'continuous', line 1272, column 4 to column 56)",
  " (in 'continuous', line 1273, column 4 to column 78)",
  " (in 'continuous', line 1274, column 4 to column 56)",
  " (in 'continuous', line 1276, column 4 to column 84)",
  " (in 'continuous', line 1277, column 4 to column 57)",
  " (in 'continuous', line 1278, column 4 to column 53)",
  " (in 'continuous', line 1279, column 4 to column 72)",
  " (in 'continuous', line 1269, column 30 to line 1280, column 3)",
  " (in 'continuous', line 1269, column 7 to line 1292, column 3)",
  " (in 'continuous', line 1261, column 4 to column 42)",
  " (in 'continuous', line 1262, column 4 to column 42)",
  " (in 'continuous', line 1263, column 4 to column 56)",
  " (in 'continuous', line 1264, column 4 to column 78)",
  " (in 'continuous', line 1265, column 4 to column 57)",
  " (in 'continuous', line 1266, column 4 to column 93)",
  " (in 'continuous', line 1267, column 4 to column 72)",
  " (in 'continuous', line 1260, column 30 to line 1268, column 3)",
  " (in 'continuous', line 1260, column 7 to line 1292, column 3)",
  " (in 'continuous', line 1259, column 30 to column 68)",
  " (in 'continuous', line 1259, column 7 to line 1292, column 3)",
  " (in 'continuous', line 1258, column 26 to column 64)",
  " (in 'continuous', line 1258, column 2 to line 1292, column 3)",
  " (in 'continuous', line 1300, column 6 to line 1301, column 60)",
  " (in 'continuous', line 1299, column 9 to line 1301, column 60)",
  " (in 'continuous', line 1298, column 6 to column 95)",
  " (in 'continuous', line 1297, column 4 to line 1301, column 60)",
  " (in 'continuous', line 1296, column 28 to line 1303, column 3)",
  " (in 'continuous', line 1296, column 2 to line 1303, column 3)",
  " (in 'continuous', line 1305, column 4 to column 88)",
  " (in 'continuous', line 1304, column 13 to line 1306, column 3)",
  " (in 'continuous', line 1304, column 2 to line 1306, column 3)",
  " (in 'continuous', line 705, column 2 to column 17)",
  " (in 'continuous', line 706, column 2 to column 17)",
  " (in 'continuous', line 709, column 9 to column 10)",
  " (in 'continuous', line 709, column 2 to column 17)",
  " (in 'continuous', line 710, column 2 to column 31)",
  " (in 'continuous', line 711, column 8 to column 15)",
  " (in 'continuous', line 711, column 24 to column 25)",
  " (in 'continuous', line 711, column 26 to column 27)",
  " (in 'continuous', line 711, column 2 to column 31)",
  " (in 'continuous', line 714, column 2 to column 21)",
  " (in 'continuous', line 715, column 9 to column 14)",
  " (in 'continuous', line 715, column 2 to column 20)",
  " (in 'continuous', line 716, column 8 to column 13)",
  " (in 'continuous', line 716, column 2 to column 43)",
  " (in 'continuous', line 718, column 8 to column 27)",
  " (in 'continuous', line 718, column 2 to column 69)",
  " (in 'continuous', line 721, column 2 to column 24)",
  " (in 'continuous', line 722, column 9 to column 10)",
  " (in 'continuous', line 722, column 11 to column 19)",
  " (in 'continuous', line 722, column 2 to column 23)",
  " (in 'continuous', line 723, column 8 to column 16)",
  " (in 'continuous', line 723, column 2 to column 42)",
  " (in 'continuous', line 724, column 2 to column 21)",
  " (in 'continuous', line 725, column 2 to column 12)",
  " (in 'continuous', line 726, column 2 to column 24)",
  " (in 'continuous', line 727, column 33 to column 38)",
  " (in 'continuous', line 727, column 2 to column 42)",
  " (in 'continuous', line 728, column 2 to column 31)",
  " (in 'continuous', line 732, column 2 to column 32)",
  " (in 'continuous', line 733, column 2 to column 40)",
  " (in 'continuous', line 736, column 2 to column 37)",
  " (in 'continuous', line 739, column 2 to column 20)",
  " (in 'continuous', line 743, column 2 to column 34)",
  " (in 'continuous', line 744, column 2 to column 48)",
  " (in 'continuous', line 747, column 2 to column 42)",
  " (in 'continuous', line 750, column 2 to column 45)",
  " (in 'continuous', line 754, column 2 to column 35)",
  " (in 'continuous', line 755, column 9 to column 28)",
  " (in 'continuous', line 755, column 2 to column 38)",
  " (in 'continuous', line 758, column 2 to column 34)",
  " (in 'continuous', line 759, column 9 to column 27)",
  " (in 'continuous', line 759, column 2 to column 37)",
  " (in 'continuous', line 763, column 18 to column 19)",
  " (in 'continuous', line 763, column 2 to column 33)",
  " (in 'continuous', line 764, column 2 to column 42)",
  " (in 'continuous', line 765, column 2 to column 36)",
  " (in 'continuous', line 766, column 18 to column 52)",
  " (in 'continuous', line 766, column 2 to column 77)",
  " (in 'continuous', line 767, column 9 to column 10)",
  " (in 'continuous', line 767, column 2 to column 23)",
  " (in 'continuous', line 768, column 2 to column 32)",
  " (in 'continuous', line 769, column 2 to column 35)",
  " (in 'continuous', line 770, column 18 to column 52)",
  " (in 'continuous', line 770, column 2 to column 76)",
  " (in 'continuous', line 771, column 18 to column 19)",
  " (in 'continuous', line 771, column 2 to column 30)",
  " (in 'continuous', line 772, column 2 to column 39)",
  " (in 'continuous', line 773, column 2 to column 33)",
  " (in 'continuous', line 774, column 18 to column 52)",
  " (in 'continuous', line 774, column 2 to column 74)",
  " (in 'continuous', line 775, column 2 to column 32)",
  " (in 'continuous', line 776, column 2 to column 35)",
  " (in 'continuous', line 777, column 2 to column 24)",
  " (in 'continuous', line 778, column 2 to column 27)",
  " (in 'continuous', line 779, column 8 to column 31)",
  " (in 'continuous', line 779, column 2 to column 58)",
  " (in 'continuous', line 784, column 2 to column 17)",
  " (in 'continuous', line 785, column 8 to column 9)",
  " (in 'continuous', line 785, column 2 to column 26)",
  " (in 'continuous', line 786, column 8 to column 9)",
  " (in 'continuous', line 786, column 2 to column 26)",
  " (in 'continuous', line 787, column 2 to column 17)",
  " (in 'continuous', line 788, column 2 to column 27)",
  " (in 'continuous', line 791, column 18 to column 19)",
  " (in 'continuous', line 791, column 2 to column 27)",
  " (in 'continuous', line 792, column 18 to column 19)",
  " (in 'continuous', line 792, column 2 to column 27)",
  " (in 'continuous', line 793, column 2 to column 33)",
  " (in 'continuous', line 794, column 8 to column 25)",
  " (in 'continuous', line 794, column 2 to column 55)",
  " (in 'continuous', line 795, column 2 to column 34)",
  " (in 'continuous', line 796, column 8 to column 26)",
  " (in 'continuous', line 796, column 2 to column 57)",
  " (in 'continuous', line 799, column 2 to column 28)",
  " (in 'continuous', line 800, column 9 to column 21)",
  " (in 'continuous', line 800, column 2 to column 25)",
  " (in 'continuous', line 801, column 8 to column 20)",
  " (in 'continuous', line 801, column 2 to column 48)",
  " (in 'continuous', line 802, column 8 to column 25)",
  " (in 'continuous', line 802, column 2 to column 61)",
  " (in 'continuous', line 803, column 2 to column 36)",
  " (in 'continuous', line 806, column 2 to column 40)",
  " (in 'continuous', line 807, column 2 to column 24)",
  " (in 'continuous', line 808, column 2 to column 21)",
  " (in 'continuous', line 809, column 9 to column 10)",
  " (in 'continuous', line 809, column 12 to column 17)",
  " (in 'continuous', line 809, column 2 to column 29)",
  " (in 'continuous', line 810, column 13 to column 18)",
  " (in 'continuous', line 810, column 2 to column 25)",
  " (in 'continuous', line 812, column 2 to column 36)",
  " (in 'continuous', line 813, column 2 to column 50)",
  " (in 'continuous', line 814, column 18 to column 23)",
  " (in 'continuous', line 814, column 2 to column 39)",
  " (in 'continuous', line 815, column 2 to column 44)",
  " (in 'continuous', line 816, column 9 to column 14)",
  " (in 'continuous', line 816, column 2 to column 29)",
  " (in 'continuous', line 817, column 2 to column 34)",
  " (in 'continuous', line 818, column 18 to column 23)",
  " (in 'continuous', line 818, column 2 to column 36)",
  " (in 'continuous', line 819, column 2 to column 41)",
  " (in 'continuous', line 820, column 2 to column 37)",
  " (in 'continuous', line 821, column 2 to column 34)",
  " (in 'continuous', line 822, column 2 to column 26)",
  " (in 'continuous', line 823, column 2 to column 29)",
  " (in 'continuous', line 824, column 8 to column 37)",
  " (in 'continuous', line 824, column 2 to column 66)",
  " (in 'continuous', line 825, column 2 to column 31)",
  " (in 'continuous', line 826, column 9 to column 30)",
  " (in 'continuous', line 826, column 2 to column 38)",
  " (in 'continuous', line 827, column 9 to column 31)",
  " (in 'continuous', line 827, column 2 to column 38)",
  " (in 'continuous', line 830, column 9 to column 32)",
  " (in 'continuous', line 830, column 2 to column 41)",
  " (in 'continuous', line 831, column 9 to column 32)",
  " (in 'continuous', line 831, column 2 to column 40)",
  " (in 'continuous', line 832, column 2 to column 62)",
  " (in 'continuous', line 833, column 8 to column 28)",
  " (in 'continuous', line 833, column 30 to column 35)",
  " (in 'continuous', line 833, column 2 to line 835, column 69)",
  " (in 'continuous', line 836, column 2 to column 20)",
  " (in 'continuous', line 837, column 2 to line 839, column 62)",
  " (in 'continuous', line 840, column 9 to column 54)",
  " (in 'continuous', line 840, column 2 to column 60)",
  " (in 'continuous', line 841, column 9 to column 54)",
  " (in 'continuous', line 842, column 9 to column 54)",
  " (in 'continuous', line 841, column 2 to line 842, column 60)",
  " (in 'continuous', line 843, column 2 to line 848, column 69)",
  " (in 'continuous', line 849, column 9 to column 35)",
  " (in 'continuous', line 849, column 37 to column 74)",
  " (in 'continuous', line 849, column 2 to column 79)",
  " (in 'continuous', line 850, column 2 to column 28)",
  " (in 'continuous', line 853, column 2 to column 27)",
  " (in 'continuous', line 854, column 2 to column 48)",
  " (in 'continuous', line 855, column 2 to column 36)",
  " (in 'continuous', line 856, column 2 to column 42)",
  " (in 'continuous', line 857, column 2 to column 23)",
  " (in 'continuous', line 858, column 8 to column 25)",
  " (in 'continuous', line 858, column 2 to column 47)",
  " (in 'continuous', line 859, column 2 to column 18)",
  " (in 'continuous', line 863, column 7 to column 14)",
  " (in 'continuous', line 862, column 28 to column 35)",
  " (in 'continuous', line 862, column 7 to line 863, column 14)",
  " (in 'continuous', line 861, column 28 to column 35)",
  " (in 'continuous', line 861, column 7 to line 863, column 14)",
  " (in 'continuous', line 860, column 23 to column 30)",
  " (in 'continuous', line 860, column 2 to line 863, column 14)",
  " (in 'continuous', line 868, column 8 to column 38)",
  " (in 'continuous', line 869, column 8 to column 17)",
  " (in 'continuous', line 867, column 24 to line 870, column 7)",
  " (in 'continuous', line 867, column 6 to line 870, column 7)",
  " (in 'continuous', line 866, column 18 to line 871, column 5)",
  " (in 'continuous', line 866, column 4 to line 871, column 5)",
  " (in 'continuous', line 872, column 22 to column 42)",
  " (in 'continuous', line 872, column 4 to column 42)",
  " (in 'continuous', line 865, column 17 to line 873, column 3)",
  " (in 'continuous', line 865, column 2 to line 873, column 3)",
  " (in 'continuous', line 879, column 7 to column 16)",
  " (in 'continuous', line 878, column 30 to column 39)",
  " (in 'continuous', line 878, column 7 to line 879, column 16)",
  " (in 'continuous', line 877, column 30 to column 39)",
  " (in 'continuous', line 877, column 7 to line 879, column 16)",
  " (in 'continuous', line 876, column 25 to column 34)",
  " (in 'continuous', line 876, column 2 to line 879, column 16)",
  " (in 'continuous', line 880, column 2 to column 20)",
  " (in 'continuous', line 882, column 4 to column 21)",
  " (in 'continuous', line 883, column 4 to column 19)",
  " (in 'continuous', line 881, column 19 to line 884, column 3)",
  " (in 'continuous', line 881, column 2 to line 884, column 3)",
  " (in 'continuous', line 886, column 11 to column 12)",
  " (in 'continuous', line 886, column 14 to column 42)",
  " (in 'continuous', line 886, column 4 to line 895, column 60)",
  " (in 'continuous', line 896, column 4 to column 24)",
  " (in 'continuous', line 897, column 4 to column 24)",
  " (in 'continuous', line 898, column 4 to column 33)",
  " (in 'continuous', line 885, column 18 to line 899, column 3)",
  " (in 'continuous', line 885, column 2 to line 899, column 3)",
  " (in 'continuous', line 901, column 4 to column 51)",
  " (in 'continuous', line 900, column 26 to line 902, column 3)",
  " (in 'continuous', line 900, column 2 to line 902, column 3)",
  " (in 'continuous', line 905, column 8 to column 21)",
  " (in 'continuous', line 909, column 9 to column 47)",
  " (in 'continuous', line 910, column 9 to column 17)",
  " (in 'continuous', line 911, column 18 to column 57)",
  " (in 'continuous', line 912, column 8 to column 10)",
  " (in 'continuous', line 913, column 8 to column 10)",
  " (in 'continuous', line 913, column 28 to column 29)",
  " (in 'continuous', line 914, column 8 to column 14)",
  " (in 'continuous', line 915, column 8 to column 42)",
  " (in 'continuous', line 915, column 60 to column 61)",
  " (in 'continuous', line 916, column 8 to column 23)",
  " (in 'continuous', line 917, column 9 to column 10)",
  " (in 'continuous', line 918, column 9 to column 16)",
  " (in 'continuous', line 919, column 26 to column 33)",
  " (in 'continuous', line 920, column 18 to column 35)",
  " (in 'continuous', line 921, column 18 to column 19)",
  " (in 'continuous', line 924, column 9 to column 55)",
  " (in 'continuous', line 925, column 8 to column 23)",
  " (in 'continuous', line 926, column 8 to column 12)",
  " (in 'continuous', line 927, column 8 to column 12)",
  " (in 'continuous', line 927, column 30 to column 35)",
  " (in 'continuous', line 928, column 8 to column 16)",
  " (in 'continuous', line 929, column 8 to column 46)",
  " (in 'continuous', line 929, column 64 to column 69)",
  " (in 'continuous', line 930, column 8 to column 25)",
  " (in 'continuous', line 938, column 9 to column 14)",
  " (in 'continuous', line 941, column 9 to column 10)",
  " (in 'continuous', line 942, column 9 to column 17)",
  " (in 'continuous', line 943, column 9 to column 48)",
  " (in 'continuous', line 944, column 9 to column 10)",
  " (in 'continuous', line 945, column 9 to column 20)",
  " (in 'continuous', line 1310, column 8 to column 21)",
  " (in 'continuous', line 1311, column 8 to column 23)",
  " (in 'continuous', line 44, column 11 to column 22)",
  " (in 'continuous', line 44, column 4 to column 32)",
  " (in 'continuous', line 45, column 4 to column 22)",
  " (in 'continuous', line 46, column 4 to column 21)",
  " (in 'continuous', line 47, column 4 to column 21)",
  " (in 'continuous', line 48, column 4 to column 25)",
  " (in 'continuous', line 52, column 6 to column 20)",
  " (in 'continuous', line 59, column 15 to column 17)",
  " (in 'continuous', line 59, column 18 to column 20)",
  " (in 'continuous', line 59, column 8 to column 26)",
  " (in 'continuous', line 60, column 8 to column 21)",
  " (in 'continuous', line 61, column 8 to column 17)",
  " (in 'continuous', line 62, column 8 to column 69)",
  " (in 'continuous', line 63, column 15 to column 17)",
  " (in 'continuous', line 63, column 8 to column 53)",
  " (in 'continuous', line 64, column 8 to column 22)",
  " (in 'continuous', line 67, column 8 to column 24)",
  " (in 'continuous', line 68, column 8 to column 42)",
  " (in 'continuous', line 69, column 8 to column 27)",
  " (in 'continuous', line 72, column 8 to column 42)",
  " (in 'continuous', line 73, column 8 to column 40)",
  " (in 'continuous', line 74, column 8 to column 22)",
  " (in 'continuous', line 75, column 8 to column 53)",
  " (in 'continuous', line 76, column 8 to column 33)",
  " (in 'continuous', line 79, column 10 to column 26)",
  " (in 'continuous', line 80, column 17 to column 18)",
  " (in 'continuous', line 80, column 10 to column 54)",
  " (in 'continuous', line 81, column 10 to column 78)",
  " (in 'continuous', line 82, column 10 to column 24)",
  " (in 'continuous', line 83, column 10 to column 46)",
  " (in 'continuous', line 84, column 24 to column 61)",
  " (in 'continuous', line 84, column 10 to column 61)",
  " (in 'continuous', line 85, column 10 to column 61)",
  " (in 'continuous', line 86, column 10 to column 24)",
  " (in 'continuous', line 78, column 30 to line 87, column 9)",
  " (in 'continuous', line 78, column 8 to line 87, column 9)",
  " (in 'continuous', line 91, column 10 to column 43)",
  " (in 'continuous', line 92, column 10 to column 28)",
  " (in 'continuous', line 90, column 40 to line 93, column 9)",
  " (in 'continuous', line 90, column 24 to line 93, column 9)",
  " (in 'continuous', line 90, column 8 to line 93, column 9)",
  " (in 'continuous', line 58, column 11 to line 94, column 7)",
  " (in 'continuous', line 54, column 8 to column 63)",
  " (in 'continuous', line 56, column 8 to column 26)",
  " (in 'continuous', line 53, column 19 to line 57, column 7)",
  " (in 'continuous', line 53, column 6 to line 94, column 7)",
  " (in 'continuous', line 51, column 25 to line 95, column 5)",
  " (in 'continuous', line 51, column 4 to line 95, column 5)",
  " (in 'continuous', line 96, column 4 to column 19)",
  " (in 'continuous', line 43, column 46 to line 97, column 3)",
  " (in 'continuous', line 111, column 11 to column 20)",
  " (in 'continuous', line 111, column 4 to column 24)",
  " (in 'continuous', line 112, column 4 to column 19)",
  " (in 'continuous', line 113, column 4 to column 25)",
  " (in 'continuous', line 115, column 6 to column 20)",
  " (in 'continuous', line 124, column 15 to column 17)",
  " (in 'continuous', line 124, column 18 to column 20)",
  " (in 'continuous', line 124, column 8 to column 50)",
  " (in 'continuous', line 126, column 10 to column 43)",
  " (in 'continuous', line 127, column 10 to column 28)",
  " (in 'continuous', line 129, column 12 to column 45)",
  " (in 'continuous', line 130, column 12 to column 30)",
  " (in 'continuous', line 128, column 29 to line 131, column 11)",
  " (in 'continuous', line 128, column 10 to line 131, column 11)",
  " (in 'continuous', line 125, column 24 to line 132, column 9)",
  " (in 'continuous', line 125, column 8 to line 132, column 9)",
  " (in 'continuous', line 134, column 17 to column 19)",
  " (in 'continuous', line 134, column 10 to column 59)",
  " (in 'continuous', line 135, column 10 to column 22)",
  " (in 'continuous', line 136, column 26 to column 50)",
  " (in 'continuous', line 136, column 10 to column 50)",
  " (in 'continuous', line 137, column 10 to column 27)",
  " (in 'continuous', line 133, column 26 to line 138, column 9)",
  " (in 'continuous', line 133, column 8 to line 138, column 9)",
  " (in 'continuous', line 123, column 11 to line 139, column 7)",
  " (in 'continuous', line 117, column 8 to column 51)",
  " (in 'continuous', line 119, column 10 to column 40)",
  " (in 'continuous', line 118, column 8 to line 119, column 40)",
  " (in 'continuous', line 120, column 8 to column 23)",
  " (in 'continuous', line 121, column 8 to column 26)",
  " (in 'continuous', line 116, column 19 to line 122, column 7)",
  " (in 'continuous', line 116, column 6 to line 139, column 7)",
  " (in 'continuous', line 114, column 25 to line 140, column 5)",
  " (in 'continuous', line 114, column 4 to line 140, column 5)",
  " (in 'continuous', line 141, column 4 to column 13)",
  " (in 'continuous', line 110, column 74 to line 142, column 3)",
  " (in 'continuous', line 162, column 4 to column 16)",
  " (in 'continuous', line 163, column 4 to column 20)",
  " (in 'continuous', line 164, column 4 to column 20)",
  " (in 'continuous', line 165, column 4 to column 34)",
  " (in 'continuous', line 166, column 4 to column 34)",
  " (in 'continuous', line 168, column 13 to column 21)",
  " (in 'continuous', line 168, column 6 to column 30)",
  " (in 'continuous', line 169, column 13 to column 21)",
  " (in 'continuous', line 169, column 6 to column 30)",
  " (in 'continuous', line 170, column 6 to column 59)",
  " (in 'continuous', line 171, column 6 to column 19)",
  " (in 'continuous', line 172, column 6 to column 21)",
  " (in 'continuous', line 173, column 6 to column 21)",
  " (in 'continuous', line 175, column 8 to column 18)",
  " (in 'continuous', line 176, column 8 to column 28)",
  " (in 'continuous', line 177, column 8 to column 23)",
  " (in 'continuous', line 174, column 28 to line 178, column 7)",
  " (in 'continuous', line 174, column 6 to line 178, column 7)",
  " (in 'continuous', line 179, column 6 to column 74)",
  " (in 'continuous', line 180, column 6 to column 26)",
  " (in 'continuous', line 167, column 33 to line 181, column 5)",
  " (in 'continuous', line 167, column 19 to line 181, column 5)",
  " (in 'continuous', line 167, column 4 to line 181, column 5)",
  " (in 'continuous', line 182, column 4 to column 38)",
  " (in 'continuous', line 183, column 4 to column 38)",
  " (in 'continuous', line 184, column 4 to column 14)",
  " (in 'continuous', line 161, column 38 to line 185, column 3)",
  " (in 'continuous', line 200, column 4 to column 25)",
  " (in 'continuous', line 201, column 11 to column 12)",
  " (in 'continuous', line 201, column 4 to column 50)",
  " (in 'continuous', line 202, column 4 to column 78)",
  " (in 'continuous', line 203, column 11 to column 12)",
  " (in 'continuous', line 203, column 4 to column 39)",
  " (in 'continuous', line 204, column 11 to column 12)",
  " (in 'continuous', line 204, column 4 to column 82)",
  " (in 'continuous', line 205, column 4 to column 40)",
  " (in 'continuous', line 199, column 70 to line 206, column 3)",
  " (in 'continuous', line 221, column 4 to column 25)",
  " (in 'continuous', line 222, column 11 to column 12)",
  " (in 'continuous', line 222, column 4 to column 50)",
  " (in 'continuous', line 223, column 11 to column 12)",
  " (in 'continuous', line 223, column 4 to column 47)",
  " (in 'continuous', line 224, column 4 to column 78)",
  " (in 'continuous', line 225, column 11 to column 12)",
  " (in 'continuous', line 225, column 4 to column 50)",
  " (in 'continuous', line 226, column 11 to column 12)",
  " (in 'continuous', line 226, column 4 to line 227, column 69)",
  " (in 'continuous', line 228, column 4 to column 40)",
  " (in 'continuous', line 220, column 74 to line 229, column 3)",
  " (in 'continuous', line 242, column 4 to column 24)",
  " (in 'continuous', line 243, column 4 to column 21)",
  " (in 'continuous', line 244, column 4 to column 22)",
  " (in 'continuous', line 245, column 4 to column 22)",
  " (in 'continuous', line 246, column 4 to column 22)",
  " (in 'continuous', line 247, column 4 to column 26)",
  " (in 'continuous', line 248, column 4 to column 24)",
  " (in 'continuous', line 249, column 4 to column 25)",
  " (in 'continuous', line 250, column 4 to line 252, column 84)",
  " (in 'continuous', line 241, column 28 to line 253, column 3)",
  " (in 'continuous', line 264, column 10 to column 11)",
  " (in 'continuous', line 264, column 12 to column 13)",
  " (in 'continuous', line 264, column 4 to column 21)",
  " (in 'continuous', line 265, column 4 to column 16)",
  " (in 'continuous', line 267, column 6 to column 22)",
  " (in 'continuous', line 268, column 6 to column 15)",
  " (in 'continuous', line 266, column 45 to line 269, column 5)",
  " (in 'continuous', line 266, column 30 to line 269, column 5)",
  " (in 'continuous', line 266, column 15 to line 269, column 5)",
  " (in 'continuous', line 266, column 4 to line 269, column 5)",
  " (in 'continuous', line 270, column 4 to column 13)",
  " (in 'continuous', line 263, column 51 to line 271, column 3)",
  " (in 'continuous', line 289, column 21 to column 48)",
  " (in 'continuous', line 289, column 4 to column 48)",
  " (in 'continuous', line 291, column 21 to column 48)",
  " (in 'continuous', line 291, column 6 to column 48)",
  " (in 'continuous', line 292, column 6 to column 15)",
  " (in 'continuous', line 290, column 21 to line 293, column 5)",
  " (in 'continuous', line 290, column 4 to line 293, column 5)",
  " (in 'continuous', line 294, column 4 to column 31)",
  " (in 'continuous', line 288, column 40 to line 295, column 3)",
  " (in 'continuous', line 305, column 34 to column 43)",
  " (in 'continuous', line 305, column 4 to column 43)",
  " (in 'continuous', line 306, column 4 to column 31)",
  " (in 'continuous', line 304, column 40 to line 307, column 3)",
  " (in 'continuous', line 320, column 9 to column 32)",
  " (in 'continuous', line 319, column 24 to column 40)",
  " (in 'continuous', line 319, column 9 to line 320, column 32)",
  " (in 'continuous', line 318, column 24 to column 40)",
  " (in 'continuous', line 318, column 9 to line 320, column 32)",
  " (in 'continuous', line 317, column 24 to column 35)",
  " (in 'continuous', line 317, column 4 to line 320, column 32)",
  " (in 'continuous', line 321, column 4 to column 15)",
  " (in 'continuous', line 316, column 45 to line 322, column 3)",
  " (in 'continuous', line 332, column 4 to line 333, column 65)",
  " (in 'continuous', line 331, column 62 to line 334, column 3)",
  " (in 'continuous', line 347, column 9 to column 32)",
  " (in 'continuous', line 346, column 24 to column 40)",
  " (in 'continuous', line 346, column 9 to line 347, column 32)",
  " (in 'continuous', line 345, column 24 to column 40)",
  " (in 'continuous', line 345, column 9 to line 347, column 32)",
  " (in 'continuous', line 344, column 24 to column 35)",
  " (in 'continuous', line 344, column 4 to line 347, column 32)",
  " (in 'continuous', line 348, column 4 to column 15)",
  " (in 'continuous', line 343, column 45 to line 349, column 3)",
  " (in 'continuous', line 363, column 4 to line 364, column 39)",
  " (in 'continuous', line 371, column 9 to column 32)",
  " (in 'continuous', line 370, column 6 to column 65)",
  " (in 'continuous', line 369, column 9 to line 371, column 32)",
  " (in 'continuous', line 368, column 6 to column 59)",
  " (in 'continuous', line 367, column 9 to line 371, column 32)",
  " (in 'continuous', line 366, column 6 to column 59)",
  " (in 'continuous', line 365, column 4 to line 371, column 32)",
  " (in 'continuous', line 372, column 4 to column 15)",
  " (in 'continuous', line 362, column 42 to line 373, column 3)",
  " (in 'continuous', line 384, column 4 to column 22)",
  " (in 'continuous', line 385, column 11 to column 12)",
  " (in 'continuous', line 385, column 4 to column 17)",
  " (in 'continuous', line 401, column 9 to column 32)",
  " (in 'continuous', line 398, column 8 to column 57)",
  " (in 'continuous', line 397, column 21 to line 399, column 7)",
  " (in 'continuous', line 397, column 6 to line 399, column 7)",
  " (in 'continuous', line 396, column 24 to line 400, column 5)",
  " (in 'continuous', line 396, column 9 to line 401, column 32)",
  " (in 'continuous', line 393, column 8 to column 62)",
  " (in 'continuous', line 392, column 21 to line 394, column 7)",
  " (in 'continuous', line 392, column 6 to line 394, column 7)",
  " (in 'continuous', line 391, column 24 to line 395, column 5)",
  " (in 'continuous', line 391, column 9 to line 401, column 32)",
  " (in 'continuous', line 388, column 8 to column 57)",
  " (in 'continuous', line 387, column 21 to line 389, column 7)",
  " (in 'continuous', line 387, column 6 to line 389, column 7)",
  " (in 'continuous', line 386, column 19 to line 390, column 5)",
  " (in 'continuous', line 386, column 4 to line 401, column 32)",
  " (in 'continuous', line 402, column 4 to column 14)",
  " (in 'continuous', line 383, column 62 to line 403, column 3)",
  " (in 'continuous', line 417, column 9 to column 32)",
  " (in 'continuous', line 416, column 24 to column 45)",
  " (in 'continuous', line 416, column 9 to line 417, column 32)",
  " (in 'continuous', line 415, column 24 to column 40)",
  " (in 'continuous', line 415, column 9 to line 417, column 32)",
  " (in 'continuous', line 414, column 24 to column 40)",
  " (in 'continuous', line 414, column 9 to line 417, column 32)",
  " (in 'continuous', line 413, column 24 to column 35)",
  " (in 'continuous', line 413, column 4 to line 417, column 32)",
  " (in 'continuous', line 418, column 4 to column 15)",
  " (in 'continuous', line 412, column 52 to line 419, column 3)",
  " (in 'continuous', line 433, column 4 to line 435, column 60)",
  " (in 'continuous', line 432, column 51 to line 436, column 3)",
  " (in 'continuous', line 451, column 11 to column 18)",
  " (in 'continuous', line 451, column 4 to column 57)",
  " (in 'continuous', line 452, column 4 to line 453, column 67)",
  " (in 'continuous', line 450, column 64 to line 454, column 3)",
  " (in 'continuous', line 466, column 4 to column 26)",
  " (in 'continuous', line 467, column 4 to column 30)",
  " (in 'continuous', line 468, column 4 to column 37)",
  " (in 'continuous', line 469, column 4 to line 470, column 26)",
  " (in 'continuous', line 472, column 9 to column 24)",
  " (in 'continuous', line 471, column 30 to column 39)",
  " (in 'continuous', line 471, column 4 to line 472, column 24)",
  " (in 'continuous', line 465, column 46 to line 473, column 3)",
  " (in 'continuous', line 489, column 9 to column 32)",
  " (in 'continuous', line 488, column 24 to column 53)",
  " (in 'continuous', line 488, column 9 to line 489, column 32)",
  " (in 'continuous', line 487, column 24 to column 40)",
  " (in 'continuous', line 487, column 9 to line 489, column 32)",
  " (in 'continuous', line 486, column 24 to column 54)",
  " (in 'continuous', line 486, column 9 to line 489, column 32)",
  " (in 'continuous', line 485, column 24 to column 48)",
  " (in 'continuous', line 485, column 9 to line 489, column 32)",
  " (in 'continuous', line 484, column 24 to column 40)",
  " (in 'continuous', line 484, column 9 to line 489, column 32)",
  " (in 'continuous', line 483, column 19 to column 41)",
  " (in 'continuous', line 483, column 4 to line 489, column 32)",
  " (in 'continuous', line 490, column 4 to column 15)",
  " (in 'continuous', line 482, column 44 to line 491, column 3)",
  " (in 'continuous', line 504, column 9 to column 32)",
  " (in 'continuous', line 503, column 24 to column 43)",
  " (in 'continuous', line 503, column 9 to line 504, column 32)",
  " (in 'continuous', line 502, column 24 to column 35)",
  " (in 'continuous', line 502, column 9 to line 504, column 32)",
  " (in 'continuous', line 501, column 19 to column 35)",
  " (in 'continuous', line 501, column 4 to line 504, column 32)",
  " (in 'continuous', line 505, column 4 to column 15)",
  " (in 'continuous', line 500, column 46 to line 506, column 3)",
  " (in 'continuous', line 518, column 11 to column 18)",
  " (in 'continuous', line 518, column 4 to column 23)",
  " (in 'continuous', line 519, column 11 to column 18)",
  " (in 'continuous', line 519, column 4 to column 49)",
  " (in 'continuous', line 521, column 6 to column 77)",
  " (in 'continuous', line 520, column 25 to line 522, column 5)",
  " (in 'continuous', line 520, column 4 to line 522, column 5)",
  " (in 'continuous', line 523, column 4 to column 14)",
  " (in 'continuous', line 517, column 66 to line 524, column 3)",
  " (in 'continuous', line 537, column 11 to column 18)",
  " (in 'continuous', line 537, column 4 to column 23)",
  " (in 'continuous', line 538, column 11 to column 18)",
  " (in 'continuous', line 538, column 4 to column 49)",
  " (in 'continuous', line 539, column 11 to column 18)",
  " (in 'continuous', line 539, column 4 to column 59)",
  " (in 'continuous', line 541, column 6 to column 69)",
  " (in 'continuous', line 540, column 25 to line 542, column 5)",
  " (in 'continuous', line 540, column 4 to line 542, column 5)",
  " (in 'continuous', line 543, column 4 to column 14)",
  " (in 'continuous', line 536, column 79 to line 544, column 3)",
  " (in 'continuous', line 559, column 4 to column 26)",
  " (in 'continuous', line 560, column 4 to column 69)",
  " (in 'continuous', line 558, column 7 to line 561, column 3)",
  " (in 'continuous', line 555, column 11 to column 21)",
  " (in 'continuous', line 555, column 4 to column 39)",
  " (in 'continuous', line 556, column 4 to column 69)",
  " (in 'continuous', line 554, column 22 to line 557, column 3)",
  " (in 'continuous', line 554, column 2 to line 561, column 3)",
  " (in 'continuous', line 552, column 43 to line 562, column 1)",
  " (in 'continuous', line 569, column 4 to column 74)",
  " (in 'continuous', line 567, column 4 to column 74)",
  " (in 'continuous', line 566, column 2 to line 569, column 74)",
  " (in 'continuous', line 564, column 46 to line 570, column 1)",
  " (in 'continuous', line 577, column 4 to column 60)",
  " (in 'continuous', line 575, column 4 to column 60)",
  " (in 'continuous', line 574, column 2 to line 577, column 60)",
  " (in 'continuous', line 572, column 47 to line 578, column 1)",
  " (in 'continuous', line 586, column 4 to line 587, column 54)",
  " (in 'continuous', line 583, column 4 to line 584, column 54)",
  " (in 'continuous', line 582, column 2 to line 587, column 54)",
  " (in 'continuous', line 580, column 43 to line 588, column 1)",
  " (in 'continuous', line 592, column 2 to column 29)",
  " (in 'continuous', line 602, column 4 to column 25)",
  " (in 'continuous', line 603, column 4 to column 25)",
  " (in 'continuous', line 604, column 4 to column 28)",
  " (in 'continuous', line 605, column 4 to column 28)",
  " (in 'continuous', line 606, column 4 to line 607, column 76)",
  " (in 'continuous', line 601, column 7 to line 608, column 3)",
  " (in 'continuous', line 594, column 11 to column 20)",
  " (in 'continuous', line 594, column 4 to column 37)",
  " (in 'continuous', line 595, column 11 to column 20)",
  " (in 'continuous', line 595, column 4 to column 37)",
  " (in 'continuous', line 596, column 11 to column 20)",
  " (in 'continuous', line 596, column 4 to column 41)",
  " (in 'continuous', line 597, column 11 to column 20)",
  " (in 'continuous', line 597, column 4 to column 41)",
  " (in 'continuous', line 598, column 4 to line 599, column 79)",
  " (in 'continuous', line 593, column 21 to line 600, column 3)",
  " (in 'continuous', line 593, column 2 to line 608, column 3)",
  " (in 'continuous', line 590, column 54 to line 609, column 1)",
  " (in 'continuous', line 619, column 4 to column 23)",
  " (in 'continuous', line 620, column 4 to line 621, column 57)",
  " (in 'continuous', line 618, column 7 to line 622, column 3)",
  " (in 'continuous', line 615, column 11 to column 21)",
  " (in 'continuous', line 615, column 4 to column 36)",
  " (in 'continuous', line 616, column 4 to column 80)",
  " (in 'continuous', line 614, column 22 to line 617, column 3)",
  " (in 'continuous', line 614, column 2 to line 622, column 3)",
  " (in 'continuous', line 611, column 41 to line 623, column 1)",
  " (in 'continuous', line 627, column 9 to column 16)",
  " (in 'continuous', line 627, column 2 to column 22)",
  " (in 'continuous', line 631, column 4 to column 26)",
  " (in 'continuous', line 632, column 4 to column 24)",
  " (in 'continuous', line 633, column 4 to column 24)",
  " (in 'continuous', line 634, column 25 to column 62)",
  " (in 'continuous', line 634, column 4 to column 62)",
  " (in 'continuous', line 630, column 7 to line 635, column 3)",
  " (in 'continuous', line 629, column 4 to column 60)",
  " (in 'continuous', line 628, column 22 to line 629, column 60)",
  " (in 'continuous', line 628, column 2 to line 635, column 3)",
  " (in 'continuous', line 636, column 2 to column 13)",
  " (in 'continuous', line 625, column 42 to line 637, column 1)",
  " (in 'continuous', line 645, column 4 to line 646, column 55)",
  " (in 'continuous', line 643, column 4 to column 71)",
  " (in 'continuous', line 642, column 2 to line 646, column 55)",
  " (in 'continuous', line 639, column 43 to line 647, column 1)",
  " (in 'continuous', line 654, column 4 to column 53)",
  " (in 'continuous', line 652, column 4 to column 53)",
  " (in 'continuous', line 651, column 2 to line 654, column 53)",
  " (in 'continuous', line 649, column 44 to line 655, column 1)",
  " (in 'continuous', line 659, column 9 to column 16)",
  " (in 'continuous', line 659, column 2 to column 22)",
  " (in 'continuous', line 663, column 4 to column 26)",
  " (in 'continuous', line 664, column 4 to column 26)",
  " (in 'continuous', line 665, column 4 to column 25)",
  " (in 'continuous', line 666, column 4 to column 25)",
  " (in 'continuous', line 668, column 6 to column 57)",
  " (in 'continuous', line 667, column 4 to line 668, column 57)",
  " (in 'continuous', line 662, column 7 to line 669, column 3)",
  " (in 'continuous', line 661, column 4 to column 77)",
  " (in 'continuous', line 660, column 22 to line 661, column 77)",
  " (in 'continuous', line 660, column 2 to line 669, column 3)",
  " (in 'continuous', line 670, column 2 to column 13)",
  " (in 'continuous', line 657, column 41 to line 671, column 1)",
  " (in 'continuous', line 674, column 9 to column 13)",
  " (in 'continuous', line 674, column 15 to column 19)",
  " (in 'continuous', line 674, column 2 to column 25)",
  " (in 'continuous', line 675, column 2 to column 14)",
  " (in 'continuous', line 676, column 30 to column 62)",
  " (in 'continuous', line 676, column 2 to column 62)",
  " (in 'continuous', line 678, column 4 to column 22)",
  " (in 'continuous', line 679, column 4 to column 13)",
  " (in 'continuous', line 677, column 38 to line 680, column 3)",
  " (in 'continuous', line 677, column 20 to line 680, column 3)",
  " (in 'continuous', line 677, column 2 to line 680, column 3)",
  " (in 'continuous', line 681, column 2 to column 13)",
  " (in 'continuous', line 673, column 49 to line 682, column 1)",
  " (in 'continuous', line 696, column 4 to line 697, column 52)",
  " (in 'continuous', line 695, column 39 to line 698, 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_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__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_eigen_matrix_dynamic<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>
SS_asymp(const T0__& input_arg__, const T1__& Phi__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_eigen_matrix_dynamic<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>
SS_asympOff(const T0__& input_arg__, const T1__& Phi__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_eigen_matrix_dynamic<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>
SS_asympOrig(const T0__& input_arg__, const T1__& Phi__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_eigen_matrix_dynamic<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>
SS_biexp(const T0__& input_arg__, const T1__& Phi__arg__, 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_eigen_matrix_dynamic<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>
SS_fol(const T0__& Dose_arg__, const T1__& input_arg__, const T2__&
       Phi__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_eigen_matrix_dynamic<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>
SS_fpl(const T0__& input_arg__, const T1__& Phi__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_eigen_matrix_dynamic<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>
SS_gompertz(const T0__& x_arg__, const T1__& Phi__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_eigen_matrix_dynamic<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>
SS_logis(const T0__& input_arg__, const T1__& Phi__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_eigen_matrix_dynamic<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>
SS_micmen(const T0__& input_arg__, const T1__& Phi__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_eigen_matrix_dynamic<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>
SS_weibull(const T0__& x_arg__, const T1__& Phi__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>
reshape_vec(const T0__& x_arg__, const int& Rows, const int& Cols,
            std::ostream* pstream__);
template <bool propto__, 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_eigen_matrix_dynamic<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T4__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>,
  stan::base_type_t<T2__>, T3__, T4__>
mvn_ols_lpdf(const T0__& coeff_arg__, const T1__& OLS_arg__, const T2__&
             XtX_arg__, const T3__& SSR, const T4__& sigma, const int& N,
             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__ = 740;
    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__ = 742;
    zeta_mark = 1;
    int rho_mark = std::numeric_limits<int>::min();
    current_statement__ = 743;
    rho_mark = 1;
    int z_T_mark = std::numeric_limits<int>::min();
    current_statement__ = 744;
    z_T_mark = 1;
    int theta_L_mark = std::numeric_limits<int>::min();
    current_statement__ = 745;
    theta_L_mark = 1;
    current_statement__ = 787;
    for (int i = 1; i <= stan::math::size(p); ++i) {
      int nc = std::numeric_limits<int>::min();
      current_statement__ = 746;
      nc = stan::model::rvalue(p, "p", stan::model::index_uni(i));
      current_statement__ = 785;
      if (stan::math::logical_eq(nc, 1)) {
        current_statement__ = 782;
        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__ = 783;
        theta_L_mark = (theta_L_mark + 1);
      } else {
        current_statement__ = 747;
        stan::math::validate_non_negative_index("T_i", "nc", nc);
        current_statement__ = 748;
        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__ = 752;
        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__ = 753;
        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__ = 754;
        stan::model::assign(pi, stan::math::segment(zeta, zeta_mark, nc),
          "assigning variable pi");
        current_statement__ = 755;
        stan::model::assign(pi,
          stan::math::divide(stan::model::deep_copy(pi), stan::math::sum(pi)),
          "assigning variable pi");
        current_statement__ = 756;
        zeta_mark = (zeta_mark + nc);
        current_statement__ = 757;
        std_dev = stan::math::sqrt(
                    (stan::model::rvalue(pi, "pi", stan::model::index_uni(1))
                    * trace_T_i));
        current_statement__ = 758;
        stan::model::assign(T_i, std_dev, "assigning variable T_i",
          stan::model::index_uni(1), stan::model::index_uni(1));
        current_statement__ = 759;
        std_dev = stan::math::sqrt(
                    (stan::model::rvalue(pi, "pi", stan::model::index_uni(2))
                    * trace_T_i));
        current_statement__ = 760;
        T21 = ((2.0 *
          stan::model::rvalue(rho, "rho", stan::model::index_uni(rho_mark)))
          - 1.0);
        current_statement__ = 761;
        rho_mark = (rho_mark + 1);
        current_statement__ = 762;
        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__ = 763;
        stan::model::assign(T_i, (std_dev * T21), "assigning variable T_i",
          stan::model::index_uni(2), stan::model::index_uni(1));
        current_statement__ = 775;
        for (int r = 2; r <= (nc - 1); ++r) {
          int rp1 = std::numeric_limits<int>::min();
          current_statement__ = 764;
          rp1 = (r + 1);
          current_statement__ = 765;
          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__ = 766;
          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__ = 767;
          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__ = 768;
          z_T_mark = (z_T_mark + r);
          current_statement__ = 769;
          std_dev = stan::math::sqrt(
                      (stan::model::rvalue(pi, "pi",
                         stan::model::index_uni(rp1)) * trace_T_i));
          current_statement__ = 771;
          for (int c = 1; c <= r; ++c) {
            current_statement__ = 770;
            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__ = 772;
          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__ = 773;
          rho_mark = (rho_mark + 1);
        }
        current_statement__ = 780;
        for (int c = 1; c <= nc; ++c) {
          current_statement__ = 779;
          for (int r = c; r <= nc; ++r) {
            current_statement__ = 776;
            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__ = 777;
            theta_L_mark = (theta_L_mark + 1);
          }
        }
      }
    }
    current_statement__ = 788;
    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__ = 790;
    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__ = 792;
    b_mark = 1;
    int theta_L_mark = std::numeric_limits<int>::min();
    current_statement__ = 793;
    theta_L_mark = 1;
    current_statement__ = 823;
    for (int i = 1; i <= stan::math::size(p); ++i) {
      int nc = std::numeric_limits<int>::min();
      current_statement__ = 794;
      nc = stan::model::rvalue(p, "p", stan::model::index_uni(i));
      current_statement__ = 821;
      if (stan::math::logical_eq(nc, 1)) {
        local_scalar_t__ theta_L_start = DUMMY_VAR__;
        current_statement__ = 815;
        theta_L_start = stan::model::rvalue(theta_L, "theta_L",
                          stan::model::index_uni(theta_L_mark));
        current_statement__ = 817;
        for (int s = b_mark; s <= ((b_mark +
             stan::model::rvalue(l, "l", stan::model::index_uni(i))) -
             1); ++s) {
          current_statement__ = 816;
          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__ = 818;
        b_mark = (b_mark +
          stan::model::rvalue(l, "l", stan::model::index_uni(i)));
        current_statement__ = 819;
        theta_L_mark = (theta_L_mark + 1);
      } else {
        current_statement__ = 795;
        stan::math::validate_non_negative_index("T_i", "nc", nc);
        current_statement__ = 796;
        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__ = 797;
        stan::model::assign(T_i, stan::math::rep_matrix(0, nc, nc),
          "assigning variable T_i");
        current_statement__ = 805;
        for (int c = 1; c <= nc; ++c) {
          current_statement__ = 798;
          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__ = 799;
          theta_L_mark = (theta_L_mark + 1);
          current_statement__ = 803;
          for (int r = (c + 1); r <= nc; ++r) {
            current_statement__ = 800;
            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__ = 801;
            theta_L_mark = (theta_L_mark + 1);
          }
        }
        current_statement__ = 813;
        for (int j = 1; j <=
             stan::model::rvalue(l, "l", stan::model::index_uni(i)); ++j) {
          current_statement__ = 806;
          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__ = 807;
          stan::model::assign(temp,
            stan::math::multiply(T_i, stan::math::segment(z_b, b_mark, nc)),
            "assigning variable temp");
          current_statement__ = 808;
          b_mark = (b_mark - 1);
          current_statement__ = 810;
          for (int s = 1; s <= nc; ++s) {
            current_statement__ = 809;
            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__ = 811;
          b_mark = (b_mark + (nc + 1));
        }
      }
    }
    current_statement__ = 824;
    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__ = 826;
    lp = 0;
    int pos_reg = std::numeric_limits<int>::min();
    current_statement__ = 827;
    pos_reg = 1;
    int pos_rho = std::numeric_limits<int>::min();
    current_statement__ = 828;
    pos_rho = 1;
    current_statement__ = 829;
    lp = (lp + stan::math::normal_lpdf<false>(z_b, 0, 1));
    current_statement__ = 830;
    lp = (lp + stan::math::normal_lpdf<false>(z_T, 0, 1));
    current_statement__ = 848;
    for (int i = 1; i <= t; ++i) {
      current_statement__ = 847;
      if (stan::math::logical_gt(
            stan::model::rvalue(p, "p", stan::model::index_uni(i)), 1)) {
        current_statement__ = 831;
        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__ = 833;
        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__ = 835;
        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__ = 836;
        pos_reg = (pos_reg + 1);
        current_statement__ = 837;
        stan::model::assign(shape1, nu, "assigning variable shape1",
          stan::model::index_uni(1));
        current_statement__ = 838;
        stan::model::assign(shape2, nu, "assigning variable shape2",
          stan::model::index_uni(1));
        current_statement__ = 843;
        for (int j = 2; j <=
             (stan::model::rvalue(p, "p", stan::model::index_uni(i)) -
             1); ++j) {
          current_statement__ = 839;
          nu = (nu - 0.5);
          current_statement__ = 840;
          stan::model::assign(shape1, (0.5 * j), "assigning variable shape1",
            stan::model::index_uni(j));
          current_statement__ = 841;
          stan::model::assign(shape2, nu, "assigning variable shape2",
            stan::model::index_uni(j));
        }
        current_statement__ = 844;
        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__ = 845;
        pos_rho = (pos_rho +
          (stan::model::rvalue(p, "p", stan::model::index_uni(i)) - 1));
      }
    }
    current_statement__ = 849;
    lp = (lp + stan::math::gamma_lpdf<false>(zeta, delta, 1));
    current_statement__ = 850;
    lp = (lp + stan::math::gamma_lpdf<false>(tau, shape, 1));
    current_statement__ = 851;
    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__ = 853;
    K = stan::math::rows(z_beta);
    current_statement__ = 854;
    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__ = 855;
    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__ = 856;
    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__ = 857;
    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__ = 858;
    stan::model::assign(lambda2, stan::math::square(lambda),
      "assigning variable lambda2");
    current_statement__ = 859;
    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__ = 860;
    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__ = 861;
    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__ = 863;
    K = stan::math::rows(z_beta);
    current_statement__ = 864;
    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__ = 865;
    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__ = 866;
    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__ = 867;
    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__ = 868;
    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__ = 869;
    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__ = 870;
    stan::model::assign(lambda_eta2,
      stan::math::square(stan::math::elt_multiply(lambda, eta)),
      "assigning variable lambda_eta2");
    current_statement__ = 871;
    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__ = 872;
    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__ = 873;
    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__ = 875;
    z2 = stan::math::square(z);
    local_scalar_t__ z3 = DUMMY_VAR__;
    current_statement__ = 876;
    z3 = (z2 * z);
    local_scalar_t__ z5 = DUMMY_VAR__;
    current_statement__ = 877;
    z5 = (z2 * z3);
    local_scalar_t__ z7 = DUMMY_VAR__;
    current_statement__ = 878;
    z7 = (z2 * z5);
    local_scalar_t__ z9 = DUMMY_VAR__;
    current_statement__ = 879;
    z9 = (z2 * z7);
    local_scalar_t__ df2 = DUMMY_VAR__;
    current_statement__ = 880;
    df2 = stan::math::square(df);
    local_scalar_t__ df3 = DUMMY_VAR__;
    current_statement__ = 881;
    df3 = (df2 * df);
    local_scalar_t__ df4 = DUMMY_VAR__;
    current_statement__ = 882;
    df4 = (df2 * df2);
    current_statement__ = 883;
    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__ = 885;
    stan::math::validate_non_negative_index("V", "t", t);
    current_statement__ = 886;
    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__ = 888;
    pos = 1;
    current_statement__ = 894;
    if (stan::math::logical_gt(t, 0)) {
      current_statement__ = 893;
      for (int j = 1; j <= N; ++j) {
        current_statement__ = 892;
        for (int i = 1; i <= t; ++i) {
          current_statement__ = 889;
          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__ = 890;
          pos = (pos + 1);
        }
      }
    }
    current_statement__ = 895;
    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__ = 898;
    if (stan::math::logical_eq(family, 1)) {
      current_statement__ = 897;
      return stan::math::negative_infinity();
    }
    current_statement__ = 903;
    if (stan::math::logical_lte(family, 3)) {
      current_statement__ = 900;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 899;
        return stan::math::negative_infinity();
      }
      current_statement__ = 901;
      return 0;
    }
    current_statement__ = 904;
    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__ = 907;
    if ((stan::math::primitive_value(stan::math::logical_eq(family, 4)) &&
        stan::math::primitive_value(stan::math::logical_eq(link, 5)))) {
      current_statement__ = 906;
      return 0;
    }
    current_statement__ = 908;
    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_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__ = 916;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 915;
      return eta;
    } else {
      current_statement__ = 914;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 913;
        return stan::math::exp(eta);
      } else {
        current_statement__ = 912;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 911;
          return stan::math::inv(eta);
        } else {
          current_statement__ = 910;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 917;
    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__ = 919;
    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__ = 927;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 926;
      return eta;
    } else {
      current_statement__ = 925;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 924;
        return stan::math::exp(eta);
      } else {
        current_statement__ = 923;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 922;
          return stan::math::inv(eta);
        } else {
          current_statement__ = 921;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 928;
    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__ = 930;
    ret = ((stan::math::rows(y) * ((shape * stan::math::log(shape)) -
      stan::math::lgamma(shape))) + ((shape - 1) * sum_log_y));
    current_statement__ = 937;
    if (stan::math::logical_eq(link, 2)) {
      current_statement__ = 936;
      ret = (ret - ((shape * stan::math::sum(eta)) + (shape *
        stan::math::sum(stan::math::elt_divide(y, stan::math::exp(eta))))));
    } else {
      current_statement__ = 935;
      if (stan::math::logical_eq(link, 1)) {
        current_statement__ = 934;
        ret = (ret - ((shape * stan::math::sum(stan::math::log(eta))) +
          (shape * stan::math::sum(stan::math::elt_divide(y, eta)))));
      } else {
        current_statement__ = 933;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 932;
          ret = (ret + ((shape * stan::math::sum(stan::math::log(eta))) -
            (shape * stan::math::dot_product(eta, y))));
        } else {
          current_statement__ = 931;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 938;
    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__ = 940;
    N = stan::math::rows(eta);
    current_statement__ = 941;
    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__ = 958;
    if (stan::math::logical_eq(link, 3)) {
      current_statement__ = 956;
      for (int n = 1; n <= N; ++n) {
        current_statement__ = 954;
        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__ = 953;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 951;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 949;
          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__ = 948;
        if (stan::math::logical_eq(link, 1)) {
          current_statement__ = 946;
          for (int n = 1; n <= N; ++n) {
            current_statement__ = 944;
            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__ = 943;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 959;
    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__ = 969;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 968;
      return eta;
    } else {
      current_statement__ = 967;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 966;
        return stan::math::exp(eta);
      } else {
        current_statement__ = 965;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 964;
          return stan::math::inv(eta);
        } else {
          current_statement__ = 963;
          if (stan::math::logical_eq(link, 4)) {
            current_statement__ = 962;
            return stan::math::inv_sqrt(eta);
          } else {
            current_statement__ = 961;
            std::stringstream errmsg_stream__;
            stan::math::stan_print(&errmsg_stream__, "Invalid link");
            throw std::domain_error(errmsg_stream__.str());
          }
        }
      }
    }
    current_statement__ = 970;
    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__ = 972;
    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__ = 974;
    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__ = 975;
    stan::model::assign(mu, linkinv_inv_gaussian(eta, link, pstream__),
      "assigning variable mu");
    current_statement__ = 976;
    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__ = 978;
    mu2 = stan::math::square(mu);
    local_scalar_t__ z = DUMMY_VAR__;
    current_statement__ = 979;
    z = stan::math::uniform_rng(0, 1, base_rng__);
    local_scalar_t__ y = DUMMY_VAR__;
    current_statement__ = 980;
    y = stan::math::square(stan::math::normal_rng(0, 1, base_rng__));
    local_scalar_t__ x = DUMMY_VAR__;
    current_statement__ = 981;
    x = (mu + (((mu2 * y) - (mu *
      stan::math::sqrt(((((4 * mu) * lambda) * y) + (mu2 *
        stan::math::square(y))))))
      / (2 * lambda)));
    current_statement__ = 984;
    if (stan::math::logical_lte(z, (mu / (mu + x)))) {
      current_statement__ = 983;
      return x;
    } else {
      current_statement__ = 982;
      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__ = 998;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 997;
      return stan::math::inv_logit(eta);
    } else {
      current_statement__ = 996;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 995;
        return stan::math::Phi(eta);
      } else {
        current_statement__ = 994;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 993;
          return stan::math::inv_cloglog(eta);
        } else {
          current_statement__ = 992;
          if (stan::math::logical_eq(link, 4)) {
            current_statement__ = 991;
            return stan::math::add(0.5,
                     stan::math::divide(stan::math::atan(eta),
                       stan::math::pi()));
          } else {
            current_statement__ = 990;
            if (stan::math::logical_eq(link, 5)) {
              current_statement__ = 989;
              return stan::math::exp(eta);
            } else {
              current_statement__ = 988;
              if (stan::math::logical_eq(link, 6)) {
                current_statement__ = 987;
                return stan::math::subtract(1,
                         stan::math::inv_cloglog(stan::math::minus(eta)));
              } else {
                current_statement__ = 986;
                std::stringstream errmsg_stream__;
                stan::math::stan_print(&errmsg_stream__, "invalid link");
                throw std::domain_error(errmsg_stream__.str());
              }
            }
          }
        }
      }
    }
    current_statement__ = 999;
    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__ = 1007;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 1006;
      return stan::math::exp(eta);
    } else {
      current_statement__ = 1005;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 1004;
        return eta;
      } else {
        current_statement__ = 1003;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 1002;
          return stan::math::square(eta);
        } else {
          current_statement__ = 1001;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 1008;
    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__ = 1010;
    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__ = 1012;
    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__ = 1013;
    stan::model::assign(mu, linkinv_beta(eta, link, pstream__),
      "assigning variable mu");
    current_statement__ = 1016;
    for (int n = 1; n <= stan::math::rows(y); ++n) {
      current_statement__ = 1014;
      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__ = 1017;
    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__ = 1019;
    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__ = 1021;
    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__ = 1022;
    stan::model::assign(mu, linkinv_beta(eta, link, pstream__),
      "assigning variable mu");
    current_statement__ = 1023;
    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__ = 1024;
    stan::model::assign(mu_z, linkinv_beta_z(eta_z, link_phi, pstream__),
      "assigning variable mu_z");
    current_statement__ = 1027;
    for (int n = 1; n <= stan::math::rows(y); ++n) {
      current_statement__ = 1025;
      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__ = 1028;
    return ll;
  } 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_eigen_matrix_dynamic<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>
SS_asymp(const T0__& input_arg__, const T1__& Phi__arg__, 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& input = stan::math::to_ref(input_arg__);
  const auto& Phi_ = stan::math::to_ref(Phi__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__ = 1037;
    if (stan::math::logical_gt(stan::math::rows(Phi_), 1)) {
      current_statement__ = 1033;
      stan::math::validate_non_negative_index("Asym", "rows(Phi_)",
        stan::math::rows(Phi_));
      Eigen::Matrix<local_scalar_t__,-1,1> Asym =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(Phi_),
          DUMMY_VAR__);
      current_statement__ = 1034;
      stan::model::assign(Asym,
        stan::model::rvalue(Phi_, "Phi_", stan::model::index_omni(),
          stan::model::index_uni(1)), "assigning variable Asym");
      current_statement__ = 1035;
      return stan::math::add(Asym,
               stan::math::elt_multiply(
                 stan::math::subtract(
                   stan::model::rvalue(Phi_, "Phi_",
                     stan::model::index_omni(), stan::model::index_uni(2)),
                   Asym),
                 stan::math::exp(
                   stan::math::elt_multiply(
                     stan::math::minus(
                       stan::math::exp(
                         stan::model::rvalue(Phi_, "Phi_",
                           stan::model::index_omni(),
                           stan::model::index_uni(3)))), input))));
    } else {
      local_scalar_t__ Asym = DUMMY_VAR__;
      current_statement__ = 1030;
      Asym = stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
               stan::model::index_uni(1));
      current_statement__ = 1031;
      return stan::math::add(Asym,
               stan::math::multiply(
                 (stan::model::rvalue(Phi_, "Phi_",
                    stan::model::index_uni(1), stan::model::index_uni(2)) -
                 Asym),
                 stan::math::exp(
                   stan::math::multiply(
                     -stan::math::exp(
                        stan::model::rvalue(Phi_, "Phi_",
                          stan::model::index_uni(1),
                          stan::model::index_uni(3))), input))));
    }
  } 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_eigen_matrix_dynamic<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>
SS_asympOff(const T0__& input_arg__, const T1__& Phi__arg__, 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& input = stan::math::to_ref(input_arg__);
  const auto& Phi_ = stan::math::to_ref(Phi__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__ = 1041;
    if (stan::math::logical_gt(stan::math::rows(Phi_), 1)) {
      current_statement__ = 1040;
      return stan::math::elt_multiply(
               stan::model::rvalue(Phi_, "Phi_", stan::model::index_omni(),
                 stan::model::index_uni(1)),
               stan::math::subtract(1,
                 stan::math::exp(
                   stan::math::elt_multiply(
                     stan::math::minus(
                       stan::math::exp(
                         stan::model::rvalue(Phi_, "Phi_",
                           stan::model::index_omni(),
                           stan::model::index_uni(2)))),
                     stan::math::subtract(input,
                       stan::model::rvalue(Phi_, "Phi_",
                         stan::model::index_omni(), stan::model::index_uni(3)))))));
    } else {
      current_statement__ = 1039;
      return stan::math::multiply(
               stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
                 stan::model::index_uni(1)),
               stan::math::subtract(1,
                 stan::math::exp(
                   stan::math::multiply(
                     -stan::math::exp(
                        stan::model::rvalue(Phi_, "Phi_",
                          stan::model::index_uni(1),
                          stan::model::index_uni(2))),
                     stan::math::subtract(input,
                       stan::model::rvalue(Phi_, "Phi_",
                         stan::model::index_uni(1), stan::model::index_uni(3)))))));
    }
  } 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_eigen_matrix_dynamic<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>
SS_asympOrig(const T0__& input_arg__, const T1__& Phi__arg__, 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& input = stan::math::to_ref(input_arg__);
  const auto& Phi_ = stan::math::to_ref(Phi__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__ = 1045;
    if (stan::math::logical_gt(stan::math::rows(Phi_), 1)) {
      current_statement__ = 1044;
      return stan::math::elt_multiply(
               stan::model::rvalue(Phi_, "Phi_", stan::model::index_omni(),
                 stan::model::index_uni(1)),
               stan::math::subtract(1,
                 stan::math::exp(
                   stan::math::elt_multiply(
                     stan::math::minus(
                       stan::math::exp(
                         stan::model::rvalue(Phi_, "Phi_",
                           stan::model::index_omni(),
                           stan::model::index_uni(2)))), input))));
    } else {
      current_statement__ = 1043;
      return stan::math::multiply(
               stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
                 stan::model::index_uni(1)),
               stan::math::subtract(1,
                 stan::math::exp(
                   stan::math::multiply(
                     -stan::math::exp(
                        stan::model::rvalue(Phi_, "Phi_",
                          stan::model::index_uni(1),
                          stan::model::index_uni(2))), input))));
    }
  } 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_eigen_matrix_dynamic<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>
SS_biexp(const T0__& input_arg__, const T1__& Phi__arg__, 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& input = stan::math::to_ref(input_arg__);
  const auto& Phi_ = stan::math::to_ref(Phi__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__ = 1049;
    if (stan::math::logical_gt(stan::math::rows(Phi_), 1)) {
      current_statement__ = 1048;
      return stan::math::add(
               stan::math::elt_multiply(
                 stan::model::rvalue(Phi_, "Phi_", stan::model::index_omni(),
                   stan::model::index_uni(1)),
                 stan::math::exp(
                   stan::math::elt_multiply(
                     stan::math::minus(
                       stan::math::exp(
                         stan::model::rvalue(Phi_, "Phi_",
                           stan::model::index_omni(),
                           stan::model::index_uni(2)))), input))),
               stan::math::elt_multiply(
                 stan::model::rvalue(Phi_, "Phi_", stan::model::index_omni(),
                   stan::model::index_uni(3)),
                 stan::math::exp(
                   stan::math::elt_multiply(
                     stan::math::minus(
                       stan::math::exp(
                         stan::model::rvalue(Phi_, "Phi_",
                           stan::model::index_omni(),
                           stan::model::index_uni(4)))), input))));
    } else {
      current_statement__ = 1047;
      return stan::math::add(
               stan::math::multiply(
                 stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
                   stan::model::index_uni(1)),
                 stan::math::exp(
                   stan::math::multiply(
                     -stan::math::exp(
                        stan::model::rvalue(Phi_, "Phi_",
                          stan::model::index_uni(1),
                          stan::model::index_uni(2))), input))),
               stan::math::multiply(
                 stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
                   stan::model::index_uni(3)),
                 stan::math::exp(
                   stan::math::multiply(
                     -stan::math::exp(
                        stan::model::rvalue(Phi_, "Phi_",
                          stan::model::index_uni(1),
                          stan::model::index_uni(4))), input))));
    }
  } 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_eigen_matrix_dynamic<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>
SS_fol(const T0__& Dose_arg__, const T1__& input_arg__, const T2__&
       Phi__arg__, 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& Dose = stan::math::to_ref(Dose_arg__);
  const auto& input = stan::math::to_ref(input_arg__);
  const auto& Phi_ = stan::math::to_ref(Phi__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 Phi__rows = std::numeric_limits<int>::min();
    current_statement__ = 1051;
    Phi__rows = stan::math::rows(Phi_);
    current_statement__ = 1068;
    if (stan::math::logical_gt(Phi__rows, 1)) {
      current_statement__ = 1058;
      stan::math::validate_non_negative_index("lKe", "Phi__rows", Phi__rows);
      Eigen::Matrix<local_scalar_t__,-1,1> lKe =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(Phi__rows,
          DUMMY_VAR__);
      current_statement__ = 1059;
      stan::model::assign(lKe,
        stan::model::rvalue(Phi_, "Phi_", stan::model::index_omni(),
          stan::model::index_uni(1)), "assigning variable lKe");
      current_statement__ = 1060;
      stan::math::validate_non_negative_index("lKa", "Phi__rows", Phi__rows);
      Eigen::Matrix<local_scalar_t__,-1,1> lKa =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(Phi__rows,
          DUMMY_VAR__);
      current_statement__ = 1061;
      stan::model::assign(lKa,
        stan::model::rvalue(Phi_, "Phi_", stan::model::index_omni(),
          stan::model::index_uni(2)), "assigning variable lKa");
      current_statement__ = 1062;
      stan::math::validate_non_negative_index("exp_lKe", "Phi__rows",
        Phi__rows);
      Eigen::Matrix<local_scalar_t__,-1,1> exp_lKe =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(Phi__rows,
          DUMMY_VAR__);
      current_statement__ = 1063;
      stan::model::assign(exp_lKe, stan::math::exp(lKe),
        "assigning variable exp_lKe");
      current_statement__ = 1064;
      stan::math::validate_non_negative_index("exp_lKa", "Phi__rows",
        Phi__rows);
      Eigen::Matrix<local_scalar_t__,-1,1> exp_lKa =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(Phi__rows,
          DUMMY_VAR__);
      current_statement__ = 1065;
      stan::model::assign(exp_lKa, stan::math::exp(lKa),
        "assigning variable exp_lKa");
      current_statement__ = 1066;
      return stan::math::elt_divide(
               stan::math::elt_multiply(
                 stan::math::elt_multiply(Dose,
                   stan::math::exp(
                     stan::math::subtract(stan::math::add(lKe, lKa),
                       stan::model::rvalue(Phi_, "Phi_",
                         stan::model::index_omni(), stan::model::index_uni(3))))),
                 stan::math::subtract(
                   stan::math::exp(
                     stan::math::elt_multiply(stan::math::minus(exp_lKe),
                       input)),
                   stan::math::exp(
                     stan::math::elt_multiply(stan::math::minus(exp_lKa),
                       input)))), stan::math::subtract(exp_lKa, exp_lKe));
    } else {
      local_scalar_t__ lKe = DUMMY_VAR__;
      current_statement__ = 1052;
      lKe = stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
              stan::model::index_uni(1));
      local_scalar_t__ lKa = DUMMY_VAR__;
      current_statement__ = 1053;
      lKa = stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
              stan::model::index_uni(2));
      local_scalar_t__ exp_lKe = DUMMY_VAR__;
      current_statement__ = 1054;
      exp_lKe = stan::math::exp(lKe);
      local_scalar_t__ exp_lKa = DUMMY_VAR__;
      current_statement__ = 1055;
      exp_lKa = stan::math::exp(lKa);
      current_statement__ = 1056;
      return stan::math::divide(
               stan::math::elt_multiply(
                 stan::math::multiply(Dose,
                   stan::math::exp(((lKe + lKa) -
                     stan::model::rvalue(Phi_, "Phi_",
                       stan::model::index_uni(1), stan::model::index_uni(3))))),
                 stan::math::subtract(
                   stan::math::exp(stan::math::multiply(-exp_lKe, input)),
                   stan::math::exp(stan::math::multiply(-exp_lKa, input)))),
               (exp_lKa - exp_lKe));
    }
  } 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_eigen_matrix_dynamic<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>
SS_fpl(const T0__& input_arg__, const T1__& Phi__arg__, 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& input = stan::math::to_ref(input_arg__);
  const auto& Phi_ = stan::math::to_ref(Phi__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__ = 1077;
    if (stan::math::logical_gt(stan::math::rows(Phi_), 1)) {
      current_statement__ = 1073;
      stan::math::validate_non_negative_index("A", "rows(Phi_)",
        stan::math::rows(Phi_));
      Eigen::Matrix<local_scalar_t__,-1,1> A =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(Phi_),
          DUMMY_VAR__);
      current_statement__ = 1074;
      stan::model::assign(A,
        stan::model::rvalue(Phi_, "Phi_", stan::model::index_omni(),
          stan::model::index_uni(1)), "assigning variable A");
      current_statement__ = 1075;
      return stan::math::add(A,
               stan::math::elt_divide(
                 stan::math::subtract(
                   stan::model::rvalue(Phi_, "Phi_",
                     stan::model::index_omni(), stan::model::index_uni(2)), A),
                 stan::math::add(1,
                   stan::math::exp(
                     stan::math::elt_divide(
                       stan::math::subtract(
                         stan::model::rvalue(Phi_, "Phi_",
                           stan::model::index_omni(),
                           stan::model::index_uni(3)), input),
                       stan::math::exp(
                         stan::model::rvalue(Phi_, "Phi_",
                           stan::model::index_omni(),
                           stan::model::index_uni(4))))))));
    } else {
      local_scalar_t__ A = DUMMY_VAR__;
      current_statement__ = 1070;
      A = stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
            stan::model::index_uni(1));
      current_statement__ = 1071;
      return stan::math::add(A,
               stan::math::elt_divide(
                 stan::math::rep_vector(
                   (stan::model::rvalue(Phi_, "Phi_",
                      stan::model::index_uni(1), stan::model::index_uni(2)) -
                   A), stan::math::rows(input)),
                 stan::math::add(1,
                   stan::math::exp(
                     stan::math::divide(
                       stan::math::subtract(
                         stan::model::rvalue(Phi_, "Phi_",
                           stan::model::index_uni(1),
                           stan::model::index_uni(3)), input),
                       stan::math::exp(
                         stan::model::rvalue(Phi_, "Phi_",
                           stan::model::index_uni(1),
                           stan::model::index_uni(4))))))));
    }
  } 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_eigen_matrix_dynamic<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>
SS_gompertz(const T0__& x_arg__, const T1__& Phi__arg__, 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& x = stan::math::to_ref(x_arg__);
  const auto& Phi_ = stan::math::to_ref(Phi__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__ = 1079;
    stan::math::validate_non_negative_index("out", "rows(x)",
      stan::math::rows(x));
    Eigen::Matrix<local_scalar_t__,-1,1> out =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(x),
        DUMMY_VAR__);
    current_statement__ = 1089;
    if (stan::math::logical_gt(stan::math::rows(Phi_), 1)) {
      current_statement__ = 1088;
      for (int i = 1; i <= stan::math::rows(x); ++i) {
        current_statement__ = 1087;
        stan::model::assign(out,
          (stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(i),
             stan::model::index_uni(1)) *
          stan::math::exp(
            (-stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(i),
                stan::model::index_uni(2)) *
            stan::math::pow(
              stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(i),
                stan::model::index_uni(3)),
              stan::model::rvalue(x, "x", stan::model::index_uni(i)))))),
          "assigning variable out", stan::model::index_uni(i));
      }
    } else {
      local_scalar_t__ Asym = DUMMY_VAR__;
      current_statement__ = 1081;
      Asym = stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
               stan::model::index_uni(1));
      local_scalar_t__ b2 = DUMMY_VAR__;
      current_statement__ = 1082;
      b2 = stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
             stan::model::index_uni(2));
      local_scalar_t__ b3 = DUMMY_VAR__;
      current_statement__ = 1083;
      b3 = stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
             stan::model::index_uni(3));
      current_statement__ = 1085;
      for (int i = 1; i <= stan::math::rows(x); ++i) {
        current_statement__ = 1084;
        stan::model::assign(out, (Asym *
          stan::math::exp((-b2 *
            stan::math::pow(b3,
              stan::model::rvalue(x, "x", stan::model::index_uni(i)))))),
          "assigning variable out", stan::model::index_uni(i));
      }
    }
    current_statement__ = 1090;
    return out;
  } 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_eigen_matrix_dynamic<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>
SS_logis(const T0__& input_arg__, const T1__& Phi__arg__, 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& input = stan::math::to_ref(input_arg__);
  const auto& Phi_ = stan::math::to_ref(Phi__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__ = 1094;
    if (stan::math::logical_gt(stan::math::rows(Phi_), 1)) {
      current_statement__ = 1093;
      return stan::math::elt_divide(
               stan::model::rvalue(Phi_, "Phi_", stan::model::index_omni(),
                 stan::model::index_uni(1)),
               stan::math::add(1,
                 stan::math::exp(
                   stan::math::elt_divide(
                     stan::math::subtract(
                       stan::model::rvalue(Phi_, "Phi_",
                         stan::model::index_omni(), stan::model::index_uni(2)),
                       input),
                     stan::math::exp(
                       stan::model::rvalue(Phi_, "Phi_",
                         stan::model::index_omni(), stan::model::index_uni(3)))))));
    } else {
      current_statement__ = 1092;
      return stan::math::elt_divide(
               stan::math::rep_vector(
                 stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
                   stan::model::index_uni(1)), stan::math::rows(input)),
               stan::math::add(1,
                 stan::math::exp(
                   stan::math::divide(
                     stan::math::subtract(
                       stan::model::rvalue(Phi_, "Phi_",
                         stan::model::index_uni(1), stan::model::index_uni(2)),
                       input),
                     stan::math::exp(
                       stan::model::rvalue(Phi_, "Phi_",
                         stan::model::index_uni(1), stan::model::index_uni(3)))))));
    }
  } 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_eigen_matrix_dynamic<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>
SS_micmen(const T0__& input_arg__, const T1__& Phi__arg__, 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& input = stan::math::to_ref(input_arg__);
  const auto& Phi_ = stan::math::to_ref(Phi__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__ = 1098;
    if (stan::math::logical_gt(stan::math::rows(Phi_), 1)) {
      current_statement__ = 1097;
      return stan::math::elt_divide(
               stan::math::elt_multiply(
                 stan::model::rvalue(Phi_, "Phi_", stan::model::index_omni(),
                   stan::model::index_uni(1)), input),
               stan::math::add(
                 stan::model::rvalue(Phi_, "Phi_", stan::model::index_omni(),
                   stan::model::index_uni(2)), input));
    } else {
      current_statement__ = 1096;
      return stan::math::elt_divide(
               stan::math::multiply(
                 stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
                   stan::model::index_uni(1)), input),
               stan::math::add(
                 stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
                   stan::model::index_uni(2)), input));
    }
  } 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_eigen_matrix_dynamic<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>
SS_weibull(const T0__& x_arg__, const T1__& Phi__arg__, 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& x = stan::math::to_ref(x_arg__);
  const auto& Phi_ = stan::math::to_ref(Phi__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__ = 1100;
    stan::math::validate_non_negative_index("out", "rows(x)",
      stan::math::rows(x));
    Eigen::Matrix<local_scalar_t__,-1,1> out =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(x),
        DUMMY_VAR__);
    current_statement__ = 1111;
    if (stan::math::logical_gt(stan::math::rows(Phi_), 1)) {
      current_statement__ = 1110;
      for (int i = 1; i <= stan::math::rows(x); ++i) {
        current_statement__ = 1109;
        stan::model::assign(out,
          (stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(i),
             stan::model::index_uni(1)) -
          (stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(i),
             stan::model::index_uni(2)) *
          stan::math::exp(
            (-stan::math::exp(
                stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(i),
                  stan::model::index_uni(3))) *
            stan::math::pow(
              stan::model::rvalue(x, "x", stan::model::index_uni(i)),
              stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(i),
                stan::model::index_uni(4))))))), "assigning variable out",
          stan::model::index_uni(i));
      }
    } else {
      local_scalar_t__ Asym = DUMMY_VAR__;
      current_statement__ = 1102;
      Asym = stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
               stan::model::index_uni(1));
      local_scalar_t__ Drop = DUMMY_VAR__;
      current_statement__ = 1103;
      Drop = stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
               stan::model::index_uni(2));
      local_scalar_t__ lrc = DUMMY_VAR__;
      current_statement__ = 1104;
      lrc = stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
              stan::model::index_uni(3));
      local_scalar_t__ pwr = DUMMY_VAR__;
      current_statement__ = 1105;
      pwr = stan::model::rvalue(Phi_, "Phi_", stan::model::index_uni(1),
              stan::model::index_uni(4));
      current_statement__ = 1107;
      for (int i = 1; i <= stan::math::rows(x); ++i) {
        current_statement__ = 1106;
        stan::model::assign(out, (Asym - (Drop *
          stan::math::exp((-stan::math::exp(lrc) *
            stan::math::pow(
              stan::model::rvalue(x, "x", stan::model::index_uni(i)), pwr))))),
          "assigning variable out", stan::model::index_uni(i));
      }
    }
    current_statement__ = 1112;
    return out;
  } 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>
reshape_vec(const T0__& x_arg__, const int& Rows, const int& Cols,
            std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& x = stan::math::to_ref(x_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__ = 1114;
    stan::math::validate_non_negative_index("out", "Rows", Rows);
    current_statement__ = 1115;
    stan::math::validate_non_negative_index("out", "Cols", Cols);
    Eigen::Matrix<local_scalar_t__,-1,-1> out =
      Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(Rows, Cols,
        DUMMY_VAR__);
    int pos = std::numeric_limits<int>::min();
    current_statement__ = 1117;
    pos = 1;
    current_statement__ = 1119;
    if (stan::math::logical_neq(stan::math::rows(x), (Rows * Cols))) {
      current_statement__ = 1118;
      std::stringstream errmsg_stream__;
      stan::math::stan_print(&errmsg_stream__, "x is the wrong length");
      throw std::domain_error(errmsg_stream__.str());
    }
    current_statement__ = 1124;
    for (int c = 1; c <= Cols; ++c) {
      current_statement__ = 1123;
      for (int r = 1; r <= Rows; ++r) {
        current_statement__ = 1120;
        stan::model::assign(out,
          stan::model::rvalue(x, "x", stan::model::index_uni(pos)),
          "assigning variable out", stan::model::index_uni(r),
          stan::model::index_uni(c));
        current_statement__ = 1121;
        pos = (pos + 1);
      }
    }
    current_statement__ = 1125;
    return out;
  } 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__,
          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_eigen_matrix_dynamic<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T4__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>,
  stan::base_type_t<T2__>, T3__, T4__>
mvn_ols_lpdf(const T0__& coeff_arg__, const T1__& OLS_arg__, const T2__&
             XtX_arg__, const T3__& SSR, const T4__& sigma, const int& N,
             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__>, T3__, T4__>;
  int current_statement__ = 0;
  const auto& coeff = stan::math::to_ref(coeff_arg__);
  const auto& OLS = stan::math::to_ref(OLS_arg__);
  const auto& XtX = stan::math::to_ref(XtX_arg__);
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1127;
    return (((-0.5 *
           (stan::math::quad_form(XtX, stan::math::subtract(coeff, OLS)) +
           SSR)) / stan::math::square(sigma)) - (N * (stan::math::log(sigma)
           + stan::math::log(stan::math::sqrt((2 * stan::math::pi()))))));
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
#include <stan_meta_header.hpp>
class model_continuous final : public model_base_crtp<model_continuous> {
private:
  int N;
  int K;
  Eigen::Matrix<double,-1,1> xbar_data__;
  int dense_X;
  std::vector<Eigen::Matrix<double,-1,-1>> X;
  int nnz_X;
  Eigen::Matrix<double,-1,1> w_X_data__;
  std::vector<int> v_X;
  std::vector<int> u_X;
  int K_smooth;
  Eigen::Matrix<double,-1,-1> S_data__;
  std::vector<int> smooth_map;
  int len_y;
  double lb_y;
  double ub_y;
  Eigen::Matrix<double,-1,1> y_data__;
  int family;
  int prior_PD;
  int compute_mean_PPD;
  int has_intercept;
  int link;
  int prior_dist;
  int prior_dist_for_intercept;
  int prior_dist_for_aux;
  int prior_dist_for_smooth;
  int has_weights;
  Eigen::Matrix<double,-1,1> weights_data__;
  int has_offset;
  Eigen::Matrix<double,-1,1> offset__data__;
  Eigen::Matrix<double,-1,1> prior_scale_data__;
  double prior_scale_for_intercept;
  double prior_scale_for_aux;
  Eigen::Matrix<double,-1,1> prior_scale_for_smooth_data__;
  Eigen::Matrix<double,-1,1> prior_mean_data__;
  double prior_mean_for_intercept;
  double prior_mean_for_aux;
  Eigen::Matrix<double,-1,1> prior_mean_for_smooth_data__;
  Eigen::Matrix<double,-1,1> prior_df_data__;
  double prior_df_for_intercept;
  double prior_df_for_aux;
  Eigen::Matrix<double,-1,1> prior_df_for_smooth_data__;
  double global_prior_df;
  double global_prior_scale;
  double slab_df;
  double slab_scale;
  std::vector<int> num_normals;
  int t;
  std::vector<int> p;
  std::vector<int> l;
  int q;
  int len_theta_L;
  Eigen::Matrix<double,-1,1> shape_data__;
  Eigen::Matrix<double,-1,1> scale_data__;
  int len_concentration;
  std::vector<double> concentration;
  int len_regularization;
  std::vector<double> regularization;
  int num_non_zero;
  Eigen::Matrix<double,-1,1> w_data__;
  std::vector<int> v;
  std::vector<int> u;
  int special_case;
  int has_intercept_z;
  int link_phi;
  int z_dim;
  Eigen::Matrix<double,-1,-1> betareg_z_data__;
  Eigen::Matrix<double,1,-1> zbar_data__;
  int prior_dist_z;
  int prior_dist_for_intercept_z;
  Eigen::Matrix<double,-1,1> prior_scale_z_data__;
  double prior_scale_for_intercept_z;
  Eigen::Matrix<double,-1,1> prior_mean_z_data__;
  double prior_mean_for_intercept_z;
  Eigen::Matrix<double,-1,1> prior_df_z_data__;
  double prior_df_for_intercept_z;
  double global_prior_scale_z;
  double global_prior_df_z;
  double slab_df_z;
  double slab_scale_z;
  std::vector<int> num_normals_z;
  int SSfun;
  Eigen::Matrix<double,-1,1> input_data__;
  Eigen::Matrix<double,-1,1> Dose_data__;
  Eigen::Matrix<double,-1,1> sqrt_y_data__;
  Eigen::Matrix<double,-1,1> log_y_data__;
  double sum_log_y;
  std::vector<std::vector<int>> V;
  int hs_z;
  int can_do_OLS;
  Eigen::Matrix<double,-1,1> OLS_data__;
  Eigen::Matrix<double,-1,-1> XtX_data__;
  int can_do_normalidglm;
  Eigen::Matrix<double,-1,-1> XS_data__;
  double SSR;
  int len_z_T;
  int len_var_group;
  int len_rho;
  int is_continuous;
  int pos;
  std::vector<double> delta;
  int hs;
  int z_beta_1dim__;
  int smooth_sd_raw_1dim__;
  int caux_1dim__;
  int mix_1dim__;
  int one_over_lambda_1dim__;
  int z_omega_1dim__;
  int caux_z_1dim__;
  int S_z_1dim__;
  int one_over_lambda_z_1dim__;
  int smooth_sd_1dim__;
  Eigen::Map<Eigen::Matrix<double,-1,1>> xbar{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> w_X{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> S{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> weights{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> offset_{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> prior_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> prior_scale_for_smooth{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> prior_mean{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> prior_mean_for_smooth{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> prior_df{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> prior_df_for_smooth{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> shape{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> w{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> betareg_z{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,1,-1>> zbar{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> prior_scale_z{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> prior_mean_z{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> prior_df_z{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> input{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> Dose{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> sqrt_y{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> log_y{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> OLS{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> XtX{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> XS{nullptr, 0, 0};
public:
  ~model_continuous() {}
  model_continuous(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_continuous_namespace::model_continuous";
    // 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__ = 518;
      context__.validate_dims("data initialization", "N", "int",
        std::vector<size_t>{});
      N = std::numeric_limits<int>::min();
      current_statement__ = 518;
      N = context__.vals_i("N")[(1 - 1)];
      current_statement__ = 518;
      stan::math::check_greater_or_equal(function__, "N", N, 0);
      current_statement__ = 519;
      context__.validate_dims("data initialization", "K", "int",
        std::vector<size_t>{});
      K = std::numeric_limits<int>::min();
      current_statement__ = 519;
      K = context__.vals_i("K")[(1 - 1)];
      current_statement__ = 519;
      stan::math::check_greater_or_equal(function__, "K", K, 0);
      current_statement__ = 520;
      stan::math::validate_non_negative_index("xbar", "K", K);
      current_statement__ = 521;
      context__.validate_dims("data initialization", "xbar", "double",
        std::vector<size_t>{static_cast<size_t>(K)});
      xbar_data__ = Eigen::Matrix<double,-1,1>::Constant(K,
                      std::numeric_limits<double>::quiet_NaN());
      new (&xbar) Eigen::Map<Eigen::Matrix<double,-1,1>>(xbar_data__.data(),
        K);
      {
        std::vector<local_scalar_t__> xbar_flat__;
        current_statement__ = 521;
        xbar_flat__ = context__.vals_r("xbar");
        current_statement__ = 521;
        pos__ = 1;
        current_statement__ = 521;
        for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
          current_statement__ = 521;
          stan::model::assign(xbar, xbar_flat__[(pos__ - 1)],
            "assigning variable xbar", stan::model::index_uni(sym1__));
          current_statement__ = 521;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 522;
      context__.validate_dims("data initialization", "dense_X", "int",
        std::vector<size_t>{});
      dense_X = std::numeric_limits<int>::min();
      current_statement__ = 522;
      dense_X = context__.vals_i("dense_X")[(1 - 1)];
      current_statement__ = 522;
      stan::math::check_greater_or_equal(function__, "dense_X", dense_X, 0);
      current_statement__ = 522;
      stan::math::check_less_or_equal(function__, "dense_X", dense_X, 1);
      current_statement__ = 523;
      stan::math::validate_non_negative_index("X", "dense_X", dense_X);
      current_statement__ = 524;
      stan::math::validate_non_negative_index("X", "N", N);
      current_statement__ = 525;
      stan::math::validate_non_negative_index("X", "K", K);
      current_statement__ = 526;
      context__.validate_dims("data initialization", "X", "double",
        std::vector<size_t>{static_cast<size_t>(dense_X),
          static_cast<size_t>(N), static_cast<size_t>(K)});
      X = std::vector<Eigen::Matrix<double,-1,-1>>(dense_X,
            Eigen::Matrix<double,-1,-1>::Constant(N, K,
              std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> X_flat__;
        current_statement__ = 526;
        X_flat__ = context__.vals_r("X");
        current_statement__ = 526;
        pos__ = 1;
        current_statement__ = 526;
        for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
          current_statement__ = 526;
          for (int sym2__ = 1; sym2__ <= N; ++sym2__) {
            current_statement__ = 526;
            for (int sym3__ = 1; sym3__ <= dense_X; ++sym3__) {
              current_statement__ = 526;
              stan::model::assign(X, X_flat__[(pos__ - 1)],
                "assigning variable X", stan::model::index_uni(sym3__),
                stan::model::index_uni(sym2__),
                stan::model::index_uni(sym1__));
              current_statement__ = 526;
              pos__ = (pos__ + 1);
            }
          }
        }
      }
      current_statement__ = 527;
      context__.validate_dims("data initialization", "nnz_X", "int",
        std::vector<size_t>{});
      nnz_X = std::numeric_limits<int>::min();
      current_statement__ = 527;
      nnz_X = context__.vals_i("nnz_X")[(1 - 1)];
      current_statement__ = 527;
      stan::math::check_greater_or_equal(function__, "nnz_X", nnz_X, 0);
      current_statement__ = 528;
      stan::math::validate_non_negative_index("w_X", "nnz_X", nnz_X);
      current_statement__ = 529;
      context__.validate_dims("data initialization", "w_X", "double",
        std::vector<size_t>{static_cast<size_t>(nnz_X)});
      w_X_data__ = Eigen::Matrix<double,-1,1>::Constant(nnz_X,
                     std::numeric_limits<double>::quiet_NaN());
      new (&w_X) Eigen::Map<Eigen::Matrix<double,-1,1>>(w_X_data__.data(),
        nnz_X);
      {
        std::vector<local_scalar_t__> w_X_flat__;
        current_statement__ = 529;
        w_X_flat__ = context__.vals_r("w_X");
        current_statement__ = 529;
        pos__ = 1;
        current_statement__ = 529;
        for (int sym1__ = 1; sym1__ <= nnz_X; ++sym1__) {
          current_statement__ = 529;
          stan::model::assign(w_X, w_X_flat__[(pos__ - 1)],
            "assigning variable w_X", stan::model::index_uni(sym1__));
          current_statement__ = 529;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 530;
      stan::math::validate_non_negative_index("v_X", "nnz_X", nnz_X);
      current_statement__ = 531;
      context__.validate_dims("data initialization", "v_X", "int",
        std::vector<size_t>{static_cast<size_t>(nnz_X)});
      v_X = std::vector<int>(nnz_X, std::numeric_limits<int>::min());
      current_statement__ = 531;
      v_X = context__.vals_i("v_X");
      current_statement__ = 531;
      stan::math::check_greater_or_equal(function__, "v_X", v_X, 1);
      current_statement__ = 531;
      stan::math::check_less_or_equal(function__, "v_X", v_X, K);
      current_statement__ = 532;
      stan::math::validate_non_negative_index("u_X", "dense_X ? 0 : N + 1",
        (dense_X ? 0 : (N + 1)));
      current_statement__ = 533;
      context__.validate_dims("data initialization", "u_X", "int",
        std::vector<size_t>{static_cast<size_t>((dense_X ? 0 : (N + 1)))});
      u_X = std::vector<int>((dense_X ? 0 : (N + 1)),
              std::numeric_limits<int>::min());
      current_statement__ = 533;
      u_X = context__.vals_i("u_X");
      current_statement__ = 533;
      stan::math::check_greater_or_equal(function__, "u_X", u_X, 1);
      current_statement__ = 533;
      stan::math::check_less_or_equal(function__, "u_X", u_X,
        (stan::math::rows(w_X) + 1));
      current_statement__ = 534;
      context__.validate_dims("data initialization", "K_smooth", "int",
        std::vector<size_t>{});
      K_smooth = std::numeric_limits<int>::min();
      current_statement__ = 534;
      K_smooth = context__.vals_i("K_smooth")[(1 - 1)];
      current_statement__ = 534;
      stan::math::check_greater_or_equal(function__, "K_smooth", K_smooth, 0);
      current_statement__ = 535;
      stan::math::validate_non_negative_index("S", "N", N);
      current_statement__ = 536;
      stan::math::validate_non_negative_index("S", "K_smooth", K_smooth);
      current_statement__ = 537;
      context__.validate_dims("data initialization", "S", "double",
        std::vector<size_t>{static_cast<size_t>(N),
          static_cast<size_t>(K_smooth)});
      S_data__ = Eigen::Matrix<double,-1,-1>::Constant(N, K_smooth,
                   std::numeric_limits<double>::quiet_NaN());
      new (&S) Eigen::Map<Eigen::Matrix<double,-1,-1>>(S_data__.data(), N,
        K_smooth);
      {
        std::vector<local_scalar_t__> S_flat__;
        current_statement__ = 537;
        S_flat__ = context__.vals_r("S");
        current_statement__ = 537;
        pos__ = 1;
        current_statement__ = 537;
        for (int sym1__ = 1; sym1__ <= K_smooth; ++sym1__) {
          current_statement__ = 537;
          for (int sym2__ = 1; sym2__ <= N; ++sym2__) {
            current_statement__ = 537;
            stan::model::assign(S, S_flat__[(pos__ - 1)],
              "assigning variable S", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 537;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 538;
      stan::math::validate_non_negative_index("smooth_map", "K_smooth",
        K_smooth);
      current_statement__ = 539;
      context__.validate_dims("data initialization", "smooth_map", "int",
        std::vector<size_t>{static_cast<size_t>(K_smooth)});
      smooth_map = std::vector<int>(K_smooth,
                     std::numeric_limits<int>::min());
      current_statement__ = 539;
      smooth_map = context__.vals_i("smooth_map");
      current_statement__ = 539;
      stan::math::check_greater_or_equal(function__, "smooth_map",
        smooth_map, 1);
      current_statement__ = 540;
      context__.validate_dims("data initialization", "len_y", "int",
        std::vector<size_t>{});
      len_y = std::numeric_limits<int>::min();
      current_statement__ = 540;
      len_y = context__.vals_i("len_y")[(1 - 1)];
      current_statement__ = 540;
      stan::math::check_greater_or_equal(function__, "len_y", len_y, 0);
      current_statement__ = 541;
      context__.validate_dims("data initialization", "lb_y", "double",
        std::vector<size_t>{});
      lb_y = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 541;
      lb_y = context__.vals_r("lb_y")[(1 - 1)];
      current_statement__ = 542;
      context__.validate_dims("data initialization", "ub_y", "double",
        std::vector<size_t>{});
      ub_y = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 542;
      ub_y = context__.vals_r("ub_y")[(1 - 1)];
      current_statement__ = 542;
      stan::math::check_greater_or_equal(function__, "ub_y", ub_y, lb_y);
      current_statement__ = 543;
      stan::math::validate_non_negative_index("y", "len_y", len_y);
      current_statement__ = 544;
      context__.validate_dims("data initialization", "y", "double",
        std::vector<size_t>{static_cast<size_t>(len_y)});
      y_data__ = Eigen::Matrix<double,-1,1>::Constant(len_y,
                   std::numeric_limits<double>::quiet_NaN());
      new (&y) Eigen::Map<Eigen::Matrix<double,-1,1>>(y_data__.data(), len_y);
      {
        std::vector<local_scalar_t__> y_flat__;
        current_statement__ = 544;
        y_flat__ = context__.vals_r("y");
        current_statement__ = 544;
        pos__ = 1;
        current_statement__ = 544;
        for (int sym1__ = 1; sym1__ <= len_y; ++sym1__) {
          current_statement__ = 544;
          stan::model::assign(y, y_flat__[(pos__ - 1)],
            "assigning variable y", stan::model::index_uni(sym1__));
          current_statement__ = 544;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 544;
      stan::math::check_greater_or_equal(function__, "y", y, lb_y);
      current_statement__ = 544;
      stan::math::check_less_or_equal(function__, "y", y, ub_y);
      current_statement__ = 545;
      context__.validate_dims("data initialization", "family", "int",
        std::vector<size_t>{});
      family = std::numeric_limits<int>::min();
      current_statement__ = 545;
      family = context__.vals_i("family")[(1 - 1)];
      current_statement__ = 545;
      stan::math::check_greater_or_equal(function__, "family", family, 1);
      current_statement__ = 545;
      stan::math::check_less_or_equal(function__, "family", family, 4);
      current_statement__ = 546;
      context__.validate_dims("data initialization", "prior_PD", "int",
        std::vector<size_t>{});
      prior_PD = std::numeric_limits<int>::min();
      current_statement__ = 546;
      prior_PD = context__.vals_i("prior_PD")[(1 - 1)];
      current_statement__ = 546;
      stan::math::check_greater_or_equal(function__, "prior_PD", prior_PD, 0);
      current_statement__ = 546;
      stan::math::check_less_or_equal(function__, "prior_PD", prior_PD, 1);
      current_statement__ = 547;
      context__.validate_dims("data initialization", "compute_mean_PPD",
        "int", std::vector<size_t>{});
      compute_mean_PPD = std::numeric_limits<int>::min();
      current_statement__ = 547;
      compute_mean_PPD = context__.vals_i("compute_mean_PPD")[(1 - 1)];
      current_statement__ = 547;
      stan::math::check_greater_or_equal(function__, "compute_mean_PPD",
        compute_mean_PPD, 0);
      current_statement__ = 547;
      stan::math::check_less_or_equal(function__, "compute_mean_PPD",
        compute_mean_PPD, 1);
      current_statement__ = 548;
      context__.validate_dims("data initialization", "has_intercept", "int",
        std::vector<size_t>{});
      has_intercept = std::numeric_limits<int>::min();
      current_statement__ = 548;
      has_intercept = context__.vals_i("has_intercept")[(1 - 1)];
      current_statement__ = 548;
      stan::math::check_greater_or_equal(function__, "has_intercept",
        has_intercept, 0);
      current_statement__ = 548;
      stan::math::check_less_or_equal(function__, "has_intercept",
        has_intercept, 1);
      current_statement__ = 549;
      context__.validate_dims("data initialization", "link", "int",
        std::vector<size_t>{});
      link = std::numeric_limits<int>::min();
      current_statement__ = 549;
      link = context__.vals_i("link")[(1 - 1)];
      current_statement__ = 549;
      stan::math::check_greater_or_equal(function__, "link", link, 1);
      current_statement__ = 550;
      context__.validate_dims("data initialization", "prior_dist", "int",
        std::vector<size_t>{});
      prior_dist = std::numeric_limits<int>::min();
      current_statement__ = 550;
      prior_dist = context__.vals_i("prior_dist")[(1 - 1)];
      current_statement__ = 550;
      stan::math::check_greater_or_equal(function__, "prior_dist",
        prior_dist, 0);
      current_statement__ = 550;
      stan::math::check_less_or_equal(function__, "prior_dist", prior_dist, 7);
      current_statement__ = 551;
      context__.validate_dims("data initialization",
        "prior_dist_for_intercept", "int", std::vector<size_t>{});
      prior_dist_for_intercept = std::numeric_limits<int>::min();
      current_statement__ = 551;
      prior_dist_for_intercept = context__.vals_i("prior_dist_for_intercept")[(1
        - 1)];
      current_statement__ = 551;
      stan::math::check_greater_or_equal(function__,
        "prior_dist_for_intercept", prior_dist_for_intercept, 0);
      current_statement__ = 551;
      stan::math::check_less_or_equal(function__, "prior_dist_for_intercept",
        prior_dist_for_intercept, 2);
      current_statement__ = 552;
      context__.validate_dims("data initialization", "prior_dist_for_aux",
        "int", std::vector<size_t>{});
      prior_dist_for_aux = std::numeric_limits<int>::min();
      current_statement__ = 552;
      prior_dist_for_aux = context__.vals_i("prior_dist_for_aux")[(1 - 1)];
      current_statement__ = 552;
      stan::math::check_greater_or_equal(function__, "prior_dist_for_aux",
        prior_dist_for_aux, 0);
      current_statement__ = 552;
      stan::math::check_less_or_equal(function__, "prior_dist_for_aux",
        prior_dist_for_aux, 3);
      current_statement__ = 553;
      context__.validate_dims("data initialization", "prior_dist_for_smooth",
        "int", std::vector<size_t>{});
      prior_dist_for_smooth = std::numeric_limits<int>::min();
      current_statement__ = 553;
      prior_dist_for_smooth = context__.vals_i("prior_dist_for_smooth")[(1 -
        1)];
      current_statement__ = 553;
      stan::math::check_greater_or_equal(function__, "prior_dist_for_smooth",
        prior_dist_for_smooth, 0);
      current_statement__ = 553;
      stan::math::check_less_or_equal(function__, "prior_dist_for_smooth",
        prior_dist_for_smooth, 3);
      current_statement__ = 554;
      context__.validate_dims("data initialization", "has_weights", "int",
        std::vector<size_t>{});
      has_weights = std::numeric_limits<int>::min();
      current_statement__ = 554;
      has_weights = context__.vals_i("has_weights")[(1 - 1)];
      current_statement__ = 554;
      stan::math::check_greater_or_equal(function__, "has_weights",
        has_weights, 0);
      current_statement__ = 554;
      stan::math::check_less_or_equal(function__, "has_weights", has_weights,
        1);
      current_statement__ = 555;
      stan::math::validate_non_negative_index("weights",
        "has_weights ? N : 0", (has_weights ? N : 0));
      current_statement__ = 556;
      context__.validate_dims("data initialization", "weights", "double",
        std::vector<size_t>{static_cast<size_t>((has_weights ? N : 0))});
      weights_data__ = Eigen::Matrix<double,-1,1>::Constant((has_weights ? N : 0),
                         std::numeric_limits<double>::quiet_NaN());
      new (&weights)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(weights_data__.data(),
        (has_weights ? N : 0));
      {
        std::vector<local_scalar_t__> weights_flat__;
        current_statement__ = 556;
        weights_flat__ = context__.vals_r("weights");
        current_statement__ = 556;
        pos__ = 1;
        current_statement__ = 556;
        for (int sym1__ = 1; sym1__ <= (has_weights ? N : 0); ++sym1__) {
          current_statement__ = 556;
          stan::model::assign(weights, weights_flat__[(pos__ - 1)],
            "assigning variable weights", stan::model::index_uni(sym1__));
          current_statement__ = 556;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 557;
      context__.validate_dims("data initialization", "has_offset", "int",
        std::vector<size_t>{});
      has_offset = std::numeric_limits<int>::min();
      current_statement__ = 557;
      has_offset = context__.vals_i("has_offset")[(1 - 1)];
      current_statement__ = 557;
      stan::math::check_greater_or_equal(function__, "has_offset",
        has_offset, 0);
      current_statement__ = 557;
      stan::math::check_less_or_equal(function__, "has_offset", has_offset, 1);
      current_statement__ = 558;
      stan::math::validate_non_negative_index("offset_",
        "has_offset ? N : 0", (has_offset ? N : 0));
      current_statement__ = 559;
      context__.validate_dims("data initialization", "offset_", "double",
        std::vector<size_t>{static_cast<size_t>((has_offset ? N : 0))});
      offset__data__ = Eigen::Matrix<double,-1,1>::Constant((has_offset ? N : 0),
                         std::numeric_limits<double>::quiet_NaN());
      new (&offset_)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(offset__data__.data(),
        (has_offset ? N : 0));
      {
        std::vector<local_scalar_t__> offset__flat__;
        current_statement__ = 559;
        offset__flat__ = context__.vals_r("offset_");
        current_statement__ = 559;
        pos__ = 1;
        current_statement__ = 559;
        for (int sym1__ = 1; sym1__ <= (has_offset ? N : 0); ++sym1__) {
          current_statement__ = 559;
          stan::model::assign(offset_, offset__flat__[(pos__ - 1)],
            "assigning variable offset_", stan::model::index_uni(sym1__));
          current_statement__ = 559;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 560;
      stan::math::validate_non_negative_index("prior_scale", "K", K);
      current_statement__ = 561;
      context__.validate_dims("data initialization", "prior_scale", "double",
        std::vector<size_t>{static_cast<size_t>(K)});
      prior_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(K,
                             std::numeric_limits<double>::quiet_NaN());
      new (&prior_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(prior_scale_data__.data(), K);
      {
        std::vector<local_scalar_t__> prior_scale_flat__;
        current_statement__ = 561;
        prior_scale_flat__ = context__.vals_r("prior_scale");
        current_statement__ = 561;
        pos__ = 1;
        current_statement__ = 561;
        for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
          current_statement__ = 561;
          stan::model::assign(prior_scale, prior_scale_flat__[(pos__ - 1)],
            "assigning variable prior_scale", stan::model::index_uni(sym1__));
          current_statement__ = 561;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 561;
      stan::math::check_greater_or_equal(function__, "prior_scale",
        prior_scale, 0);
      current_statement__ = 562;
      context__.validate_dims("data initialization",
        "prior_scale_for_intercept", "double", std::vector<size_t>{});
      prior_scale_for_intercept = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 562;
      prior_scale_for_intercept = context__.vals_r("prior_scale_for_intercept")[(1
        - 1)];
      current_statement__ = 562;
      stan::math::check_greater_or_equal(function__,
        "prior_scale_for_intercept", prior_scale_for_intercept, 0);
      current_statement__ = 563;
      context__.validate_dims("data initialization", "prior_scale_for_aux",
        "double", std::vector<size_t>{});
      prior_scale_for_aux = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 563;
      prior_scale_for_aux = context__.vals_r("prior_scale_for_aux")[(1 - 1)];
      current_statement__ = 563;
      stan::math::check_greater_or_equal(function__, "prior_scale_for_aux",
        prior_scale_for_aux, 0);
      current_statement__ = 564;
      stan::math::validate_non_negative_index("prior_scale_for_smooth",
        "K_smooth > 0 ? max(smooth_map) : 0",
        (stan::math::logical_gt(K_smooth, 0) ? stan::math::max(smooth_map) : 0));
      current_statement__ = 565;
      context__.validate_dims("data initialization",
        "prior_scale_for_smooth", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(K_smooth, 0) ? 
                              stan::math::max(smooth_map) : 0))});
      prior_scale_for_smooth_data__ = Eigen::Matrix<double,-1,1>::Constant((
                                        stan::math::logical_gt(K_smooth, 0) ? 
                                        stan::math::max(smooth_map) : 0),
                                        std::numeric_limits<double>::quiet_NaN(
                                          ));
      new (&prior_scale_for_smooth)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(prior_scale_for_smooth_data__.data(),
        (stan::math::logical_gt(K_smooth, 0) ? stan::math::max(smooth_map) : 0));
      {
        std::vector<local_scalar_t__> prior_scale_for_smooth_flat__;
        current_statement__ = 565;
        prior_scale_for_smooth_flat__ = context__.vals_r("prior_scale_for_smooth");
        current_statement__ = 565;
        pos__ = 1;
        current_statement__ = 565;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(K_smooth, 0) ? stan::math::max(
                                                      smooth_map) : 0); ++sym1__) {
          current_statement__ = 565;
          stan::model::assign(prior_scale_for_smooth,
            prior_scale_for_smooth_flat__[(pos__ - 1)],
            "assigning variable prior_scale_for_smooth",
            stan::model::index_uni(sym1__));
          current_statement__ = 565;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 565;
      stan::math::check_greater_or_equal(function__,
        "prior_scale_for_smooth", prior_scale_for_smooth, 0);
      current_statement__ = 566;
      stan::math::validate_non_negative_index("prior_mean", "K", K);
      current_statement__ = 567;
      context__.validate_dims("data initialization", "prior_mean", "double",
        std::vector<size_t>{static_cast<size_t>(K)});
      prior_mean_data__ = Eigen::Matrix<double,-1,1>::Constant(K,
                            std::numeric_limits<double>::quiet_NaN());
      new (&prior_mean)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(prior_mean_data__.data(), K);
      {
        std::vector<local_scalar_t__> prior_mean_flat__;
        current_statement__ = 567;
        prior_mean_flat__ = context__.vals_r("prior_mean");
        current_statement__ = 567;
        pos__ = 1;
        current_statement__ = 567;
        for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
          current_statement__ = 567;
          stan::model::assign(prior_mean, prior_mean_flat__[(pos__ - 1)],
            "assigning variable prior_mean", stan::model::index_uni(sym1__));
          current_statement__ = 567;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 568;
      context__.validate_dims("data initialization",
        "prior_mean_for_intercept", "double", std::vector<size_t>{});
      prior_mean_for_intercept = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 568;
      prior_mean_for_intercept = context__.vals_r("prior_mean_for_intercept")[(1
        - 1)];
      current_statement__ = 569;
      context__.validate_dims("data initialization", "prior_mean_for_aux",
        "double", std::vector<size_t>{});
      prior_mean_for_aux = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 569;
      prior_mean_for_aux = context__.vals_r("prior_mean_for_aux")[(1 - 1)];
      current_statement__ = 569;
      stan::math::check_greater_or_equal(function__, "prior_mean_for_aux",
        prior_mean_for_aux, 0);
      current_statement__ = 570;
      stan::math::validate_non_negative_index("prior_mean_for_smooth",
        "K_smooth > 0 ? max(smooth_map) : 0",
        (stan::math::logical_gt(K_smooth, 0) ? stan::math::max(smooth_map) : 0));
      current_statement__ = 571;
      context__.validate_dims("data initialization", "prior_mean_for_smooth",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(K_smooth, 0) ? 
                              stan::math::max(smooth_map) : 0))});
      prior_mean_for_smooth_data__ = Eigen::Matrix<double,-1,1>::Constant((
                                       stan::math::logical_gt(K_smooth, 0) ? 
                                       stan::math::max(smooth_map) : 0),
                                       std::numeric_limits<double>::quiet_NaN());
      new (&prior_mean_for_smooth)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(prior_mean_for_smooth_data__.data(),
        (stan::math::logical_gt(K_smooth, 0) ? stan::math::max(smooth_map) : 0));
      {
        std::vector<local_scalar_t__> prior_mean_for_smooth_flat__;
        current_statement__ = 571;
        prior_mean_for_smooth_flat__ = context__.vals_r("prior_mean_for_smooth");
        current_statement__ = 571;
        pos__ = 1;
        current_statement__ = 571;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(K_smooth, 0) ? stan::math::max(
                                                      smooth_map) : 0); ++sym1__) {
          current_statement__ = 571;
          stan::model::assign(prior_mean_for_smooth,
            prior_mean_for_smooth_flat__[(pos__ - 1)],
            "assigning variable prior_mean_for_smooth",
            stan::model::index_uni(sym1__));
          current_statement__ = 571;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 571;
      stan::math::check_greater_or_equal(function__, "prior_mean_for_smooth",
        prior_mean_for_smooth, 0);
      current_statement__ = 572;
      stan::math::validate_non_negative_index("prior_df", "K", K);
      current_statement__ = 573;
      context__.validate_dims("data initialization", "prior_df", "double",
        std::vector<size_t>{static_cast<size_t>(K)});
      prior_df_data__ = Eigen::Matrix<double,-1,1>::Constant(K,
                          std::numeric_limits<double>::quiet_NaN());
      new (&prior_df)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(prior_df_data__.data(), K);
      {
        std::vector<local_scalar_t__> prior_df_flat__;
        current_statement__ = 573;
        prior_df_flat__ = context__.vals_r("prior_df");
        current_statement__ = 573;
        pos__ = 1;
        current_statement__ = 573;
        for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
          current_statement__ = 573;
          stan::model::assign(prior_df, prior_df_flat__[(pos__ - 1)],
            "assigning variable prior_df", stan::model::index_uni(sym1__));
          current_statement__ = 573;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 573;
      stan::math::check_greater_or_equal(function__, "prior_df", prior_df, 0);
      current_statement__ = 574;
      context__.validate_dims("data initialization",
        "prior_df_for_intercept", "double", std::vector<size_t>{});
      prior_df_for_intercept = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 574;
      prior_df_for_intercept = context__.vals_r("prior_df_for_intercept")[(1
        - 1)];
      current_statement__ = 574;
      stan::math::check_greater_or_equal(function__,
        "prior_df_for_intercept", prior_df_for_intercept, 0);
      current_statement__ = 575;
      context__.validate_dims("data initialization", "prior_df_for_aux",
        "double", std::vector<size_t>{});
      prior_df_for_aux = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 575;
      prior_df_for_aux = context__.vals_r("prior_df_for_aux")[(1 - 1)];
      current_statement__ = 575;
      stan::math::check_greater_or_equal(function__, "prior_df_for_aux",
        prior_df_for_aux, 0);
      current_statement__ = 576;
      stan::math::validate_non_negative_index("prior_df_for_smooth",
        "K_smooth > 0 ? max(smooth_map) : 0",
        (stan::math::logical_gt(K_smooth, 0) ? stan::math::max(smooth_map) : 0));
      current_statement__ = 577;
      context__.validate_dims("data initialization", "prior_df_for_smooth",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(K_smooth, 0) ? 
                              stan::math::max(smooth_map) : 0))});
      prior_df_for_smooth_data__ = Eigen::Matrix<double,-1,1>::Constant((
                                     stan::math::logical_gt(K_smooth, 0) ? 
                                     stan::math::max(smooth_map) : 0),
                                     std::numeric_limits<double>::quiet_NaN());
      new (&prior_df_for_smooth)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(prior_df_for_smooth_data__.data(),
        (stan::math::logical_gt(K_smooth, 0) ? stan::math::max(smooth_map) : 0));
      {
        std::vector<local_scalar_t__> prior_df_for_smooth_flat__;
        current_statement__ = 577;
        prior_df_for_smooth_flat__ = context__.vals_r("prior_df_for_smooth");
        current_statement__ = 577;
        pos__ = 1;
        current_statement__ = 577;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(K_smooth, 0) ? stan::math::max(
                                                      smooth_map) : 0); ++sym1__) {
          current_statement__ = 577;
          stan::model::assign(prior_df_for_smooth,
            prior_df_for_smooth_flat__[(pos__ - 1)],
            "assigning variable prior_df_for_smooth",
            stan::model::index_uni(sym1__));
          current_statement__ = 577;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 577;
      stan::math::check_greater_or_equal(function__, "prior_df_for_smooth",
        prior_df_for_smooth, 0);
      current_statement__ = 578;
      context__.validate_dims("data initialization", "global_prior_df",
        "double", std::vector<size_t>{});
      global_prior_df = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 578;
      global_prior_df = context__.vals_r("global_prior_df")[(1 - 1)];
      current_statement__ = 578;
      stan::math::check_greater_or_equal(function__, "global_prior_df",
        global_prior_df, 0);
      current_statement__ = 579;
      context__.validate_dims("data initialization", "global_prior_scale",
        "double", std::vector<size_t>{});
      global_prior_scale = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 579;
      global_prior_scale = context__.vals_r("global_prior_scale")[(1 - 1)];
      current_statement__ = 579;
      stan::math::check_greater_or_equal(function__, "global_prior_scale",
        global_prior_scale, 0);
      current_statement__ = 580;
      context__.validate_dims("data initialization", "slab_df", "double",
        std::vector<size_t>{});
      slab_df = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 580;
      slab_df = context__.vals_r("slab_df")[(1 - 1)];
      current_statement__ = 580;
      stan::math::check_greater_or_equal(function__, "slab_df", slab_df, 0);
      current_statement__ = 581;
      context__.validate_dims("data initialization", "slab_scale", "double",
        std::vector<size_t>{});
      slab_scale = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 581;
      slab_scale = context__.vals_r("slab_scale")[(1 - 1)];
      current_statement__ = 581;
      stan::math::check_greater_or_equal(function__, "slab_scale",
        slab_scale, 0);
      current_statement__ = 582;
      stan::math::validate_non_negative_index("num_normals",
        "prior_dist == 7 ? K : 0",
        (stan::math::logical_eq(prior_dist, 7) ? K : 0));
      current_statement__ = 583;
      context__.validate_dims("data initialization", "num_normals", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(prior_dist, 7) ? K : 0))});
      num_normals = std::vector<int>((stan::math::logical_eq(prior_dist, 7) ? K : 0),
                      std::numeric_limits<int>::min());
      current_statement__ = 583;
      num_normals = context__.vals_i("num_normals");
      current_statement__ = 583;
      stan::math::check_greater_or_equal(function__, "num_normals",
        num_normals, 2);
      current_statement__ = 584;
      context__.validate_dims("data initialization", "t", "int",
        std::vector<size_t>{});
      t = std::numeric_limits<int>::min();
      current_statement__ = 584;
      t = context__.vals_i("t")[(1 - 1)];
      current_statement__ = 584;
      stan::math::check_greater_or_equal(function__, "t", t, 0);
      current_statement__ = 585;
      stan::math::validate_non_negative_index("p", "t", t);
      current_statement__ = 586;
      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__ = 586;
      p = context__.vals_i("p");
      current_statement__ = 586;
      stan::math::check_greater_or_equal(function__, "p", p, 1);
      current_statement__ = 587;
      stan::math::validate_non_negative_index("l", "t", t);
      current_statement__ = 588;
      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__ = 588;
      l = context__.vals_i("l");
      current_statement__ = 588;
      stan::math::check_greater_or_equal(function__, "l", l, 1);
      current_statement__ = 589;
      context__.validate_dims("data initialization", "q", "int",
        std::vector<size_t>{});
      q = std::numeric_limits<int>::min();
      current_statement__ = 589;
      q = context__.vals_i("q")[(1 - 1)];
      current_statement__ = 589;
      stan::math::check_greater_or_equal(function__, "q", q, 0);
      current_statement__ = 590;
      context__.validate_dims("data initialization", "len_theta_L", "int",
        std::vector<size_t>{});
      len_theta_L = std::numeric_limits<int>::min();
      current_statement__ = 590;
      len_theta_L = context__.vals_i("len_theta_L")[(1 - 1)];
      current_statement__ = 590;
      stan::math::check_greater_or_equal(function__, "len_theta_L",
        len_theta_L, 0);
      current_statement__ = 591;
      stan::math::validate_non_negative_index("shape", "t", t);
      current_statement__ = 592;
      context__.validate_dims("data initialization", "shape", "double",
        std::vector<size_t>{static_cast<size_t>(t)});
      shape_data__ = Eigen::Matrix<double,-1,1>::Constant(t,
                       std::numeric_limits<double>::quiet_NaN());
      new (&shape)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(shape_data__.data(), t);
      {
        std::vector<local_scalar_t__> shape_flat__;
        current_statement__ = 592;
        shape_flat__ = context__.vals_r("shape");
        current_statement__ = 592;
        pos__ = 1;
        current_statement__ = 592;
        for (int sym1__ = 1; sym1__ <= t; ++sym1__) {
          current_statement__ = 592;
          stan::model::assign(shape, shape_flat__[(pos__ - 1)],
            "assigning variable shape", stan::model::index_uni(sym1__));
          current_statement__ = 592;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 592;
      stan::math::check_greater_or_equal(function__, "shape", shape, 0);
      current_statement__ = 593;
      stan::math::validate_non_negative_index("scale", "t", t);
      current_statement__ = 594;
      context__.validate_dims("data initialization", "scale", "double",
        std::vector<size_t>{static_cast<size_t>(t)});
      scale_data__ = Eigen::Matrix<double,-1,1>::Constant(t,
                       std::numeric_limits<double>::quiet_NaN());
      new (&scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(scale_data__.data(), t);
      {
        std::vector<local_scalar_t__> scale_flat__;
        current_statement__ = 594;
        scale_flat__ = context__.vals_r("scale");
        current_statement__ = 594;
        pos__ = 1;
        current_statement__ = 594;
        for (int sym1__ = 1; sym1__ <= t; ++sym1__) {
          current_statement__ = 594;
          stan::model::assign(scale, scale_flat__[(pos__ - 1)],
            "assigning variable scale", stan::model::index_uni(sym1__));
          current_statement__ = 594;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 594;
      stan::math::check_greater_or_equal(function__, "scale", scale, 0);
      current_statement__ = 595;
      context__.validate_dims("data initialization", "len_concentration",
        "int", std::vector<size_t>{});
      len_concentration = std::numeric_limits<int>::min();
      current_statement__ = 595;
      len_concentration = context__.vals_i("len_concentration")[(1 - 1)];
      current_statement__ = 595;
      stan::math::check_greater_or_equal(function__, "len_concentration",
        len_concentration, 0);
      current_statement__ = 596;
      stan::math::validate_non_negative_index("concentration",
        "len_concentration", len_concentration);
      current_statement__ = 597;
      context__.validate_dims("data initialization", "concentration",
        "double",
        std::vector<size_t>{static_cast<size_t>(len_concentration)});
      concentration = std::vector<double>(len_concentration,
                        std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 597;
      concentration = context__.vals_r("concentration");
      current_statement__ = 597;
      stan::math::check_greater_or_equal(function__, "concentration",
        concentration, 0);
      current_statement__ = 598;
      context__.validate_dims("data initialization", "len_regularization",
        "int", std::vector<size_t>{});
      len_regularization = std::numeric_limits<int>::min();
      current_statement__ = 598;
      len_regularization = context__.vals_i("len_regularization")[(1 - 1)];
      current_statement__ = 598;
      stan::math::check_greater_or_equal(function__, "len_regularization",
        len_regularization, 0);
      current_statement__ = 599;
      stan::math::validate_non_negative_index("regularization",
        "len_regularization", len_regularization);
      current_statement__ = 600;
      context__.validate_dims("data initialization", "regularization",
        "double",
        std::vector<size_t>{static_cast<size_t>(len_regularization)});
      regularization = std::vector<double>(len_regularization,
                         std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 600;
      regularization = context__.vals_r("regularization");
      current_statement__ = 600;
      stan::math::check_greater_or_equal(function__, "regularization",
        regularization, 0);
      current_statement__ = 601;
      context__.validate_dims("data initialization", "num_non_zero", "int",
        std::vector<size_t>{});
      num_non_zero = std::numeric_limits<int>::min();
      current_statement__ = 601;
      num_non_zero = context__.vals_i("num_non_zero")[(1 - 1)];
      current_statement__ = 601;
      stan::math::check_greater_or_equal(function__, "num_non_zero",
        num_non_zero, 0);
      current_statement__ = 602;
      stan::math::validate_non_negative_index("w", "num_non_zero",
        num_non_zero);
      current_statement__ = 603;
      context__.validate_dims("data initialization", "w", "double",
        std::vector<size_t>{static_cast<size_t>(num_non_zero)});
      w_data__ = Eigen::Matrix<double,-1,1>::Constant(num_non_zero,
                   std::numeric_limits<double>::quiet_NaN());
      new (&w) Eigen::Map<Eigen::Matrix<double,-1,1>>(w_data__.data(),
        num_non_zero);
      {
        std::vector<local_scalar_t__> w_flat__;
        current_statement__ = 603;
        w_flat__ = context__.vals_r("w");
        current_statement__ = 603;
        pos__ = 1;
        current_statement__ = 603;
        for (int sym1__ = 1; sym1__ <= num_non_zero; ++sym1__) {
          current_statement__ = 603;
          stan::model::assign(w, w_flat__[(pos__ - 1)],
            "assigning variable w", stan::model::index_uni(sym1__));
          current_statement__ = 603;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 604;
      stan::math::validate_non_negative_index("v", "num_non_zero",
        num_non_zero);
      current_statement__ = 605;
      context__.validate_dims("data initialization", "v", "int",
        std::vector<size_t>{static_cast<size_t>(num_non_zero)});
      v = std::vector<int>(num_non_zero, std::numeric_limits<int>::min());
      current_statement__ = 605;
      v = context__.vals_i("v");
      current_statement__ = 605;
      stan::math::check_greater_or_equal(function__, "v", v, 0);
      current_statement__ = 605;
      stan::math::check_less_or_equal(function__, "v", v, (q - 1));
      current_statement__ = 606;
      stan::math::validate_non_negative_index("u", "t > 0 ? N + 1 : 0",
        (stan::math::logical_gt(t, 0) ? (N + 1) : 0));
      current_statement__ = 607;
      context__.validate_dims("data initialization", "u", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(t, 0) ? (N + 1) : 0))});
      u = std::vector<int>((stan::math::logical_gt(t, 0) ? (N + 1) : 0),
            std::numeric_limits<int>::min());
      current_statement__ = 607;
      u = context__.vals_i("u");
      current_statement__ = 607;
      stan::math::check_greater_or_equal(function__, "u", u, 0);
      current_statement__ = 607;
      stan::math::check_less_or_equal(function__, "u", u,
        (stan::math::rows(w) + 1));
      current_statement__ = 608;
      context__.validate_dims("data initialization", "special_case", "int",
        std::vector<size_t>{});
      special_case = std::numeric_limits<int>::min();
      current_statement__ = 608;
      special_case = context__.vals_i("special_case")[(1 - 1)];
      current_statement__ = 608;
      stan::math::check_greater_or_equal(function__, "special_case",
        special_case, 0);
      current_statement__ = 608;
      stan::math::check_less_or_equal(function__, "special_case",
        special_case, 1);
      current_statement__ = 609;
      context__.validate_dims("data initialization", "has_intercept_z",
        "int", std::vector<size_t>{});
      has_intercept_z = std::numeric_limits<int>::min();
      current_statement__ = 609;
      has_intercept_z = context__.vals_i("has_intercept_z")[(1 - 1)];
      current_statement__ = 609;
      stan::math::check_greater_or_equal(function__, "has_intercept_z",
        has_intercept_z, 0);
      current_statement__ = 609;
      stan::math::check_less_or_equal(function__, "has_intercept_z",
        has_intercept_z, 1);
      current_statement__ = 610;
      context__.validate_dims("data initialization", "link_phi", "int",
        std::vector<size_t>{});
      link_phi = std::numeric_limits<int>::min();
      current_statement__ = 610;
      link_phi = context__.vals_i("link_phi")[(1 - 1)];
      current_statement__ = 610;
      stan::math::check_greater_or_equal(function__, "link_phi", link_phi, 0);
      current_statement__ = 611;
      context__.validate_dims("data initialization", "z_dim", "int",
        std::vector<size_t>{});
      z_dim = std::numeric_limits<int>::min();
      current_statement__ = 611;
      z_dim = context__.vals_i("z_dim")[(1 - 1)];
      current_statement__ = 611;
      stan::math::check_greater_or_equal(function__, "z_dim", z_dim, 0);
      current_statement__ = 612;
      stan::math::validate_non_negative_index("betareg_z", "N", N);
      current_statement__ = 613;
      stan::math::validate_non_negative_index("betareg_z", "z_dim", z_dim);
      current_statement__ = 614;
      context__.validate_dims("data initialization", "betareg_z", "double",
        std::vector<size_t>{static_cast<size_t>(N),
          static_cast<size_t>(z_dim)});
      betareg_z_data__ = Eigen::Matrix<double,-1,-1>::Constant(N, z_dim,
                           std::numeric_limits<double>::quiet_NaN());
      new (&betareg_z)
        Eigen::Map<Eigen::Matrix<double,-1,-1>>(betareg_z_data__.data(), N,
        z_dim);
      {
        std::vector<local_scalar_t__> betareg_z_flat__;
        current_statement__ = 614;
        betareg_z_flat__ = context__.vals_r("betareg_z");
        current_statement__ = 614;
        pos__ = 1;
        current_statement__ = 614;
        for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
          current_statement__ = 614;
          for (int sym2__ = 1; sym2__ <= N; ++sym2__) {
            current_statement__ = 614;
            stan::model::assign(betareg_z, betareg_z_flat__[(pos__ - 1)],
              "assigning variable betareg_z", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 614;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 615;
      stan::math::validate_non_negative_index("zbar", "z_dim", z_dim);
      current_statement__ = 616;
      context__.validate_dims("data initialization", "zbar", "double",
        std::vector<size_t>{static_cast<size_t>(z_dim)});
      zbar_data__ = Eigen::Matrix<double,1,-1>::Constant(z_dim,
                      std::numeric_limits<double>::quiet_NaN());
      new (&zbar) Eigen::Map<Eigen::Matrix<double,1,-1>>(zbar_data__.data(),
        z_dim);
      {
        std::vector<local_scalar_t__> zbar_flat__;
        current_statement__ = 616;
        zbar_flat__ = context__.vals_r("zbar");
        current_statement__ = 616;
        pos__ = 1;
        current_statement__ = 616;
        for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
          current_statement__ = 616;
          stan::model::assign(zbar, zbar_flat__[(pos__ - 1)],
            "assigning variable zbar", stan::model::index_uni(sym1__));
          current_statement__ = 616;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 617;
      context__.validate_dims("data initialization", "prior_dist_z", "int",
        std::vector<size_t>{});
      prior_dist_z = std::numeric_limits<int>::min();
      current_statement__ = 617;
      prior_dist_z = context__.vals_i("prior_dist_z")[(1 - 1)];
      current_statement__ = 617;
      stan::math::check_greater_or_equal(function__, "prior_dist_z",
        prior_dist_z, 0);
      current_statement__ = 617;
      stan::math::check_less_or_equal(function__, "prior_dist_z",
        prior_dist_z, 7);
      current_statement__ = 618;
      context__.validate_dims("data initialization",
        "prior_dist_for_intercept_z", "int", std::vector<size_t>{});
      prior_dist_for_intercept_z = std::numeric_limits<int>::min();
      current_statement__ = 618;
      prior_dist_for_intercept_z = context__.vals_i("prior_dist_for_intercept_z")[(1
        - 1)];
      current_statement__ = 618;
      stan::math::check_greater_or_equal(function__,
        "prior_dist_for_intercept_z", prior_dist_for_intercept_z, 0);
      current_statement__ = 618;
      stan::math::check_less_or_equal(function__,
        "prior_dist_for_intercept_z", prior_dist_for_intercept_z, 2);
      current_statement__ = 619;
      stan::math::validate_non_negative_index("prior_scale_z", "z_dim", z_dim);
      current_statement__ = 620;
      context__.validate_dims("data initialization", "prior_scale_z",
        "double", std::vector<size_t>{static_cast<size_t>(z_dim)});
      prior_scale_z_data__ = Eigen::Matrix<double,-1,1>::Constant(z_dim,
                               std::numeric_limits<double>::quiet_NaN());
      new (&prior_scale_z)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(prior_scale_z_data__.data(),
        z_dim);
      {
        std::vector<local_scalar_t__> prior_scale_z_flat__;
        current_statement__ = 620;
        prior_scale_z_flat__ = context__.vals_r("prior_scale_z");
        current_statement__ = 620;
        pos__ = 1;
        current_statement__ = 620;
        for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
          current_statement__ = 620;
          stan::model::assign(prior_scale_z, prior_scale_z_flat__[(pos__ -
            1)], "assigning variable prior_scale_z",
            stan::model::index_uni(sym1__));
          current_statement__ = 620;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 620;
      stan::math::check_greater_or_equal(function__, "prior_scale_z",
        prior_scale_z, 0);
      current_statement__ = 621;
      context__.validate_dims("data initialization",
        "prior_scale_for_intercept_z", "double", std::vector<size_t>{});
      prior_scale_for_intercept_z = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 621;
      prior_scale_for_intercept_z = context__.vals_r("prior_scale_for_intercept_z")[(1
        - 1)];
      current_statement__ = 621;
      stan::math::check_greater_or_equal(function__,
        "prior_scale_for_intercept_z", prior_scale_for_intercept_z, 0);
      current_statement__ = 622;
      stan::math::validate_non_negative_index("prior_mean_z", "z_dim", z_dim);
      current_statement__ = 623;
      context__.validate_dims("data initialization", "prior_mean_z",
        "double", std::vector<size_t>{static_cast<size_t>(z_dim)});
      prior_mean_z_data__ = Eigen::Matrix<double,-1,1>::Constant(z_dim,
                              std::numeric_limits<double>::quiet_NaN());
      new (&prior_mean_z)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(prior_mean_z_data__.data(),
        z_dim);
      {
        std::vector<local_scalar_t__> prior_mean_z_flat__;
        current_statement__ = 623;
        prior_mean_z_flat__ = context__.vals_r("prior_mean_z");
        current_statement__ = 623;
        pos__ = 1;
        current_statement__ = 623;
        for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
          current_statement__ = 623;
          stan::model::assign(prior_mean_z, prior_mean_z_flat__[(pos__ - 1)],
            "assigning variable prior_mean_z", stan::model::index_uni(sym1__));
          current_statement__ = 623;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 624;
      context__.validate_dims("data initialization",
        "prior_mean_for_intercept_z", "double", std::vector<size_t>{});
      prior_mean_for_intercept_z = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 624;
      prior_mean_for_intercept_z = context__.vals_r("prior_mean_for_intercept_z")[(1
        - 1)];
      current_statement__ = 625;
      stan::math::validate_non_negative_index("prior_df_z", "z_dim", z_dim);
      current_statement__ = 626;
      context__.validate_dims("data initialization", "prior_df_z", "double",
        std::vector<size_t>{static_cast<size_t>(z_dim)});
      prior_df_z_data__ = Eigen::Matrix<double,-1,1>::Constant(z_dim,
                            std::numeric_limits<double>::quiet_NaN());
      new (&prior_df_z)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(prior_df_z_data__.data(),
        z_dim);
      {
        std::vector<local_scalar_t__> prior_df_z_flat__;
        current_statement__ = 626;
        prior_df_z_flat__ = context__.vals_r("prior_df_z");
        current_statement__ = 626;
        pos__ = 1;
        current_statement__ = 626;
        for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
          current_statement__ = 626;
          stan::model::assign(prior_df_z, prior_df_z_flat__[(pos__ - 1)],
            "assigning variable prior_df_z", stan::model::index_uni(sym1__));
          current_statement__ = 626;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 626;
      stan::math::check_greater_or_equal(function__, "prior_df_z",
        prior_df_z, 0);
      current_statement__ = 627;
      context__.validate_dims("data initialization",
        "prior_df_for_intercept_z", "double", std::vector<size_t>{});
      prior_df_for_intercept_z = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 627;
      prior_df_for_intercept_z = context__.vals_r("prior_df_for_intercept_z")[(1
        - 1)];
      current_statement__ = 627;
      stan::math::check_greater_or_equal(function__,
        "prior_df_for_intercept_z", prior_df_for_intercept_z, 0);
      current_statement__ = 628;
      context__.validate_dims("data initialization", "global_prior_scale_z",
        "double", std::vector<size_t>{});
      global_prior_scale_z = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 628;
      global_prior_scale_z = context__.vals_r("global_prior_scale_z")[(1 -
        1)];
      current_statement__ = 628;
      stan::math::check_greater_or_equal(function__, "global_prior_scale_z",
        global_prior_scale_z, 0);
      current_statement__ = 629;
      context__.validate_dims("data initialization", "global_prior_df_z",
        "double", std::vector<size_t>{});
      global_prior_df_z = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 629;
      global_prior_df_z = context__.vals_r("global_prior_df_z")[(1 - 1)];
      current_statement__ = 629;
      stan::math::check_greater_or_equal(function__, "global_prior_df_z",
        global_prior_df_z, 0);
      current_statement__ = 630;
      context__.validate_dims("data initialization", "slab_df_z", "double",
        std::vector<size_t>{});
      slab_df_z = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 630;
      slab_df_z = context__.vals_r("slab_df_z")[(1 - 1)];
      current_statement__ = 630;
      stan::math::check_greater_or_equal(function__, "slab_df_z", slab_df_z,
        0);
      current_statement__ = 631;
      context__.validate_dims("data initialization", "slab_scale_z",
        "double", std::vector<size_t>{});
      slab_scale_z = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 631;
      slab_scale_z = context__.vals_r("slab_scale_z")[(1 - 1)];
      current_statement__ = 631;
      stan::math::check_greater_or_equal(function__, "slab_scale_z",
        slab_scale_z, 0);
      current_statement__ = 632;
      stan::math::validate_non_negative_index("num_normals_z",
        "prior_dist_z == 7 ? z_dim : 0",
        (stan::math::logical_eq(prior_dist_z, 7) ? z_dim : 0));
      current_statement__ = 633;
      context__.validate_dims("data initialization", "num_normals_z", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(prior_dist_z, 7) ? z_dim : 0))});
      num_normals_z = std::vector<int>((stan::math::logical_eq(prior_dist_z,
                                          7) ? z_dim : 0),
                        std::numeric_limits<int>::min());
      current_statement__ = 633;
      num_normals_z = context__.vals_i("num_normals_z");
      current_statement__ = 633;
      stan::math::check_greater_or_equal(function__, "num_normals_z",
        num_normals_z, 2);
      current_statement__ = 634;
      context__.validate_dims("data initialization", "SSfun", "int",
        std::vector<size_t>{});
      SSfun = std::numeric_limits<int>::min();
      current_statement__ = 634;
      SSfun = context__.vals_i("SSfun")[(1 - 1)];
      current_statement__ = 634;
      stan::math::check_greater_or_equal(function__, "SSfun", SSfun, 0);
      current_statement__ = 634;
      stan::math::check_less_or_equal(function__, "SSfun", SSfun, 10);
      current_statement__ = 635;
      stan::math::validate_non_negative_index("input",
        "SSfun > 0 ? len_y : 0",
        (stan::math::logical_gt(SSfun, 0) ? len_y : 0));
      current_statement__ = 636;
      context__.validate_dims("data initialization", "input", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(SSfun, 0) ? len_y : 0))});
      input_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                             SSfun, 0) ? len_y : 0),
                       std::numeric_limits<double>::quiet_NaN());
      new (&input)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(input_data__.data(),
        (stan::math::logical_gt(SSfun, 0) ? len_y : 0));
      {
        std::vector<local_scalar_t__> input_flat__;
        current_statement__ = 636;
        input_flat__ = context__.vals_r("input");
        current_statement__ = 636;
        pos__ = 1;
        current_statement__ = 636;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(SSfun, 0) ? len_y : 0); ++sym1__) {
          current_statement__ = 636;
          stan::model::assign(input, input_flat__[(pos__ - 1)],
            "assigning variable input", stan::model::index_uni(sym1__));
          current_statement__ = 636;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 637;
      stan::math::validate_non_negative_index("Dose",
        "SSfun == 5 ? len_y : 0",
        (stan::math::logical_eq(SSfun, 5) ? len_y : 0));
      current_statement__ = 638;
      context__.validate_dims("data initialization", "Dose", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(SSfun, 5) ? len_y : 0))});
      Dose_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_eq(
                                                            SSfun, 5) ? len_y : 0),
                      std::numeric_limits<double>::quiet_NaN());
      new (&Dose) Eigen::Map<Eigen::Matrix<double,-1,1>>(Dose_data__.data(),
        (stan::math::logical_eq(SSfun, 5) ? len_y : 0));
      {
        std::vector<local_scalar_t__> Dose_flat__;
        current_statement__ = 638;
        Dose_flat__ = context__.vals_r("Dose");
        current_statement__ = 638;
        pos__ = 1;
        current_statement__ = 638;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_eq(SSfun, 5) ? len_y : 0); ++sym1__) {
          current_statement__ = 638;
          stan::model::assign(Dose, Dose_flat__[(pos__ - 1)],
            "assigning variable Dose", stan::model::index_uni(sym1__));
          current_statement__ = 638;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 639;
      stan::math::validate_non_negative_index("sqrt_y",
        "family == 3 ? len_y : 0",
        (stan::math::logical_eq(family, 3) ? len_y : 0));
      current_statement__ = 640;
      sqrt_y_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_eq(
                                                              family, 3) ? len_y : 0),
                        std::numeric_limits<double>::quiet_NaN());
      new (&sqrt_y)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(sqrt_y_data__.data(),
        (stan::math::logical_eq(family, 3) ? len_y : 0));
      current_statement__ = 641;
      stan::math::validate_non_negative_index("log_y",
        "family == 3 ? len_y : 0",
        (stan::math::logical_eq(family, 3) ? len_y : 0));
      current_statement__ = 642;
      log_y_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_eq(
                                                             family, 3) ? len_y : 0),
                       std::numeric_limits<double>::quiet_NaN());
      new (&log_y)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(log_y_data__.data(),
        (stan::math::logical_eq(family, 3) ? len_y : 0));
      current_statement__ = 643;
      sum_log_y = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 643;
      sum_log_y = (stan::math::logical_eq(family, 1) ? stan::math::not_a_number(
                                                         ) : stan::math::sum(
                                                               stan::math::log(
                                                                 y)));
      current_statement__ = 644;
      stan::math::validate_non_negative_index("V", "special_case ? t : 0",
        (special_case ? t : 0));
      current_statement__ = 645;
      stan::math::validate_non_negative_index("V", "len_y", len_y);
      current_statement__ = 646;
      V = std::vector<std::vector<int>>((special_case ? t : 0),
            std::vector<int>(len_y, std::numeric_limits<int>::min()));
      current_statement__ = 646;
      stan::model::assign(V,
        make_V(len_y, (special_case ? t : 0), v, pstream__),
        "assigning variable V");
      current_statement__ = 647;
      hs_z = std::numeric_limits<int>::min();
      current_statement__ = 648;
      can_do_OLS = std::numeric_limits<int>::min();
      current_statement__ = 648;
      can_do_OLS = (stan::math::primitive_value(
                      (stan::math::primitive_value(
                         (stan::math::primitive_value(
                            (stan::math::primitive_value(
                               (stan::math::primitive_value(
                                  (stan::math::primitive_value(
                                     (stan::math::primitive_value(
                                        (stan::math::primitive_value(
                                           stan::math::logical_eq(family, 1))
                                        &&
                                        stan::math::primitive_value(
                                          stan::math::logical_eq(link, 1))))
                                     &&
                                     stan::math::primitive_value(
                                       stan::math::logical_eq(SSfun, 0)))) &&
                                  stan::math::primitive_value(
                                    stan::math::logical_eq(has_offset, 0))))
                               &&
                               stan::math::primitive_value(
                                 stan::math::logical_eq(t, 0)))) &&
                            stan::math::primitive_value(
                              stan::math::logical_eq(prior_PD, 0)))) &&
                         stan::math::primitive_value(dense_X))) &&
                      stan::math::primitive_value(
                        stan::math::logical_gt(N, 2))))
        &&
        stan::math::primitive_value(
          stan::math::logical_gte(len_y, ((has_intercept + K) + K_smooth))));
      current_statement__ = 649;
      stan::math::validate_non_negative_index("OLS",
        "can_do_OLS ? has_intercept + K + K_smooth : 0",
        (can_do_OLS ? ((has_intercept + K) + K_smooth) : 0));
      current_statement__ = 650;
      OLS_data__ = Eigen::Matrix<double,-1,1>::Constant((can_do_OLS ? ((has_intercept
                     + K) + K_smooth) : 0),
                     std::numeric_limits<double>::quiet_NaN());
      new (&OLS) Eigen::Map<Eigen::Matrix<double,-1,1>>(OLS_data__.data(),
        (can_do_OLS ? ((has_intercept + K) + K_smooth) : 0));
      current_statement__ = 651;
      stan::math::validate_non_negative_index("XtX",
        "can_do_OLS ? has_intercept + K + K_smooth : 0",
        (can_do_OLS ? ((has_intercept + K) + K_smooth) : 0));
      current_statement__ = 652;
      stan::math::validate_non_negative_index("XtX",
        "can_do_OLS ? has_intercept + K + K_smooth : 0",
        (can_do_OLS ? ((has_intercept + K) + K_smooth) : 0));
      current_statement__ = 653;
      XtX_data__ = Eigen::Matrix<double,-1,-1>::Constant((can_do_OLS ? ((has_intercept
                     + K) + K_smooth) : 0), (can_do_OLS ? ((has_intercept +
                     K) + K_smooth) : 0),
                     std::numeric_limits<double>::quiet_NaN());
      new (&XtX) Eigen::Map<Eigen::Matrix<double,-1,-1>>(XtX_data__.data(),
        (can_do_OLS ? ((has_intercept + K) + K_smooth) : 0),
        (can_do_OLS ? ((has_intercept + K) + K_smooth) : 0));
      current_statement__ = 654;
      can_do_normalidglm = std::numeric_limits<int>::min();
      current_statement__ = 654;
      can_do_normalidglm = (stan::math::primitive_value(
                              (stan::math::primitive_value(
                                 (stan::math::primitive_value(
                                    (stan::math::primitive_value(
                                       (stan::math::primitive_value(
                                          (stan::math::primitive_value(
                                             (stan::math::primitive_value(
                                                (stan::math::primitive_value(
                                                   (stan::math::primitive_value(
                                                      stan::math::logical_neq(
                                                        K, 0)) &&
                                                   stan::math::primitive_value(
                                                     stan::math::logical_eq(
                                                       can_do_OLS, 0)))) &&
                                                stan::math::primitive_value(
                                                  stan::math::logical_eq(
                                                    family, 1)))) &&
                                             stan::math::primitive_value(
                                               stan::math::logical_eq(link, 1))))
                                          &&
                                          stan::math::primitive_value(
                                            stan::math::logical_eq(SSfun, 0))))
                                       &&
                                       stan::math::primitive_value(
                                         stan::math::logical_eq(has_offset, 0))))
                                    && stan::math::primitive_value(dense_X)))
                                 &&
                                 stan::math::primitive_value(
                                   stan::math::logical_eq(prior_PD, 0)))) &&
                              stan::math::primitive_value(
                                stan::math::logical_eq(t, 0))))
        &&
        stan::math::primitive_value(
          stan::math::logical_lt(len_y, ((has_intercept + K) + K_smooth))));
      current_statement__ = 655;
      stan::math::validate_non_negative_index("XS",
        "can_do_normalidglm ? N : 0", (can_do_normalidglm ? N : 0));
      current_statement__ = 656;
      stan::math::validate_non_negative_index("XS",
        "can_do_normalidglm ? K + K_smooth : 0", (can_do_normalidglm ? (K +
        K_smooth) : 0));
      current_statement__ = 657;
      XS_data__ = Eigen::Matrix<double,-1,-1>::Constant((can_do_normalidglm ? N : 0),
                    (can_do_normalidglm ? (K + K_smooth) : 0),
                    std::numeric_limits<double>::quiet_NaN());
      new (&XS) Eigen::Map<Eigen::Matrix<double,-1,-1>>(XS_data__.data(),
        (can_do_normalidglm ? N : 0), (can_do_normalidglm ? (K +
        K_smooth) : 0));
      current_statement__ = 658;
      SSR = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 658;
      SSR = stan::math::not_a_number();
      current_statement__ = 659;
      len_z_T = std::numeric_limits<int>::min();
      current_statement__ = 659;
      len_z_T = 0;
      current_statement__ = 660;
      len_var_group = std::numeric_limits<int>::min();
      current_statement__ = 660;
      len_var_group = (stan::math::sum(p) * stan::math::logical_gt(t, 0));
      current_statement__ = 661;
      len_rho = std::numeric_limits<int>::min();
      current_statement__ = 661;
      len_rho = (stan::math::sum(p) - t);
      current_statement__ = 662;
      is_continuous = std::numeric_limits<int>::min();
      current_statement__ = 662;
      is_continuous = 0;
      current_statement__ = 663;
      pos = std::numeric_limits<int>::min();
      current_statement__ = 663;
      pos = 1;
      current_statement__ = 664;
      stan::math::validate_non_negative_index("delta", "len_concentration",
        len_concentration);
      current_statement__ = 665;
      delta = std::vector<double>(len_concentration,
                std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 666;
      hs = std::numeric_limits<int>::min();
      current_statement__ = 673;
      if (stan::math::logical_lte(prior_dist, 2)) {
        current_statement__ = 672;
        hs = 0;
      } else {
        current_statement__ = 671;
        if (stan::math::logical_eq(prior_dist, 3)) {
          current_statement__ = 670;
          hs = 2;
        } else {
          current_statement__ = 669;
          if (stan::math::logical_eq(prior_dist, 4)) {
            current_statement__ = 668;
            hs = 4;
          } else {
            current_statement__ = 667;
            hs = 0;
          }
        }
      }
      current_statement__ = 683;
      for (int i = 1; i <= t; ++i) {
        current_statement__ = 679;
        if (stan::math::logical_gt(
              stan::model::rvalue(p, "p", stan::model::index_uni(i)), 1)) {
          current_statement__ = 677;
          for (int j = 1; j <=
               stan::model::rvalue(p, "p", stan::model::index_uni(i)); ++j) {
            current_statement__ = 674;
            stan::model::assign(delta,
              stan::model::rvalue(concentration, "concentration",
                stan::model::index_uni(j)), "assigning variable delta",
              stan::model::index_uni(pos));
            current_statement__ = 675;
            pos = (pos + 1);
          }
        }
        current_statement__ = 681;
        for (int j = 3; j <=
             stan::model::rvalue(p, "p", stan::model::index_uni(i)); ++j) {
          current_statement__ = 680;
          len_z_T = (len_z_T +
            (stan::model::rvalue(p, "p", stan::model::index_uni(i)) - 1));
        }
      }
      current_statement__ = 690;
      if (stan::math::logical_lte(prior_dist_z, 2)) {
        current_statement__ = 689;
        hs_z = 0;
      } else {
        current_statement__ = 688;
        if (stan::math::logical_eq(prior_dist_z, 3)) {
          current_statement__ = 687;
          hs_z = 2;
        } else {
          current_statement__ = 686;
          if (stan::math::logical_eq(prior_dist_z, 4)) {
            current_statement__ = 685;
            hs_z = 4;
          } else {
            current_statement__ = 684;
            hs_z = 0;
          }
        }
      }
      current_statement__ = 691;
      is_continuous = 1;
      current_statement__ = 695;
      if (stan::math::logical_eq(family, 3)) {
        current_statement__ = 692;
        stan::model::assign(sqrt_y, stan::math::sqrt(y),
          "assigning variable sqrt_y");
        current_statement__ = 693;
        stan::model::assign(log_y, stan::math::log(y),
          "assigning variable log_y");
      }
      current_statement__ = 703;
      if (can_do_OLS) {
        current_statement__ = 696;
        stan::math::validate_non_negative_index("X_", "N", N);
        current_statement__ = 697;
        stan::math::validate_non_negative_index("X_",
          "has_intercept + K + K_smooth", ((has_intercept + K) + K_smooth));
        Eigen::Matrix<double,-1,-1> X_ =
          Eigen::Matrix<double,-1,-1>::Constant(N, ((has_intercept + K) +
            K_smooth), std::numeric_limits<double>::quiet_NaN());
        current_statement__ = 698;
        stan::model::assign(X_,
          (has_intercept ? stan::math::eval(
                             stan::math::append_col(
                               stan::math::rep_vector(1.0, N),
                               (stan::math::logical_gt(K_smooth, 0) ? 
                               stan::math::eval(
                                 stan::math::append_col(
                                   stan::model::rvalue(X, "X",
                                     stan::model::index_uni(1)), S)) : 
                               stan::math::eval(
                                 stan::model::rvalue(X, "X",
                                   stan::model::index_uni(1)))))) : stan::math::eval(
                                                                    (stan::math::logical_gt(
                                                                    K_smooth,
                                                                    0) ? 
                                                                    stan::math::eval(
                                                                    stan::math::append_col(
                                                                    stan::model::rvalue(
                                                                    X, "X",
                                                                    stan::model::index_uni(
                                                                    1)), S)) : 
                                                                    stan::math::eval(
                                                                    stan::model::rvalue(
                                                                    X, "X",
                                                                    stan::model::index_uni(
                                                                    1)))))),
          "assigning variable X_");
        current_statement__ = 699;
        stan::model::assign(XtX, stan::math::crossprod(X_),
          "assigning variable XtX");
        current_statement__ = 700;
        stan::model::assign(OLS, CODOLS(X_, y, pstream__),
          "assigning variable OLS");
        current_statement__ = 701;
        SSR = stan::math::dot_self(
                stan::math::subtract(y, stan::math::multiply(X_, OLS)));
      }
      current_statement__ = 706;
      if (can_do_normalidglm) {
        current_statement__ = 704;
        stan::model::assign(XS,
          (stan::math::logical_gt(K_smooth, 0) ? stan::math::eval(
                                                   stan::math::append_col(
                                                     stan::model::rvalue(X,
                                                       "X",
                                                       stan::model::index_uni(
                                                         1)), S)) : stan::math::eval(
                                                                    stan::model::rvalue(
                                                                    X, "X",
                                                                    stan::model::index_uni(
                                                                    1)))),
          "assigning variable XS");
      }
      current_statement__ = 646;
      stan::math::check_greater_or_equal(function__, "V", V, 1);
      current_statement__ = 647;
      stan::math::check_greater_or_equal(function__, "hs_z", hs_z, 0);
      current_statement__ = 659;
      stan::math::check_greater_or_equal(function__, "len_z_T", len_z_T, 0);
      current_statement__ = 660;
      stan::math::check_greater_or_equal(function__, "len_var_group",
        len_var_group, 0);
      current_statement__ = 661;
      stan::math::check_greater_or_equal(function__, "len_rho", len_rho, 0);
      current_statement__ = 662;
      stan::math::check_greater_or_equal(function__, "is_continuous",
        is_continuous, 0);
      current_statement__ = 662;
      stan::math::check_less_or_equal(function__, "is_continuous",
        is_continuous, 1);
      current_statement__ = 663;
      stan::math::check_greater_or_equal(function__, "pos", pos, 1);
      current_statement__ = 665;
      stan::math::check_greater_or_equal(function__, "delta", delta, 0);
      current_statement__ = 666;
      stan::math::check_greater_or_equal(function__, "hs", hs, 0);
      current_statement__ = 707;
      stan::math::validate_non_negative_index("gamma", "has_intercept",
        has_intercept);
      current_statement__ = 708;
      z_beta_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 708;
      z_beta_1dim__ = (stan::math::logical_eq(prior_dist, 7) ? stan::math::sum(
                                                                 num_normals) : K);
      current_statement__ = 708;
      stan::math::validate_non_negative_index("z_beta",
        "prior_dist == 7 ? sum(num_normals) : K", z_beta_1dim__);
      current_statement__ = 709;
      stan::math::validate_non_negative_index("z_beta_smooth", "K_smooth",
        K_smooth);
      current_statement__ = 710;
      smooth_sd_raw_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 710;
      smooth_sd_raw_1dim__ = (stan::math::logical_gt(K_smooth, 0) ? stan::model::rvalue(
                                                                    smooth_map,
                                                                    "smooth_map",
                                                                    stan::model::index_uni(
                                                                    K_smooth)) : 0);
      current_statement__ = 710;
      stan::math::validate_non_negative_index("smooth_sd_raw",
        "K_smooth > 0 ? smooth_map[K_smooth] : 0", smooth_sd_raw_1dim__);
      current_statement__ = 711;
      stan::math::validate_non_negative_index("global", "hs", hs);
      current_statement__ = 712;
      stan::math::validate_non_negative_index("local", "hs", hs);
      current_statement__ = 713;
      stan::math::validate_non_negative_index("local", "K", K);
      current_statement__ = 714;
      caux_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 714;
      caux_1dim__ = stan::math::logical_gt(hs, 0);
      current_statement__ = 714;
      stan::math::validate_non_negative_index("caux", "hs > 0", caux_1dim__);
      current_statement__ = 715;
      mix_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 715;
      mix_1dim__ = (stan::math::primitive_value(
                      stan::math::logical_eq(prior_dist, 5))
        ||
        stan::math::primitive_value(stan::math::logical_eq(prior_dist, 6)));
      current_statement__ = 715;
      stan::math::validate_non_negative_index("mix",
        "prior_dist == 5 || prior_dist == 6", mix_1dim__);
      current_statement__ = 716;
      stan::math::validate_non_negative_index("mix", "K", K);
      current_statement__ = 717;
      one_over_lambda_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 717;
      one_over_lambda_1dim__ = stan::math::logical_eq(prior_dist, 6);
      current_statement__ = 717;
      stan::math::validate_non_negative_index("one_over_lambda",
        "prior_dist == 6", one_over_lambda_1dim__);
      current_statement__ = 718;
      stan::math::validate_non_negative_index("z_b", "q", q);
      current_statement__ = 719;
      stan::math::validate_non_negative_index("z_T", "len_z_T", len_z_T);
      current_statement__ = 720;
      stan::math::validate_non_negative_index("rho", "len_rho", len_rho);
      current_statement__ = 721;
      stan::math::validate_non_negative_index("zeta", "len_concentration",
        len_concentration);
      current_statement__ = 722;
      stan::math::validate_non_negative_index("tau", "t", t);
      current_statement__ = 723;
      z_omega_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 723;
      z_omega_1dim__ = (stan::math::logical_eq(prior_dist_z, 7) ? stan::math::sum(
                                                                    num_normals_z) : z_dim);
      current_statement__ = 723;
      stan::math::validate_non_negative_index("z_omega",
        "prior_dist_z == 7 ? sum(num_normals_z) : z_dim", z_omega_1dim__);
      current_statement__ = 724;
      stan::math::validate_non_negative_index("gamma_z", "has_intercept_z",
        has_intercept_z);
      current_statement__ = 725;
      stan::math::validate_non_negative_index("global_z", "hs_z", hs_z);
      current_statement__ = 726;
      stan::math::validate_non_negative_index("local_z", "hs_z", hs_z);
      current_statement__ = 727;
      stan::math::validate_non_negative_index("local_z", "z_dim", z_dim);
      current_statement__ = 728;
      caux_z_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 728;
      caux_z_1dim__ = stan::math::logical_gt(hs_z, 0);
      current_statement__ = 728;
      stan::math::validate_non_negative_index("caux_z", "hs_z > 0",
        caux_z_1dim__);
      current_statement__ = 729;
      S_z_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 729;
      S_z_1dim__ = (stan::math::primitive_value(
                      stan::math::logical_eq(prior_dist_z, 5))
        ||
        stan::math::primitive_value(stan::math::logical_eq(prior_dist_z, 6)));
      current_statement__ = 729;
      stan::math::validate_non_negative_index("S_z",
        "prior_dist_z == 5 || prior_dist_z == 6", S_z_1dim__);
      current_statement__ = 730;
      stan::math::validate_non_negative_index("S_z", "z_dim", z_dim);
      current_statement__ = 731;
      one_over_lambda_z_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 731;
      one_over_lambda_z_1dim__ = stan::math::logical_eq(prior_dist_z, 6);
      current_statement__ = 731;
      stan::math::validate_non_negative_index("one_over_lambda_z",
        "prior_dist_z == 6", one_over_lambda_z_1dim__);
      current_statement__ = 732;
      stan::math::validate_non_negative_index("omega", "z_dim", z_dim);
      current_statement__ = 733;
      stan::math::validate_non_negative_index("beta", "K", K);
      current_statement__ = 734;
      stan::math::validate_non_negative_index("beta_smooth", "K_smooth",
        K_smooth);
      current_statement__ = 735;
      smooth_sd_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 735;
      smooth_sd_1dim__ = (stan::math::logical_gt(K_smooth, 0) ? stan::model::rvalue(
                                                                  smooth_map,
                                                                  "smooth_map",
                                                                  stan::model::index_uni(
                                                                    K_smooth)) : 0);
      current_statement__ = 735;
      stan::math::validate_non_negative_index("smooth_sd",
        "K_smooth > 0 ? smooth_map[K_smooth] : 0", smooth_sd_1dim__);
      current_statement__ = 736;
      stan::math::validate_non_negative_index("b", "q", q);
      current_statement__ = 737;
      stan::math::validate_non_negative_index("theta_L", "len_theta_L",
        len_theta_L);
      current_statement__ = 738;
      stan::math::validate_non_negative_index("alpha", "has_intercept",
        has_intercept);
      current_statement__ = 739;
      stan::math::validate_non_negative_index("omega_int", "has_intercept_z",
        has_intercept_z);
    } catch (const std::exception& e) {
      stan::lang::rethrow_located(e, locations_array__[current_statement__]);
    }
    num_params_r__ = has_intercept + z_beta_1dim__ + K_smooth +
      smooth_sd_raw_1dim__ + hs + (hs * K) + caux_1dim__ + (mix_1dim__ * K) +
      one_over_lambda_1dim__ + q + len_z_T + len_rho + len_concentration + t
      + 1 + z_omega_1dim__ + has_intercept_z + hs_z + (hs_z * z_dim) +
      caux_z_1dim__ + (S_z_1dim__ * z_dim) + one_over_lambda_z_1dim__;
  }
  inline std::string model_name() const final {
    return "model_continuous";
  }
  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_continuous_namespace::log_prob";
    // suppress unused var warning
    (void) function__;
    try {
      std::vector<local_scalar_t__> gamma =
        std::vector<local_scalar_t__>(has_intercept, DUMMY_VAR__);
      current_statement__ = 1;
      gamma = in__.template read_constrain_lub<std::vector<local_scalar_t__>,
                jacobian__>(make_lower(family, link, pstream__),
                make_upper(family, link, pstream__), lp__, has_intercept);
      Eigen::Matrix<local_scalar_t__,-1,1> z_beta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_beta_1dim__,
          DUMMY_VAR__);
      current_statement__ = 2;
      z_beta = in__.template read<
                 Eigen::Matrix<local_scalar_t__,-1,1>>(z_beta_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> z_beta_smooth =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K_smooth, DUMMY_VAR__);
      current_statement__ = 3;
      z_beta_smooth = in__.template read<
                        Eigen::Matrix<local_scalar_t__,-1,1>>(K_smooth);
      Eigen::Matrix<local_scalar_t__,-1,1> smooth_sd_raw =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(smooth_sd_raw_1dim__,
          DUMMY_VAR__);
      current_statement__ = 4;
      smooth_sd_raw = in__.template read_constrain_lb<
                        Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0,
                        lp__, smooth_sd_raw_1dim__);
      std::vector<local_scalar_t__> global =
        std::vector<local_scalar_t__>(hs, DUMMY_VAR__);
      current_statement__ = 5;
      global = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                 jacobian__>(0, lp__, hs);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> local =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(hs,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__));
      current_statement__ = 6;
      local = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, hs, K);
      std::vector<local_scalar_t__> caux =
        std::vector<local_scalar_t__>(caux_1dim__, DUMMY_VAR__);
      current_statement__ = 7;
      caux = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
               jacobian__>(0, lp__, caux_1dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> mix =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(mix_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__));
      current_statement__ = 8;
      mix = in__.template read_constrain_lb<
              std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
              jacobian__>(0, lp__, mix_1dim__, K);
      std::vector<local_scalar_t__> one_over_lambda =
        std::vector<local_scalar_t__>(one_over_lambda_1dim__, DUMMY_VAR__);
      current_statement__ = 9;
      one_over_lambda = in__.template read_constrain_lb<
                          std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                          one_over_lambda_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> z_b =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(q, DUMMY_VAR__);
      current_statement__ = 10;
      z_b = in__.template read<Eigen::Matrix<local_scalar_t__,-1,1>>(q);
      Eigen::Matrix<local_scalar_t__,-1,1> z_T =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(len_z_T, DUMMY_VAR__);
      current_statement__ = 11;
      z_T = in__.template read<Eigen::Matrix<local_scalar_t__,-1,1>>(len_z_T);
      Eigen::Matrix<local_scalar_t__,-1,1> rho =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(len_rho, DUMMY_VAR__);
      current_statement__ = 12;
      rho = in__.template read_constrain_lub<
              Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, 1, lp__,
              len_rho);
      Eigen::Matrix<local_scalar_t__,-1,1> zeta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(len_concentration,
          DUMMY_VAR__);
      current_statement__ = 13;
      zeta = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               len_concentration);
      Eigen::Matrix<local_scalar_t__,-1,1> tau =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(t, DUMMY_VAR__);
      current_statement__ = 14;
      tau = in__.template read_constrain_lb<
              Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__, t);
      local_scalar_t__ aux_unscaled = DUMMY_VAR__;
      current_statement__ = 15;
      aux_unscaled = in__.template read_constrain_lb<local_scalar_t__,
                       jacobian__>(0, lp__);
      Eigen::Matrix<local_scalar_t__,-1,1> z_omega =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_omega_1dim__,
          DUMMY_VAR__);
      current_statement__ = 16;
      z_omega = in__.template read<
                  Eigen::Matrix<local_scalar_t__,-1,1>>(z_omega_1dim__);
      std::vector<local_scalar_t__> gamma_z =
        std::vector<local_scalar_t__>(has_intercept_z, DUMMY_VAR__);
      current_statement__ = 17;
      gamma_z = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>,
                  jacobian__>((stan::math::logical_lte(link_phi, 1) ? 
                  stan::math::negative_infinity() : 0), lp__,
                  has_intercept_z);
      std::vector<local_scalar_t__> global_z =
        std::vector<local_scalar_t__>(hs_z, DUMMY_VAR__);
      current_statement__ = 18;
      global_z = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, hs_z);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> local_z =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(hs_z,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_dim, DUMMY_VAR__));
      current_statement__ = 19;
      local_z = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, hs_z, z_dim);
      std::vector<local_scalar_t__> caux_z =
        std::vector<local_scalar_t__>(caux_z_1dim__, DUMMY_VAR__);
      current_statement__ = 20;
      caux_z = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                 jacobian__>(0, lp__, caux_z_1dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> S_z =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(S_z_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_dim, DUMMY_VAR__));
      current_statement__ = 21;
      S_z = in__.template read_constrain_lb<
              std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
              jacobian__>(0, lp__, S_z_1dim__, z_dim);
      std::vector<local_scalar_t__> one_over_lambda_z =
        std::vector<local_scalar_t__>(one_over_lambda_z_1dim__, DUMMY_VAR__);
      current_statement__ = 22;
      one_over_lambda_z = in__.template read_constrain_lb<
                            std::vector<local_scalar_t__>, jacobian__>(0,
                            lp__, one_over_lambda_z_1dim__);
      local_scalar_t__ aux = DUMMY_VAR__;
      current_statement__ = 23;
      aux = (stan::math::logical_eq(prior_dist_for_aux, 0) ? aux_unscaled : (
        stan::math::logical_lte(prior_dist_for_aux, 2) ? ((prior_scale_for_aux
        * aux_unscaled) + prior_mean_for_aux) : (prior_scale_for_aux *
        aux_unscaled)));
      Eigen::Matrix<local_scalar_t__,-1,1> omega =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_dim, DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> beta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> beta_smooth =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K_smooth, DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> smooth_sd =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(smooth_sd_1dim__,
          DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> b =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(q, DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> theta_L =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(len_theta_L,
          DUMMY_VAR__);
      current_statement__ = 69;
      if (stan::math::logical_eq(prior_dist, 0)) {
        current_statement__ = 68;
        stan::model::assign(beta, z_beta, "assigning variable beta");
      } else {
        current_statement__ = 67;
        if (stan::math::logical_eq(prior_dist, 1)) {
          current_statement__ = 66;
          stan::model::assign(beta,
            stan::math::add(stan::math::elt_multiply(z_beta, prior_scale),
              prior_mean), "assigning variable beta");
        } else {
          current_statement__ = 65;
          if (stan::math::logical_eq(prior_dist, 2)) {
            current_statement__ = 64;
            for (int k = 1; k <= K; ++k) {
              current_statement__ = 62;
              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__ = 61;
            if (stan::math::logical_eq(prior_dist, 3)) {
              local_scalar_t__ c2 = DUMMY_VAR__;
              current_statement__ = 56;
              c2 = (stan::math::square(slab_scale) *
                stan::model::rvalue(caux, "caux", stan::model::index_uni(1)));
              current_statement__ = 59;
              if ((stan::math::primitive_value(
                     stan::math::logical_eq(is_continuous, 1))
                  &&
                  stan::math::primitive_value(
                    stan::math::logical_eq(family, 1)))) {
                current_statement__ = 58;
                stan::model::assign(beta,
                  hs_prior(z_beta, global, local, global_prior_scale, aux,
                    c2, pstream__), "assigning variable beta");
              } else {
                current_statement__ = 57;
                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__ = 55;
              if (stan::math::logical_eq(prior_dist, 4)) {
                local_scalar_t__ c2 = DUMMY_VAR__;
                current_statement__ = 50;
                c2 = (stan::math::square(slab_scale) *
                  stan::model::rvalue(caux, "caux", stan::model::index_uni(1)));
                current_statement__ = 53;
                if ((stan::math::primitive_value(
                       stan::math::logical_eq(is_continuous, 1))
                    &&
                    stan::math::primitive_value(
                      stan::math::logical_eq(family, 1)))) {
                  current_statement__ = 52;
                  stan::model::assign(beta,
                    hsplus_prior(z_beta, global, local, global_prior_scale,
                      aux, c2, pstream__), "assigning variable beta");
                } else {
                  current_statement__ = 51;
                  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__ = 49;
                if (stan::math::logical_eq(prior_dist, 5)) {
                  current_statement__ = 48;
                  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__ = 47;
                  if (stan::math::logical_eq(prior_dist, 6)) {
                    current_statement__ = 46;
                    stan::model::assign(beta,
                      stan::math::add(prior_mean,
                        stan::math::elt_multiply(
                          stan::math::elt_multiply(
                            stan::math::multiply(
                              stan::model::rvalue(one_over_lambda,
                                "one_over_lambda", 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");
                  } else {
                    current_statement__ = 45;
                    if (stan::math::logical_eq(prior_dist, 7)) {
                      int z_pos = std::numeric_limits<int>::min();
                      current_statement__ = 33;
                      z_pos = 1;
                      current_statement__ = 43;
                      for (int k = 1; k <= K; ++k) {
                        current_statement__ = 34;
                        stan::model::assign(beta,
                          stan::model::rvalue(z_beta, "z_beta",
                            stan::model::index_uni(z_pos)),
                          "assigning variable beta",
                          stan::model::index_uni(k));
                        current_statement__ = 35;
                        z_pos = (z_pos + 1);
                        current_statement__ = 39;
                        for (int n = 2; n <=
                             stan::model::rvalue(num_normals, "num_normals",
                               stan::model::index_uni(k)); ++n) {
                          current_statement__ = 36;
                          stan::model::assign(beta,
                            (stan::model::rvalue(beta, "beta",
                               stan::model::index_uni(k)) *
                            stan::model::rvalue(z_beta, "z_beta",
                              stan::model::index_uni(z_pos))),
                            "assigning variable beta",
                            stan::model::index_uni(k));
                          current_statement__ = 37;
                          z_pos = (z_pos + 1);
                        }
                        current_statement__ = 40;
                        stan::model::assign(beta,
                          (stan::model::rvalue(beta, "beta",
                             stan::model::index_uni(k)) *
                          stan::math::pow(
                            stan::model::rvalue(prior_scale, "prior_scale",
                              stan::model::index_uni(k)),
                            stan::model::rvalue(num_normals, "num_normals",
                              stan::model::index_uni(k)))),
                          "assigning variable beta",
                          stan::model::index_uni(k));
                        current_statement__ = 41;
                        stan::model::assign(beta,
                          (stan::model::rvalue(beta, "beta",
                             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));
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      current_statement__ = 75;
      if (K_smooth) {
        current_statement__ = 70;
        stan::model::assign(smooth_sd,
          stan::math::add(prior_mean_for_smooth,
            stan::math::elt_multiply(prior_scale_for_smooth, smooth_sd_raw)),
          "assigning variable smooth_sd");
        current_statement__ = 72;
        if ((stan::math::primitive_value(is_continuous) &&
            stan::math::primitive_value(stan::math::logical_eq(family, 1)))) {
          current_statement__ = 71;
          stan::model::assign(smooth_sd,
            stan::math::multiply(stan::model::deep_copy(smooth_sd), aux),
            "assigning variable smooth_sd");
        }
        current_statement__ = 73;
        stan::model::assign(beta_smooth,
          stan::math::elt_multiply(z_beta_smooth,
            stan::model::rvalue(smooth_sd, "smooth_sd",
              stan::model::index_multi(smooth_map))),
          "assigning variable beta_smooth");
      }
      current_statement__ = 105;
      if (stan::math::logical_eq(prior_dist_z, 0)) {
        current_statement__ = 104;
        stan::model::assign(omega, z_omega, "assigning variable omega");
      } else {
        current_statement__ = 103;
        if (stan::math::logical_eq(prior_dist_z, 1)) {
          current_statement__ = 102;
          stan::model::assign(omega,
            stan::math::add(stan::math::elt_multiply(z_omega, prior_scale_z),
              prior_mean_z), "assigning variable omega");
        } else {
          current_statement__ = 101;
          if (stan::math::logical_eq(prior_dist_z, 2)) {
            current_statement__ = 100;
            for (int k = 1; k <= z_dim; ++k) {
              local_scalar_t__ left = DUMMY_VAR__;
              current_statement__ = 97;
              left = CFt(
                       stan::model::rvalue(omega, "omega",
                         stan::model::index_uni(k)),
                       stan::model::rvalue(prior_df_z, "prior_df_z",
                         stan::model::index_uni(k)), pstream__);
              current_statement__ = 98;
              stan::model::assign(omega, ((left *
                stan::model::rvalue(prior_scale_z, "prior_scale_z",
                  stan::model::index_uni(k))) +
                stan::model::rvalue(prior_mean_z, "prior_mean_z",
                  stan::model::index_uni(k))), "assigning variable omega",
                stan::model::index_uni(k));
            }
          } else {
            current_statement__ = 96;
            if (stan::math::logical_eq(prior_dist_z, 3)) {
              current_statement__ = 95;
              stan::model::assign(omega,
                hs_prior(z_omega, global_z, local_z, global_prior_scale,
                  static_cast<double>(1), (stan::math::square(slab_scale_z) *
                  stan::model::rvalue(caux_z, "caux_z",
                    stan::model::index_uni(1))), pstream__),
                "assigning variable omega");
            } else {
              current_statement__ = 94;
              if (stan::math::logical_eq(prior_dist_z, 4)) {
                current_statement__ = 93;
                stan::model::assign(omega,
                  hsplus_prior(z_omega, global_z, local_z,
                    global_prior_scale, static_cast<double>(1),
                    (stan::math::square(slab_scale_z) *
                    stan::model::rvalue(caux_z, "caux_z",
                      stan::model::index_uni(1))), pstream__),
                  "assigning variable omega");
              } else {
                current_statement__ = 92;
                if (stan::math::logical_eq(prior_dist_z, 5)) {
                  current_statement__ = 91;
                  stan::model::assign(omega,
                    stan::math::add(prior_mean_z,
                      stan::math::elt_multiply(
                        stan::math::elt_multiply(prior_scale_z,
                          stan::math::sqrt(
                            stan::math::multiply(2,
                              stan::model::rvalue(S_z, "S_z",
                                stan::model::index_uni(1))))), z_omega)),
                    "assigning variable omega");
                } else {
                  current_statement__ = 90;
                  if (stan::math::logical_eq(prior_dist_z, 6)) {
                    current_statement__ = 89;
                    stan::model::assign(omega,
                      stan::math::add(prior_mean_z,
                        stan::math::elt_multiply(
                          stan::math::elt_multiply(
                            stan::math::multiply(
                              stan::model::rvalue(one_over_lambda_z,
                                "one_over_lambda_z",
                                stan::model::index_uni(1)), prior_scale_z),
                            stan::math::sqrt(
                              stan::math::multiply(2,
                                stan::model::rvalue(S_z, "S_z",
                                  stan::model::index_uni(1))))), z_omega)),
                      "assigning variable omega");
                  } else {
                    current_statement__ = 88;
                    if (stan::math::logical_eq(prior_dist_z, 7)) {
                      int z_pos = std::numeric_limits<int>::min();
                      current_statement__ = 76;
                      z_pos = 1;
                      current_statement__ = 86;
                      for (int k = 1; k <= z_dim; ++k) {
                        current_statement__ = 77;
                        stan::model::assign(omega,
                          stan::model::rvalue(z_omega, "z_omega",
                            stan::model::index_uni(z_pos)),
                          "assigning variable omega",
                          stan::model::index_uni(k));
                        current_statement__ = 78;
                        z_pos = (z_pos + 1);
                        current_statement__ = 82;
                        for (int n = 2; n <=
                             stan::model::rvalue(num_normals_z,
                               "num_normals_z", stan::model::index_uni(k)); ++n) {
                          current_statement__ = 79;
                          stan::model::assign(omega,
                            (stan::model::rvalue(omega, "omega",
                               stan::model::index_uni(k)) *
                            stan::model::rvalue(z_omega, "z_omega",
                              stan::model::index_uni(z_pos))),
                            "assigning variable omega",
                            stan::model::index_uni(k));
                          current_statement__ = 80;
                          z_pos = (z_pos + 1);
                        }
                        current_statement__ = 83;
                        stan::model::assign(omega,
                          (stan::model::rvalue(omega, "omega",
                             stan::model::index_uni(k)) *
                          stan::math::pow(
                            stan::model::rvalue(prior_scale_z,
                              "prior_scale_z", stan::model::index_uni(k)),
                            stan::model::rvalue(num_normals_z,
                              "num_normals_z", stan::model::index_uni(k)))),
                          "assigning variable omega",
                          stan::model::index_uni(k));
                        current_statement__ = 84;
                        stan::model::assign(omega,
                          (stan::model::rvalue(omega, "omega",
                             stan::model::index_uni(k)) +
                          stan::model::rvalue(prior_mean_z, "prior_mean_z",
                            stan::model::index_uni(k))),
                          "assigning variable omega",
                          stan::model::index_uni(k));
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      current_statement__ = 111;
      if (stan::math::logical_eq(prior_dist_for_aux, 0)) {
        current_statement__ = 110;
        aux = aux_unscaled;
      } else {
        current_statement__ = 106;
        aux = (prior_scale_for_aux * aux_unscaled);
        current_statement__ = 108;
        if (stan::math::logical_lte(prior_dist_for_aux, 2)) {
          current_statement__ = 107;
          aux = (aux + prior_mean_for_aux);
        }
      }
      current_statement__ = 127;
      if (stan::math::logical_gt(t, 0)) {
        current_statement__ = 125;
        if (stan::math::logical_eq(special_case, 1)) {
          int start = std::numeric_limits<int>::min();
          current_statement__ = 115;
          start = 1;
          current_statement__ = 116;
          stan::model::assign(theta_L,
            stan::math::multiply(stan::math::elt_multiply(scale, tau), aux),
            "assigning variable theta_L");
          current_statement__ = 123;
          if (stan::math::logical_eq(t, 1)) {
            current_statement__ = 122;
            stan::model::assign(b,
              stan::math::multiply(
                stan::model::rvalue(theta_L, "theta_L",
                  stan::model::index_uni(1)), z_b), "assigning variable b");
          } else {
            current_statement__ = 121;
            for (int i = 1; i <= t; ++i) {
              int end = std::numeric_limits<int>::min();
              current_statement__ = 117;
              end = ((start +
                stan::model::rvalue(l, "l", stan::model::index_uni(i))) - 1);
              current_statement__ = 118;
              stan::model::assign(b,
                stan::math::multiply(
                  stan::model::rvalue(theta_L, "theta_L",
                    stan::model::index_uni(i)),
                  stan::model::rvalue(z_b, "z_b",
                    stan::model::index_min_max(start, end))),
                "assigning variable b",
                stan::model::index_min_max(start, end));
              current_statement__ = 119;
              start = (end + 1);
            }
          }
        } else {
          current_statement__ = 112;
          stan::model::assign(theta_L,
            make_theta_L(len_theta_L, p, aux, tau, scale, zeta, rho, z_T,
              pstream__), "assigning variable theta_L");
          current_statement__ = 113;
          stan::model::assign(b, make_b(z_b, theta_L, p, l, pstream__),
            "assigning variable b");
        }
      }
      {
        current_statement__ = 410;
        if (can_do_OLS) {
          current_statement__ = 406;
          stan::math::validate_non_negative_index("coeff", "cols(XtX)",
            stan::math::cols(XtX));
          Eigen::Matrix<local_scalar_t__,-1,1> coeff =
            Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::cols(
                                                             XtX),
              DUMMY_VAR__);
          current_statement__ = 407;
          stan::model::assign(coeff,
            (has_intercept ? stan::math::eval(
                               stan::math::append_row(
                                 stan::math::to_vector(gamma),
                                 (stan::math::logical_gt(K_smooth, 0) ? 
                                 stan::math::eval(
                                   stan::math::append_row(beta, beta_smooth)) : 
                                 stan::math::eval(beta)))) : stan::math::eval(
                                                               (stan::math::logical_gt(
                                                                  K_smooth, 0) ? 
                                                               stan::math::eval(
                                                                 stan::math::append_row(
                                                                   beta,
                                                                   beta_smooth)) : 
                                                               stan::math::eval(
                                                                 beta)))),
            "assigning variable coeff");
          current_statement__ = 408;
          lp_accum__.add(mvn_ols_lpdf<false>(coeff, OLS, XtX, SSR, aux, N,
                           pstream__));
        } else {
          current_statement__ = 405;
          if (can_do_normalidglm) {
            current_statement__ = 401;
            stan::math::validate_non_negative_index("coeff", "K + K_smooth",
              (K + K_smooth));
            Eigen::Matrix<local_scalar_t__,-1,1> coeff =
              Eigen::Matrix<local_scalar_t__,-1,1>::Constant((K + K_smooth),
                DUMMY_VAR__);
            current_statement__ = 402;
            stan::model::assign(coeff,
              (stan::math::logical_gt(K_smooth, 0) ? stan::math::eval(
                                                       stan::math::append_row(
                                                         beta, beta_smooth)) : 
              stan::math::eval(beta)), "assigning variable coeff");
            current_statement__ = 403;
            lp_accum__.add(stan::math::normal_id_glm_lpdf<false>(y, XS,
                             (has_intercept ? stan::model::rvalue(gamma,
                                                "gamma",
                                                stan::model::index_uni(1)) : 0.0),
                             coeff, aux));
          } else {
            current_statement__ = 400;
            if (stan::math::logical_eq(prior_PD, 0)) {
              current_statement__ = 275;
              stan::math::validate_non_negative_index("eta_z",
                "link_phi > 0 ? N : 0",
                (stan::math::logical_gt(link_phi, 0) ? N : 0));
              Eigen::Matrix<local_scalar_t__,-1,1> eta_z =
                Eigen::Matrix<local_scalar_t__,-1,1>::Constant((stan::math::logical_gt(
                                                                  link_phi, 0) ? N : 0),
                  DUMMY_VAR__);
              current_statement__ = 277;
              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__ = 284;
              if (stan::math::logical_gt(K, 0)) {
                current_statement__ = 282;
                if (dense_X) {
                  current_statement__ = 281;
                  stan::model::assign(eta,
                    stan::math::multiply(
                      stan::model::rvalue(X, "X", stan::model::index_uni(1)),
                      beta), "assigning variable eta");
                } else {
                  current_statement__ = 280;
                  stan::model::assign(eta,
                    stan::math::csr_matrix_times_vector(N, K, w_X, v_X, u_X,
                      beta), "assigning variable eta");
                }
              } else {
                current_statement__ = 279;
                stan::model::assign(eta, stan::math::rep_vector(0.0, N),
                  "assigning variable eta");
              }
              current_statement__ = 286;
              if (stan::math::logical_eq(has_offset, 1)) {
                current_statement__ = 285;
                stan::model::assign(eta,
                  stan::math::add(stan::model::deep_copy(eta), offset_),
                  "assigning variable eta");
              }
              current_statement__ = 288;
              if (K_smooth) {
                current_statement__ = 287;
                stan::model::assign(eta,
                  stan::math::add(stan::model::deep_copy(eta),
                    stan::math::multiply(S, beta_smooth)),
                  "assigning variable eta");
              }
              current_statement__ = 294;
              if (stan::math::logical_gt(t, 0)) {
                current_statement__ = 292;
                if (special_case) {
                  current_statement__ = 291;
                  for (int i = 1; i <= t; ++i) {
                    current_statement__ = 290;
                    stan::model::assign(eta,
                      stan::math::add(stan::model::deep_copy(eta),
                        stan::model::rvalue(b, "b",
                          stan::model::index_multi(
                            stan::model::rvalue(V, "V",
                              stan::model::index_uni(i))))),
                      "assigning variable eta");
                  }
                } else {
                  current_statement__ = 289;
                  stan::model::assign(eta,
                    stan::math::add(stan::model::deep_copy(eta),
                      stan::math::csr_matrix_times_vector(N, q, w, v, u, b)),
                    "assigning variable eta");
                }
              }
              current_statement__ = 303;
              if (stan::math::logical_eq(has_intercept, 1)) {
                current_statement__ = 301;
                if ((stan::math::primitive_value(
                       (stan::math::primitive_value(
                          stan::math::logical_eq(family, 1)) ||
                       stan::math::primitive_value(
                         stan::math::logical_eq(link, 2))))
                    ||
                    stan::math::primitive_value(
                      (stan::math::primitive_value(
                         stan::math::logical_eq(family, 4)) &&
                      stan::math::primitive_value(
                        stan::math::logical_neq(link, 5)))))) {
                  current_statement__ = 300;
                  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__ = 299;
                  if ((stan::math::primitive_value(
                         stan::math::logical_eq(family, 4))
                      &&
                      stan::math::primitive_value(
                        stan::math::logical_eq(link, 5)))) {
                    current_statement__ = 298;
                    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__ = 297;
                    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");
                  }
                }
              } else {
                current_statement__ = 295;
                stan::model::assign(eta,
                  stan::math::add(stan::model::deep_copy(eta),
                    stan::math::dot_product(xbar, beta)),
                  "assigning variable eta");
              }
              current_statement__ = 398;
              if (stan::math::logical_gt(SSfun, 0)) {
                current_statement__ = 367;
                stan::math::validate_non_negative_index("P", "len_y", len_y);
                current_statement__ = 368;
                stan::math::validate_non_negative_index("P", "K", K);
                Eigen::Matrix<local_scalar_t__,-1,-1> P =
                  Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(len_y, K,
                    DUMMY_VAR__);
                current_statement__ = 369;
                stan::model::assign(P, reshape_vec(eta, len_y, K, pstream__),
                  "assigning variable P");
                current_statement__ = 396;
                if (stan::math::logical_lt(SSfun, 5)) {
                  current_statement__ = 394;
                  if (stan::math::logical_lte(SSfun, 2)) {
                    current_statement__ = 392;
                    if (stan::math::logical_eq(SSfun, 1)) {
                      current_statement__ = 391;
                      lp_accum__.add(stan::math::normal_lpdf<false>(y,
                                       SS_asymp(input, P, pstream__), aux));
                    } else {
                      current_statement__ = 390;
                      lp_accum__.add(stan::math::normal_lpdf<false>(y,
                                       SS_asympOff(input, P, pstream__), aux));
                    }
                  } else {
                    current_statement__ = 389;
                    if (stan::math::logical_eq(SSfun, 3)) {
                      current_statement__ = 388;
                      lp_accum__.add(stan::math::normal_lpdf<false>(y,
                                       SS_asympOrig(input, P, pstream__), aux));
                    } else {
                      current_statement__ = 385;
                      for (int i = 1; i <= len_y; ++i) {
                        current_statement__ = 384;
                        stan::model::assign(P,
                          (stan::model::rvalue(P, "P",
                             stan::model::index_uni(i),
                             stan::model::index_uni(1)) +
                          stan::math::exp(
                            stan::model::rvalue(P, "P",
                              stan::model::index_uni(i),
                              stan::model::index_uni(3)))),
                          "assigning variable P", stan::model::index_uni(i),
                          stan::model::index_uni(1));
                      }
                      current_statement__ = 386;
                      lp_accum__.add(stan::math::normal_lpdf<false>(y,
                                       SS_biexp(input, P, pstream__), aux));
                    }
                  }
                } else {
                  current_statement__ = 382;
                  if (stan::math::logical_lte(SSfun, 7)) {
                    current_statement__ = 380;
                    if (stan::math::logical_eq(SSfun, 5)) {
                      current_statement__ = 379;
                      lp_accum__.add(stan::math::normal_lpdf<false>(y,
                                       SS_fol(Dose, input, P, pstream__), aux));
                    } else {
                      current_statement__ = 378;
                      if (stan::math::logical_eq(SSfun, 6)) {
                        current_statement__ = 377;
                        lp_accum__.add(stan::math::normal_lpdf<false>(y,
                                         SS_fpl(input, P, pstream__), aux));
                      } else {
                        current_statement__ = 376;
                        lp_accum__.add(stan::math::normal_lpdf<false>(y,
                                         SS_gompertz(input, P, pstream__),
                                         aux));
                      }
                    }
                  } else {
                    current_statement__ = 374;
                    if (stan::math::logical_eq(SSfun, 8)) {
                      current_statement__ = 373;
                      lp_accum__.add(stan::math::normal_lpdf<false>(y,
                                       SS_logis(input, P, pstream__), aux));
                    } else {
                      current_statement__ = 372;
                      if (stan::math::logical_eq(SSfun, 9)) {
                        current_statement__ = 371;
                        lp_accum__.add(stan::math::normal_lpdf<false>(y,
                                         SS_micmen(input, P, pstream__), aux));
                      } else {
                        current_statement__ = 370;
                        lp_accum__.add(stan::math::normal_lpdf<false>(y,
                                         SS_weibull(input, P, pstream__), aux));
                      }
                    }
                  }
                }
              } else {
                current_statement__ = 366;
                if (stan::math::logical_eq(has_weights, 0)) {
                  current_statement__ = 323;
                  if ((stan::math::primitive_value(
                         (stan::math::primitive_value(
                            stan::math::logical_eq(family, 4)) &&
                         stan::math::primitive_value(
                           stan::math::logical_gt(z_dim, 0))))
                      &&
                      stan::math::primitive_value(
                        stan::math::logical_gt(link_phi, 0)))) {
                    current_statement__ = 321;
                    stan::model::assign(eta_z,
                      stan::math::multiply(betareg_z, omega),
                      "assigning variable eta_z");
                  } else {
                    current_statement__ = 320;
                    if ((stan::math::primitive_value(
                           (stan::math::primitive_value(
                              stan::math::logical_eq(family, 4)) &&
                           stan::math::primitive_value(
                             stan::math::logical_eq(z_dim, 0))))
                        &&
                        stan::math::primitive_value(
                          stan::math::logical_eq(has_intercept_z, 1)))) {
                      current_statement__ = 318;
                      stan::model::assign(eta_z,
                        stan::math::rep_vector(0.0, N),
                        "assigning variable eta_z");
                    }
                  }
                  current_statement__ = 336;
                  if (stan::math::logical_eq(has_intercept_z, 1)) {
                    current_statement__ = 334;
                    if (stan::math::logical_gt(link_phi, 1)) {
                      current_statement__ = 332;
                      stan::model::assign(eta_z,
                        stan::math::add(stan::model::deep_copy(eta_z),
                          (stan::model::rvalue(gamma_z, "gamma_z",
                             stan::model::index_uni(1)) -
                          stan::math::min(eta_z))),
                        "assigning variable eta_z");
                    } else {
                      current_statement__ = 330;
                      stan::model::assign(eta_z,
                        stan::math::add(stan::model::deep_copy(eta_z),
                          stan::model::rvalue(gamma_z, "gamma_z",
                            stan::model::index_uni(1))),
                        "assigning variable eta_z");
                    }
                  } else {
                    current_statement__ = 328;
                    if (stan::math::logical_gt(link_phi, 1)) {
                      current_statement__ = 326;
                      stan::model::assign(eta_z,
                        stan::math::add(stan::model::deep_copy(eta_z),
                          (stan::math::dot_product(zbar, omega) -
                          stan::math::min(eta_z))),
                        "assigning variable eta_z");
                    } else {
                      current_statement__ = 324;
                      stan::model::assign(eta_z,
                        stan::math::add(stan::model::deep_copy(eta_z),
                          stan::math::dot_product(zbar, omega)),
                        "assigning variable eta_z");
                    }
                  }
                  current_statement__ = 364;
                  if (stan::math::logical_eq(family, 1)) {
                    current_statement__ = 362;
                    if (stan::math::logical_eq(link, 1)) {
                      current_statement__ = 361;
                      lp_accum__.add(stan::math::normal_lpdf<false>(y, eta,
                                       aux));
                    } else {
                      current_statement__ = 360;
                      if (stan::math::logical_eq(link, 2)) {
                        current_statement__ = 359;
                        lp_accum__.add(stan::math::normal_lpdf<false>(y,
                                         stan::math::exp(eta), aux));
                      } else {
                        current_statement__ = 358;
                        lp_accum__.add(stan::math::normal_lpdf<false>(y,
                                         stan::math::inv(eta), aux));
                      }
                    }
                  } else {
                    current_statement__ = 357;
                    if (stan::math::logical_eq(family, 2)) {
                      current_statement__ = 355;
                      lp_accum__.add(GammaReg(y, eta, aux, link, sum_log_y,
                                       pstream__));
                    } else {
                      current_statement__ = 354;
                      if (stan::math::logical_eq(family, 3)) {
                        current_statement__ = 352;
                        lp_accum__.add(inv_gaussian(y,
                                         linkinv_inv_gaussian(eta, link,
                                           pstream__), aux, sum_log_y,
                                         sqrt_y, pstream__));
                      } else {
                        current_statement__ = 351;
                        if ((stan::math::primitive_value(
                               stan::math::logical_eq(family, 4))
                            &&
                            stan::math::primitive_value(
                              stan::math::logical_eq(link_phi, 0)))) {
                          current_statement__ = 346;
                          stan::math::validate_non_negative_index("mu", "N",
                            N);
                          Eigen::Matrix<local_scalar_t__,-1,1> mu =
                            Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N,
                              DUMMY_VAR__);
                          current_statement__ = 348;
                          stan::model::assign(mu,
                            linkinv_beta(eta, link, pstream__),
                            "assigning variable mu");
                          current_statement__ = 349;
                          lp_accum__.add(stan::math::beta_lpdf<false>(y,
                                           stan::math::multiply(mu, aux),
                                           stan::math::multiply(
                                             stan::math::subtract(1, mu), aux)));
                        } else {
                          current_statement__ = 345;
                          if ((stan::math::primitive_value(
                                 stan::math::logical_eq(family, 4))
                              &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(link_phi, 0)))) {
                            current_statement__ = 337;
                            stan::math::validate_non_negative_index("mu",
                              "N", N);
                            Eigen::Matrix<local_scalar_t__,-1,1> mu =
                              Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N,
                                DUMMY_VAR__);
                            current_statement__ = 339;
                            stan::math::validate_non_negative_index("mu_z",
                              "N", N);
                            Eigen::Matrix<local_scalar_t__,-1,1> mu_z =
                              Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N,
                                DUMMY_VAR__);
                            current_statement__ = 341;
                            stan::model::assign(mu,
                              linkinv_beta(eta, link, pstream__),
                              "assigning variable mu");
                            current_statement__ = 342;
                            stan::model::assign(mu_z,
                              linkinv_beta_z(eta_z, link_phi, pstream__),
                              "assigning variable mu_z");
                            current_statement__ = 343;
                            lp_accum__.add(stan::math::beta_lpdf<false>(y,
                                             stan::math::rows_dot_product(mu,
                                               mu_z),
                                             stan::math::rows_dot_product(
                                               stan::math::subtract(1, mu),
                                               mu_z)));
                          }
                        }
                      }
                    }
                  }
                } else {
                  current_statement__ = 304;
                  stan::math::validate_non_negative_index("summands", "N", N);
                  Eigen::Matrix<local_scalar_t__,-1,1> summands =
                    Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N,
                      DUMMY_VAR__);
                  current_statement__ = 315;
                  if (stan::math::logical_eq(family, 1)) {
                    current_statement__ = 314;
                    stan::model::assign(summands,
                      pw_gauss(y, eta, aux, link, pstream__),
                      "assigning variable summands");
                  } else {
                    current_statement__ = 313;
                    if (stan::math::logical_eq(family, 2)) {
                      current_statement__ = 312;
                      stan::model::assign(summands,
                        pw_gamma(y, eta, aux, link, pstream__),
                        "assigning variable summands");
                    } else {
                      current_statement__ = 311;
                      if (stan::math::logical_eq(family, 3)) {
                        current_statement__ = 310;
                        stan::model::assign(summands,
                          pw_inv_gaussian(y, eta, aux, link, log_y, sqrt_y,
                            pstream__), "assigning variable summands");
                      } else {
                        current_statement__ = 309;
                        if ((stan::math::primitive_value(
                               stan::math::logical_eq(family, 4))
                            &&
                            stan::math::primitive_value(
                              stan::math::logical_eq(link_phi, 0)))) {
                          current_statement__ = 308;
                          stan::model::assign(summands,
                            pw_beta(y, eta, aux, link, pstream__),
                            "assigning variable summands");
                        } else {
                          current_statement__ = 307;
                          if ((stan::math::primitive_value(
                                 stan::math::logical_eq(family, 4))
                              &&
                              stan::math::primitive_value(
                                stan::math::logical_gt(link_phi, 0)))) {
                            current_statement__ = 306;
                            stan::model::assign(summands,
                              pw_beta_z(y, eta, eta_z, link, link_phi,
                                pstream__), "assigning variable summands");
                          }
                        }
                      }
                    }
                  }
                  current_statement__ = 316;
                  lp_accum__.add(stan::math::dot_product(weights, summands));
                }
              }
            }
          }
        }
        current_statement__ = 418;
        if ((stan::math::primitive_value(
               stan::math::logical_gt(prior_dist_for_aux, 0))
            &&
            stan::math::primitive_value(
              stan::math::logical_gt(prior_scale_for_aux, 0)))) {
          local_scalar_t__ log_half = DUMMY_VAR__;
          current_statement__ = 411;
          log_half = -0.693147180559945286;
          current_statement__ = 416;
          if (stan::math::logical_eq(prior_dist_for_aux, 1)) {
            current_statement__ = 415;
            lp_accum__.add((stan::math::normal_lpdf<false>(aux_unscaled, 0, 1)
              - log_half));
          } else {
            current_statement__ = 414;
            if (stan::math::logical_eq(prior_dist_for_aux, 2)) {
              current_statement__ = 413;
              lp_accum__.add((stan::math::student_t_lpdf<false>(aux_unscaled,
                                prior_df_for_aux, 0, 1) - log_half));
            } else {
              current_statement__ = 412;
              lp_accum__.add(stan::math::exponential_lpdf<false>(
                               aux_unscaled, 1));
            }
          }
        }
        current_statement__ = 454;
        if (stan::math::logical_eq(prior_dist, 1)) {
          current_statement__ = 453;
          lp_accum__.add(stan::math::normal_lpdf<false>(z_beta, 0, 1));
        } else {
          current_statement__ = 452;
          if (stan::math::logical_eq(prior_dist, 2)) {
            current_statement__ = 451;
            lp_accum__.add(stan::math::normal_lpdf<false>(z_beta, 0, 1));
          } else {
            current_statement__ = 450;
            if (stan::math::logical_eq(prior_dist, 3)) {
              local_scalar_t__ log_half = DUMMY_VAR__;
              current_statement__ = 442;
              log_half = -0.693147180559945286;
              current_statement__ = 443;
              lp_accum__.add(stan::math::normal_lpdf<false>(z_beta, 0, 1));
              current_statement__ = 444;
              lp_accum__.add((stan::math::normal_lpdf<false>(
                                stan::model::rvalue(local, "local",
                                  stan::model::index_uni(1)), 0, 1) -
                log_half));
              current_statement__ = 445;
              lp_accum__.add(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__ = 446;
              lp_accum__.add((stan::math::normal_lpdf<false>(
                                stan::model::rvalue(global, "global",
                                  stan::model::index_uni(1)), 0, 1) -
                log_half));
              current_statement__ = 447;
              lp_accum__.add(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__ = 448;
              lp_accum__.add(stan::math::inv_gamma_lpdf<false>(caux, (0.5 *
                               slab_df), (0.5 * slab_df)));
            } else {
              current_statement__ = 441;
              if (stan::math::logical_eq(prior_dist, 4)) {
                local_scalar_t__ log_half = DUMMY_VAR__;
                current_statement__ = 431;
                log_half = -0.693147180559945286;
                current_statement__ = 432;
                lp_accum__.add(stan::math::normal_lpdf<false>(z_beta, 0, 1));
                current_statement__ = 433;
                lp_accum__.add((stan::math::normal_lpdf<false>(
                                  stan::model::rvalue(local, "local",
                                    stan::model::index_uni(1)), 0, 1) -
                  log_half));
                current_statement__ = 434;
                lp_accum__.add(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__ = 435;
                lp_accum__.add((stan::math::normal_lpdf<false>(
                                  stan::model::rvalue(local, "local",
                                    stan::model::index_uni(3)), 0, 1) -
                  log_half));
                current_statement__ = 436;
                lp_accum__.add(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__ = 437;
                lp_accum__.add((stan::math::normal_lpdf<false>(
                                  stan::model::rvalue(global, "global",
                                    stan::model::index_uni(1)), 0, 1) -
                  log_half));
                current_statement__ = 438;
                lp_accum__.add(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__ = 439;
                lp_accum__.add(stan::math::inv_gamma_lpdf<false>(caux, (0.5 *
                                 slab_df), (0.5 * slab_df)));
              } else {
                current_statement__ = 430;
                if (stan::math::logical_eq(prior_dist, 5)) {
                  current_statement__ = 427;
                  lp_accum__.add(stan::math::normal_lpdf<false>(z_beta, 0, 1));
                  current_statement__ = 428;
                  lp_accum__.add(stan::math::exponential_lpdf<false>(
                                   stan::model::rvalue(mix, "mix",
                                     stan::model::index_uni(1)), 1));
                } else {
                  current_statement__ = 426;
                  if (stan::math::logical_eq(prior_dist, 6)) {
                    current_statement__ = 422;
                    lp_accum__.add(stan::math::normal_lpdf<false>(z_beta, 0,
                                     1));
                    current_statement__ = 423;
                    lp_accum__.add(stan::math::exponential_lpdf<false>(
                                     stan::model::rvalue(mix, "mix",
                                       stan::model::index_uni(1)), 1));
                    current_statement__ = 424;
                    lp_accum__.add(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__ = 421;
                    if (stan::math::logical_eq(prior_dist, 7)) {
                      current_statement__ = 419;
                      lp_accum__.add(stan::math::normal_lpdf<false>(z_beta,
                                       0, 1));
                    }
                  }
                }
              }
            }
          }
        }
        current_statement__ = 460;
        if (stan::math::logical_eq(has_intercept, 1)) {
          current_statement__ = 458;
          if (stan::math::logical_eq(prior_dist_for_intercept, 1)) {
            current_statement__ = 457;
            lp_accum__.add(stan::math::normal_lpdf<false>(gamma,
                             prior_mean_for_intercept,
                             prior_scale_for_intercept));
          } else {
            current_statement__ = 456;
            if (stan::math::logical_eq(prior_dist_for_intercept, 2)) {
              current_statement__ = 455;
              lp_accum__.add(stan::math::student_t_lpdf<false>(gamma,
                               prior_df_for_intercept,
                               prior_mean_for_intercept,
                               prior_scale_for_intercept));
            }
          }
        }
        current_statement__ = 472;
        if (K_smooth) {
          current_statement__ = 461;
          lp_accum__.add(stan::math::normal_lpdf<false>(z_beta_smooth, 0, 1));
          current_statement__ = 470;
          if (stan::math::logical_gt(prior_dist_for_smooth, 0)) {
            local_scalar_t__ log_half = DUMMY_VAR__;
            current_statement__ = 462;
            log_half = -0.693147180559945286;
            current_statement__ = 468;
            if (stan::math::logical_eq(prior_dist_for_smooth, 1)) {
              current_statement__ = 467;
              lp_accum__.add((stan::math::normal_lpdf<false>(smooth_sd_raw,
                                0, 1) - log_half));
            } else {
              current_statement__ = 466;
              if (stan::math::logical_eq(prior_dist_for_smooth, 2)) {
                current_statement__ = 465;
                lp_accum__.add((stan::math::student_t_lpdf<false>(
                                  smooth_sd_raw, prior_df_for_smooth, 0, 1) -
                  log_half));
              } else {
                current_statement__ = 464;
                if (stan::math::logical_eq(prior_dist_for_smooth, 3)) {
                  current_statement__ = 463;
                  lp_accum__.add(stan::math::exponential_lpdf<false>(
                                   smooth_sd_raw, 1));
                }
              }
            }
          }
        }
        current_statement__ = 508;
        if (stan::math::logical_eq(prior_dist_z, 1)) {
          current_statement__ = 507;
          lp_accum__.add(stan::math::normal_lpdf<false>(z_omega, 0, 1));
        } else {
          current_statement__ = 506;
          if (stan::math::logical_eq(prior_dist_z, 2)) {
            current_statement__ = 505;
            lp_accum__.add(stan::math::normal_lpdf<false>(z_omega, 0, 1));
          } else {
            current_statement__ = 504;
            if (stan::math::logical_eq(prior_dist_z, 3)) {
              local_scalar_t__ log_half = DUMMY_VAR__;
              current_statement__ = 496;
              log_half = -0.693147180559945286;
              current_statement__ = 497;
              lp_accum__.add(stan::math::normal_lpdf<false>(z_omega, 0, 1));
              current_statement__ = 498;
              lp_accum__.add((stan::math::normal_lpdf<false>(
                                stan::model::rvalue(local_z, "local_z",
                                  stan::model::index_uni(1)), 0, 1) -
                log_half));
              current_statement__ = 499;
              lp_accum__.add(stan::math::inv_gamma_lpdf<false>(
                               stan::model::rvalue(local_z, "local_z",
                                 stan::model::index_uni(2)),
                               stan::math::multiply(0.5, prior_df_z),
                               stan::math::multiply(0.5, prior_df_z)));
              current_statement__ = 500;
              lp_accum__.add((stan::math::normal_lpdf<false>(
                                stan::model::rvalue(global_z, "global_z",
                                  stan::model::index_uni(1)), 0, 1) -
                log_half));
              current_statement__ = 501;
              lp_accum__.add(stan::math::inv_gamma_lpdf<false>(
                               stan::model::rvalue(global_z, "global_z",
                                 stan::model::index_uni(2)), (0.5 *
                               global_prior_df_z), (0.5 * global_prior_df_z)));
              current_statement__ = 502;
              lp_accum__.add(stan::math::inv_gamma_lpdf<false>(caux_z, (0.5 *
                               slab_df_z), (0.5 * slab_df_z)));
            } else {
              current_statement__ = 495;
              if (stan::math::logical_eq(prior_dist_z, 4)) {
                local_scalar_t__ log_half = DUMMY_VAR__;
                current_statement__ = 485;
                log_half = -0.693147180559945286;
                current_statement__ = 486;
                lp_accum__.add(stan::math::normal_lpdf<false>(z_omega, 0, 1));
                current_statement__ = 487;
                lp_accum__.add((stan::math::normal_lpdf<false>(
                                  stan::model::rvalue(local_z, "local_z",
                                    stan::model::index_uni(1)), 0, 1) -
                  log_half));
                current_statement__ = 488;
                lp_accum__.add(stan::math::inv_gamma_lpdf<false>(
                                 stan::model::rvalue(local_z, "local_z",
                                   stan::model::index_uni(2)),
                                 stan::math::multiply(0.5, prior_df_z),
                                 stan::math::multiply(0.5, prior_df_z)));
                current_statement__ = 489;
                lp_accum__.add((stan::math::normal_lpdf<false>(
                                  stan::model::rvalue(local_z, "local_z",
                                    stan::model::index_uni(3)), 0, 1) -
                  log_half));
                current_statement__ = 490;
                lp_accum__.add(stan::math::inv_gamma_lpdf<false>(
                                 stan::model::rvalue(local_z, "local_z",
                                   stan::model::index_uni(4)),
                                 stan::math::multiply(0.5, prior_scale_z),
                                 stan::math::multiply(0.5, prior_scale_z)));
                current_statement__ = 491;
                lp_accum__.add((stan::math::normal_lpdf<false>(
                                  stan::model::rvalue(global_z, "global_z",
                                    stan::model::index_uni(1)), 0, 1) -
                  log_half));
                current_statement__ = 492;
                lp_accum__.add(stan::math::inv_gamma_lpdf<false>(
                                 stan::model::rvalue(global_z, "global_z",
                                   stan::model::index_uni(2)), 0.5, 0.5));
                current_statement__ = 493;
                lp_accum__.add(stan::math::inv_gamma_lpdf<false>(caux_z, (0.5
                                 * slab_df_z), (0.5 * slab_df_z)));
              } else {
                current_statement__ = 484;
                if (stan::math::logical_eq(prior_dist_z, 5)) {
                  current_statement__ = 481;
                  lp_accum__.add(stan::math::normal_lpdf<false>(z_omega, 0, 1));
                  current_statement__ = 482;
                  lp_accum__.add(stan::math::exponential_lpdf<false>(
                                   stan::model::rvalue(S_z, "S_z",
                                     stan::model::index_uni(1)), 1));
                } else {
                  current_statement__ = 480;
                  if (stan::math::logical_eq(prior_dist_z, 6)) {
                    current_statement__ = 476;
                    lp_accum__.add(stan::math::normal_lpdf<false>(z_omega, 0,
                                     1));
                    current_statement__ = 477;
                    lp_accum__.add(stan::math::exponential_lpdf<false>(
                                     stan::model::rvalue(S_z, "S_z",
                                       stan::model::index_uni(1)), 1));
                    current_statement__ = 478;
                    lp_accum__.add(stan::math::chi_square_lpdf<false>(
                                     stan::model::rvalue(one_over_lambda_z,
                                       "one_over_lambda_z",
                                       stan::model::index_uni(1)),
                                     stan::model::rvalue(prior_df_z,
                                       "prior_df_z",
                                       stan::model::index_uni(1))));
                  } else {
                    current_statement__ = 475;
                    if (stan::math::logical_eq(prior_dist_z, 7)) {
                      current_statement__ = 473;
                      lp_accum__.add(stan::math::normal_lpdf<false>(z_omega,
                                       0, 1));
                    }
                  }
                }
              }
            }
          }
        }
        current_statement__ = 514;
        if (stan::math::logical_eq(has_intercept_z, 1)) {
          current_statement__ = 512;
          if (stan::math::logical_eq(prior_dist_for_intercept_z, 1)) {
            current_statement__ = 511;
            lp_accum__.add(stan::math::normal_lpdf<false>(gamma_z,
                             prior_mean_for_intercept_z,
                             prior_scale_for_intercept_z));
          } else {
            current_statement__ = 510;
            if (stan::math::logical_eq(prior_dist_for_intercept_z, 2)) {
              current_statement__ = 509;
              lp_accum__.add(stan::math::student_t_lpdf<false>(gamma_z,
                               prior_df_for_intercept_z,
                               prior_mean_for_intercept_z,
                               prior_scale_for_intercept_z));
            }
          }
        }
        current_statement__ = 517;
        if (stan::math::logical_gt(t, 0)) {
          current_statement__ = 515;
          lp_accum__.add(decov_lpdf<false>(z_b, z_T, rho, zeta, tau,
                           regularization, delta, shape, t, p, 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_continuous_namespace::write_array";
    // suppress unused var warning
    (void) function__;
    try {
      std::vector<double> gamma =
        std::vector<double>(has_intercept,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 1;
      gamma = in__.template read_constrain_lub<std::vector<local_scalar_t__>,
                jacobian__>(make_lower(family, link, pstream__),
                make_upper(family, link, pstream__), lp__, has_intercept);
      Eigen::Matrix<double,-1,1> z_beta =
        Eigen::Matrix<double,-1,1>::Constant(z_beta_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 2;
      z_beta = in__.template read<
                 Eigen::Matrix<local_scalar_t__,-1,1>>(z_beta_1dim__);
      Eigen::Matrix<double,-1,1> z_beta_smooth =
        Eigen::Matrix<double,-1,1>::Constant(K_smooth,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 3;
      z_beta_smooth = in__.template read<
                        Eigen::Matrix<local_scalar_t__,-1,1>>(K_smooth);
      Eigen::Matrix<double,-1,1> smooth_sd_raw =
        Eigen::Matrix<double,-1,1>::Constant(smooth_sd_raw_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 4;
      smooth_sd_raw = in__.template read_constrain_lb<
                        Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0,
                        lp__, smooth_sd_raw_1dim__);
      std::vector<double> global =
        std::vector<double>(hs, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 5;
      global = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                 jacobian__>(0, lp__, hs);
      std::vector<Eigen::Matrix<double,-1,1>> local =
        std::vector<Eigen::Matrix<double,-1,1>>(hs,
          Eigen::Matrix<double,-1,1>::Constant(K,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 6;
      local = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, hs, K);
      std::vector<double> caux =
        std::vector<double>(caux_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 7;
      caux = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
               jacobian__>(0, lp__, caux_1dim__);
      std::vector<Eigen::Matrix<double,-1,1>> mix =
        std::vector<Eigen::Matrix<double,-1,1>>(mix_1dim__,
          Eigen::Matrix<double,-1,1>::Constant(K,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 8;
      mix = in__.template read_constrain_lb<
              std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
              jacobian__>(0, lp__, mix_1dim__, K);
      std::vector<double> one_over_lambda =
        std::vector<double>(one_over_lambda_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 9;
      one_over_lambda = in__.template read_constrain_lb<
                          std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                          one_over_lambda_1dim__);
      Eigen::Matrix<double,-1,1> z_b =
        Eigen::Matrix<double,-1,1>::Constant(q,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 10;
      z_b = in__.template read<Eigen::Matrix<local_scalar_t__,-1,1>>(q);
      Eigen::Matrix<double,-1,1> z_T =
        Eigen::Matrix<double,-1,1>::Constant(len_z_T,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 11;
      z_T = in__.template read<Eigen::Matrix<local_scalar_t__,-1,1>>(len_z_T);
      Eigen::Matrix<double,-1,1> rho =
        Eigen::Matrix<double,-1,1>::Constant(len_rho,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 12;
      rho = in__.template read_constrain_lub<
              Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, 1, lp__,
              len_rho);
      Eigen::Matrix<double,-1,1> zeta =
        Eigen::Matrix<double,-1,1>::Constant(len_concentration,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 13;
      zeta = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               len_concentration);
      Eigen::Matrix<double,-1,1> tau =
        Eigen::Matrix<double,-1,1>::Constant(t,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 14;
      tau = in__.template read_constrain_lb<
              Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__, t);
      double aux_unscaled = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 15;
      aux_unscaled = in__.template read_constrain_lb<local_scalar_t__,
                       jacobian__>(0, lp__);
      Eigen::Matrix<double,-1,1> z_omega =
        Eigen::Matrix<double,-1,1>::Constant(z_omega_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 16;
      z_omega = in__.template read<
                  Eigen::Matrix<local_scalar_t__,-1,1>>(z_omega_1dim__);
      std::vector<double> gamma_z =
        std::vector<double>(has_intercept_z,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 17;
      gamma_z = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>,
                  jacobian__>((stan::math::logical_lte(link_phi, 1) ? 
                  stan::math::negative_infinity() : 0), lp__,
                  has_intercept_z);
      std::vector<double> global_z =
        std::vector<double>(hs_z, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 18;
      global_z = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, hs_z);
      std::vector<Eigen::Matrix<double,-1,1>> local_z =
        std::vector<Eigen::Matrix<double,-1,1>>(hs_z,
          Eigen::Matrix<double,-1,1>::Constant(z_dim,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 19;
      local_z = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, hs_z, z_dim);
      std::vector<double> caux_z =
        std::vector<double>(caux_z_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 20;
      caux_z = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                 jacobian__>(0, lp__, caux_z_1dim__);
      std::vector<Eigen::Matrix<double,-1,1>> S_z =
        std::vector<Eigen::Matrix<double,-1,1>>(S_z_1dim__,
          Eigen::Matrix<double,-1,1>::Constant(z_dim,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 21;
      S_z = in__.template read_constrain_lb<
              std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
              jacobian__>(0, lp__, S_z_1dim__, z_dim);
      std::vector<double> one_over_lambda_z =
        std::vector<double>(one_over_lambda_z_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 22;
      one_over_lambda_z = in__.template read_constrain_lb<
                            std::vector<local_scalar_t__>, jacobian__>(0,
                            lp__, one_over_lambda_z_1dim__);
      double aux = std::numeric_limits<double>::quiet_NaN();
      Eigen::Matrix<double,-1,1> omega =
        Eigen::Matrix<double,-1,1>::Constant(z_dim,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> beta =
        Eigen::Matrix<double,-1,1>::Constant(K,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> beta_smooth =
        Eigen::Matrix<double,-1,1>::Constant(K_smooth,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> smooth_sd =
        Eigen::Matrix<double,-1,1>::Constant(smooth_sd_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> b =
        Eigen::Matrix<double,-1,1>::Constant(q,
          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());
      out__.write(gamma);
      out__.write(z_beta);
      out__.write(z_beta_smooth);
      out__.write(smooth_sd_raw);
      out__.write(global);
      for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= hs; ++sym2__) {
          out__.write(local[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      out__.write(caux);
      for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= mix_1dim__; ++sym2__) {
          out__.write(mix[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      out__.write(one_over_lambda);
      out__.write(z_b);
      out__.write(z_T);
      out__.write(rho);
      out__.write(zeta);
      out__.write(tau);
      out__.write(aux_unscaled);
      out__.write(z_omega);
      out__.write(gamma_z);
      out__.write(global_z);
      for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= hs_z; ++sym2__) {
          out__.write(local_z[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      out__.write(caux_z);
      for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= S_z_1dim__; ++sym2__) {
          out__.write(S_z[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      out__.write(one_over_lambda_z);
      if (stan::math::logical_negation(
            (stan::math::primitive_value(emit_transformed_parameters__) ||
            stan::math::primitive_value(emit_generated_quantities__)))) {
        return ;
      }
      current_statement__ = 23;
      aux = (stan::math::logical_eq(prior_dist_for_aux, 0) ? aux_unscaled : (
        stan::math::logical_lte(prior_dist_for_aux, 2) ? ((prior_scale_for_aux
        * aux_unscaled) + prior_mean_for_aux) : (prior_scale_for_aux *
        aux_unscaled)));
      current_statement__ = 69;
      if (stan::math::logical_eq(prior_dist, 0)) {
        current_statement__ = 68;
        stan::model::assign(beta, z_beta, "assigning variable beta");
      } else {
        current_statement__ = 67;
        if (stan::math::logical_eq(prior_dist, 1)) {
          current_statement__ = 66;
          stan::model::assign(beta,
            stan::math::add(stan::math::elt_multiply(z_beta, prior_scale),
              prior_mean), "assigning variable beta");
        } else {
          current_statement__ = 65;
          if (stan::math::logical_eq(prior_dist, 2)) {
            current_statement__ = 64;
            for (int k = 1; k <= K; ++k) {
              current_statement__ = 62;
              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__ = 61;
            if (stan::math::logical_eq(prior_dist, 3)) {
              double c2 = std::numeric_limits<double>::quiet_NaN();
              current_statement__ = 56;
              c2 = (stan::math::square(slab_scale) *
                stan::model::rvalue(caux, "caux", stan::model::index_uni(1)));
              current_statement__ = 59;
              if ((stan::math::primitive_value(
                     stan::math::logical_eq(is_continuous, 1))
                  &&
                  stan::math::primitive_value(
                    stan::math::logical_eq(family, 1)))) {
                current_statement__ = 58;
                stan::model::assign(beta,
                  hs_prior(z_beta, global, local, global_prior_scale, aux,
                    c2, pstream__), "assigning variable beta");
              } else {
                current_statement__ = 57;
                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__ = 55;
              if (stan::math::logical_eq(prior_dist, 4)) {
                double c2 = std::numeric_limits<double>::quiet_NaN();
                current_statement__ = 50;
                c2 = (stan::math::square(slab_scale) *
                  stan::model::rvalue(caux, "caux", stan::model::index_uni(1)));
                current_statement__ = 53;
                if ((stan::math::primitive_value(
                       stan::math::logical_eq(is_continuous, 1))
                    &&
                    stan::math::primitive_value(
                      stan::math::logical_eq(family, 1)))) {
                  current_statement__ = 52;
                  stan::model::assign(beta,
                    hsplus_prior(z_beta, global, local, global_prior_scale,
                      aux, c2, pstream__), "assigning variable beta");
                } else {
                  current_statement__ = 51;
                  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__ = 49;
                if (stan::math::logical_eq(prior_dist, 5)) {
                  current_statement__ = 48;
                  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__ = 47;
                  if (stan::math::logical_eq(prior_dist, 6)) {
                    current_statement__ = 46;
                    stan::model::assign(beta,
                      stan::math::add(prior_mean,
                        stan::math::elt_multiply(
                          stan::math::elt_multiply(
                            stan::math::multiply(
                              stan::model::rvalue(one_over_lambda,
                                "one_over_lambda", 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");
                  } else {
                    current_statement__ = 45;
                    if (stan::math::logical_eq(prior_dist, 7)) {
                      int z_pos = std::numeric_limits<int>::min();
                      current_statement__ = 33;
                      z_pos = 1;
                      current_statement__ = 43;
                      for (int k = 1; k <= K; ++k) {
                        current_statement__ = 34;
                        stan::model::assign(beta,
                          stan::model::rvalue(z_beta, "z_beta",
                            stan::model::index_uni(z_pos)),
                          "assigning variable beta",
                          stan::model::index_uni(k));
                        current_statement__ = 35;
                        z_pos = (z_pos + 1);
                        current_statement__ = 39;
                        for (int n = 2; n <=
                             stan::model::rvalue(num_normals, "num_normals",
                               stan::model::index_uni(k)); ++n) {
                          current_statement__ = 36;
                          stan::model::assign(beta,
                            (stan::model::rvalue(beta, "beta",
                               stan::model::index_uni(k)) *
                            stan::model::rvalue(z_beta, "z_beta",
                              stan::model::index_uni(z_pos))),
                            "assigning variable beta",
                            stan::model::index_uni(k));
                          current_statement__ = 37;
                          z_pos = (z_pos + 1);
                        }
                        current_statement__ = 40;
                        stan::model::assign(beta,
                          (stan::model::rvalue(beta, "beta",
                             stan::model::index_uni(k)) *
                          stan::math::pow(
                            stan::model::rvalue(prior_scale, "prior_scale",
                              stan::model::index_uni(k)),
                            stan::model::rvalue(num_normals, "num_normals",
                              stan::model::index_uni(k)))),
                          "assigning variable beta",
                          stan::model::index_uni(k));
                        current_statement__ = 41;
                        stan::model::assign(beta,
                          (stan::model::rvalue(beta, "beta",
                             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));
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      current_statement__ = 75;
      if (K_smooth) {
        current_statement__ = 70;
        stan::model::assign(smooth_sd,
          stan::math::add(prior_mean_for_smooth,
            stan::math::elt_multiply(prior_scale_for_smooth, smooth_sd_raw)),
          "assigning variable smooth_sd");
        current_statement__ = 72;
        if ((stan::math::primitive_value(is_continuous) &&
            stan::math::primitive_value(stan::math::logical_eq(family, 1)))) {
          current_statement__ = 71;
          stan::model::assign(smooth_sd,
            stan::math::multiply(stan::model::deep_copy(smooth_sd), aux),
            "assigning variable smooth_sd");
        }
        current_statement__ = 73;
        stan::model::assign(beta_smooth,
          stan::math::elt_multiply(z_beta_smooth,
            stan::model::rvalue(smooth_sd, "smooth_sd",
              stan::model::index_multi(smooth_map))),
          "assigning variable beta_smooth");
      }
      current_statement__ = 105;
      if (stan::math::logical_eq(prior_dist_z, 0)) {
        current_statement__ = 104;
        stan::model::assign(omega, z_omega, "assigning variable omega");
      } else {
        current_statement__ = 103;
        if (stan::math::logical_eq(prior_dist_z, 1)) {
          current_statement__ = 102;
          stan::model::assign(omega,
            stan::math::add(stan::math::elt_multiply(z_omega, prior_scale_z),
              prior_mean_z), "assigning variable omega");
        } else {
          current_statement__ = 101;
          if (stan::math::logical_eq(prior_dist_z, 2)) {
            current_statement__ = 100;
            for (int k = 1; k <= z_dim; ++k) {
              double left = std::numeric_limits<double>::quiet_NaN();
              current_statement__ = 97;
              left = CFt(
                       stan::model::rvalue(omega, "omega",
                         stan::model::index_uni(k)),
                       stan::model::rvalue(prior_df_z, "prior_df_z",
                         stan::model::index_uni(k)), pstream__);
              current_statement__ = 98;
              stan::model::assign(omega, ((left *
                stan::model::rvalue(prior_scale_z, "prior_scale_z",
                  stan::model::index_uni(k))) +
                stan::model::rvalue(prior_mean_z, "prior_mean_z",
                  stan::model::index_uni(k))), "assigning variable omega",
                stan::model::index_uni(k));
            }
          } else {
            current_statement__ = 96;
            if (stan::math::logical_eq(prior_dist_z, 3)) {
              current_statement__ = 95;
              stan::model::assign(omega,
                hs_prior(z_omega, global_z, local_z, global_prior_scale,
                  static_cast<double>(1), (stan::math::square(slab_scale_z) *
                  stan::model::rvalue(caux_z, "caux_z",
                    stan::model::index_uni(1))), pstream__),
                "assigning variable omega");
            } else {
              current_statement__ = 94;
              if (stan::math::logical_eq(prior_dist_z, 4)) {
                current_statement__ = 93;
                stan::model::assign(omega,
                  hsplus_prior(z_omega, global_z, local_z,
                    global_prior_scale, static_cast<double>(1),
                    (stan::math::square(slab_scale_z) *
                    stan::model::rvalue(caux_z, "caux_z",
                      stan::model::index_uni(1))), pstream__),
                  "assigning variable omega");
              } else {
                current_statement__ = 92;
                if (stan::math::logical_eq(prior_dist_z, 5)) {
                  current_statement__ = 91;
                  stan::model::assign(omega,
                    stan::math::add(prior_mean_z,
                      stan::math::elt_multiply(
                        stan::math::elt_multiply(prior_scale_z,
                          stan::math::sqrt(
                            stan::math::multiply(2,
                              stan::model::rvalue(S_z, "S_z",
                                stan::model::index_uni(1))))), z_omega)),
                    "assigning variable omega");
                } else {
                  current_statement__ = 90;
                  if (stan::math::logical_eq(prior_dist_z, 6)) {
                    current_statement__ = 89;
                    stan::model::assign(omega,
                      stan::math::add(prior_mean_z,
                        stan::math::elt_multiply(
                          stan::math::elt_multiply(
                            stan::math::multiply(
                              stan::model::rvalue(one_over_lambda_z,
                                "one_over_lambda_z",
                                stan::model::index_uni(1)), prior_scale_z),
                            stan::math::sqrt(
                              stan::math::multiply(2,
                                stan::model::rvalue(S_z, "S_z",
                                  stan::model::index_uni(1))))), z_omega)),
                      "assigning variable omega");
                  } else {
                    current_statement__ = 88;
                    if (stan::math::logical_eq(prior_dist_z, 7)) {
                      int z_pos = std::numeric_limits<int>::min();
                      current_statement__ = 76;
                      z_pos = 1;
                      current_statement__ = 86;
                      for (int k = 1; k <= z_dim; ++k) {
                        current_statement__ = 77;
                        stan::model::assign(omega,
                          stan::model::rvalue(z_omega, "z_omega",
                            stan::model::index_uni(z_pos)),
                          "assigning variable omega",
                          stan::model::index_uni(k));
                        current_statement__ = 78;
                        z_pos = (z_pos + 1);
                        current_statement__ = 82;
                        for (int n = 2; n <=
                             stan::model::rvalue(num_normals_z,
                               "num_normals_z", stan::model::index_uni(k)); ++n) {
                          current_statement__ = 79;
                          stan::model::assign(omega,
                            (stan::model::rvalue(omega, "omega",
                               stan::model::index_uni(k)) *
                            stan::model::rvalue(z_omega, "z_omega",
                              stan::model::index_uni(z_pos))),
                            "assigning variable omega",
                            stan::model::index_uni(k));
                          current_statement__ = 80;
                          z_pos = (z_pos + 1);
                        }
                        current_statement__ = 83;
                        stan::model::assign(omega,
                          (stan::model::rvalue(omega, "omega",
                             stan::model::index_uni(k)) *
                          stan::math::pow(
                            stan::model::rvalue(prior_scale_z,
                              "prior_scale_z", stan::model::index_uni(k)),
                            stan::model::rvalue(num_normals_z,
                              "num_normals_z", stan::model::index_uni(k)))),
                          "assigning variable omega",
                          stan::model::index_uni(k));
                        current_statement__ = 84;
                        stan::model::assign(omega,
                          (stan::model::rvalue(omega, "omega",
                             stan::model::index_uni(k)) +
                          stan::model::rvalue(prior_mean_z, "prior_mean_z",
                            stan::model::index_uni(k))),
                          "assigning variable omega",
                          stan::model::index_uni(k));
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      current_statement__ = 111;
      if (stan::math::logical_eq(prior_dist_for_aux, 0)) {
        current_statement__ = 110;
        aux = aux_unscaled;
      } else {
        current_statement__ = 106;
        aux = (prior_scale_for_aux * aux_unscaled);
        current_statement__ = 108;
        if (stan::math::logical_lte(prior_dist_for_aux, 2)) {
          current_statement__ = 107;
          aux = (aux + prior_mean_for_aux);
        }
      }
      current_statement__ = 127;
      if (stan::math::logical_gt(t, 0)) {
        current_statement__ = 125;
        if (stan::math::logical_eq(special_case, 1)) {
          int start = std::numeric_limits<int>::min();
          current_statement__ = 115;
          start = 1;
          current_statement__ = 116;
          stan::model::assign(theta_L,
            stan::math::multiply(stan::math::elt_multiply(scale, tau), aux),
            "assigning variable theta_L");
          current_statement__ = 123;
          if (stan::math::logical_eq(t, 1)) {
            current_statement__ = 122;
            stan::model::assign(b,
              stan::math::multiply(
                stan::model::rvalue(theta_L, "theta_L",
                  stan::model::index_uni(1)), z_b), "assigning variable b");
          } else {
            current_statement__ = 121;
            for (int i = 1; i <= t; ++i) {
              int end = std::numeric_limits<int>::min();
              current_statement__ = 117;
              end = ((start +
                stan::model::rvalue(l, "l", stan::model::index_uni(i))) - 1);
              current_statement__ = 118;
              stan::model::assign(b,
                stan::math::multiply(
                  stan::model::rvalue(theta_L, "theta_L",
                    stan::model::index_uni(i)),
                  stan::model::rvalue(z_b, "z_b",
                    stan::model::index_min_max(start, end))),
                "assigning variable b",
                stan::model::index_min_max(start, end));
              current_statement__ = 119;
              start = (end + 1);
            }
          }
        } else {
          current_statement__ = 112;
          stan::model::assign(theta_L,
            make_theta_L(len_theta_L, p, aux, tau, scale, zeta, rho, z_T,
              pstream__), "assigning variable theta_L");
          current_statement__ = 113;
          stan::model::assign(b, make_b(z_b, theta_L, p, l, pstream__),
            "assigning variable b");
        }
      }
      if (emit_transformed_parameters__) {
        out__.write(aux);
        out__.write(omega);
        out__.write(beta);
        out__.write(beta_smooth);
        out__.write(smooth_sd);
        out__.write(b);
        out__.write(theta_L);
      }
      if (stan::math::logical_negation(emit_generated_quantities__)) {
        return ;
      }
      double mean_PPD = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 30;
      mean_PPD = (compute_mean_PPD ? 0 : stan::math::negative_infinity());
      std::vector<double> alpha =
        std::vector<double>(has_intercept,
          std::numeric_limits<double>::quiet_NaN());
      std::vector<double> omega_int =
        std::vector<double>(has_intercept_z,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 132;
      if (stan::math::logical_eq(has_intercept, 1)) {
        current_statement__ = 130;
        if (dense_X) {
          current_statement__ = 129;
          stan::model::assign(alpha,
            (stan::model::rvalue(gamma, "gamma", stan::model::index_uni(1)) -
            stan::math::dot_product(xbar, beta)), "assigning variable alpha",
            stan::model::index_uni(1));
        } else {
          current_statement__ = 128;
          stan::model::assign(alpha,
            stan::model::rvalue(gamma, "gamma", stan::model::index_uni(1)),
            "assigning variable alpha", stan::model::index_uni(1));
        }
      }
      current_statement__ = 135;
      if (stan::math::logical_eq(has_intercept_z, 1)) {
        current_statement__ = 133;
        stan::model::assign(omega_int,
          (stan::model::rvalue(gamma_z, "gamma_z", stan::model::index_uni(1))
          - stan::math::dot_product(zbar, omega)),
          "assigning variable omega_int", stan::model::index_uni(1));
      }
      current_statement__ = 274;
      if (compute_mean_PPD) {
        current_statement__ = 136;
        stan::math::validate_non_negative_index("eta_z", "N", N);
        Eigen::Matrix<double,-1,1> eta_z =
          Eigen::Matrix<double,-1,1>::Constant(N,
            std::numeric_limits<double>::quiet_NaN());
        current_statement__ = 138;
        stan::math::validate_non_negative_index("eta", "N", N);
        Eigen::Matrix<double,-1,1> eta =
          Eigen::Matrix<double,-1,1>::Constant(N,
            std::numeric_limits<double>::quiet_NaN());
        current_statement__ = 145;
        if (stan::math::logical_gt(K, 0)) {
          current_statement__ = 143;
          if (dense_X) {
            current_statement__ = 142;
            stan::model::assign(eta,
              stan::math::multiply(
                stan::model::rvalue(X, "X", stan::model::index_uni(1)), beta),
              "assigning variable eta");
          } else {
            current_statement__ = 141;
            stan::model::assign(eta,
              stan::math::csr_matrix_times_vector(N, K, w_X, v_X, u_X, beta),
              "assigning variable eta");
          }
        } else {
          current_statement__ = 140;
          stan::model::assign(eta, stan::math::rep_vector(0.0, N),
            "assigning variable eta");
        }
        current_statement__ = 147;
        if (stan::math::logical_eq(has_offset, 1)) {
          current_statement__ = 146;
          stan::model::assign(eta,
            stan::math::add(stan::model::deep_copy(eta), offset_),
            "assigning variable eta");
        }
        current_statement__ = 149;
        if (K_smooth) {
          current_statement__ = 148;
          stan::model::assign(eta,
            stan::math::add(stan::model::deep_copy(eta),
              stan::math::multiply(S, beta_smooth)), "assigning variable eta");
        }
        current_statement__ = 155;
        if (stan::math::logical_gt(t, 0)) {
          current_statement__ = 153;
          if (special_case) {
            current_statement__ = 152;
            for (int i = 1; i <= t; ++i) {
              current_statement__ = 151;
              stan::model::assign(eta,
                stan::math::add(stan::model::deep_copy(eta),
                  stan::model::rvalue(b, "b",
                    stan::model::index_multi(
                      stan::model::rvalue(V, "V", stan::model::index_uni(i))))),
                "assigning variable eta");
            }
          } else {
            current_statement__ = 150;
            stan::model::assign(eta,
              stan::math::add(stan::model::deep_copy(eta),
                stan::math::csr_matrix_times_vector(N, q, w, v, u, b)),
              "assigning variable eta");
          }
        }
        current_statement__ = 170;
        if (stan::math::logical_eq(has_intercept, 1)) {
          current_statement__ = 168;
          if ((stan::math::primitive_value(
                 stan::math::logical_eq(make_lower(family, link, pstream__),
                   stan::math::negative_infinity()))
              &&
              stan::math::primitive_value(
                stan::math::logical_eq(make_upper(family, link, pstream__),
                  stan::math::positive_infinity())))) {
            current_statement__ = 167;
            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__ = 166;
            if ((stan::math::primitive_value(
                   stan::math::logical_eq(family, 4))
                &&
                stan::math::primitive_value(stan::math::logical_eq(link, 5)))) {
              double max_eta = std::numeric_limits<double>::quiet_NaN();
              current_statement__ = 162;
              max_eta = stan::math::max(eta);
              current_statement__ = 163;
              stan::model::assign(alpha,
                (stan::model::rvalue(alpha, "alpha",
                   stan::model::index_uni(1)) - max_eta),
                "assigning variable alpha", stan::model::index_uni(1));
              current_statement__ = 164;
              stan::model::assign(eta,
                stan::math::add(stan::model::deep_copy(eta),
                  (stan::model::rvalue(gamma, "gamma",
                     stan::model::index_uni(1)) - max_eta)),
                "assigning variable eta");
            } else {
              double min_eta = std::numeric_limits<double>::quiet_NaN();
              current_statement__ = 158;
              min_eta = stan::math::min(eta);
              current_statement__ = 159;
              stan::model::assign(alpha,
                (stan::model::rvalue(alpha, "alpha",
                   stan::model::index_uni(1)) - min_eta),
                "assigning variable alpha", stan::model::index_uni(1));
              current_statement__ = 160;
              stan::model::assign(eta,
                stan::math::add(stan::model::deep_copy(eta),
                  (stan::model::rvalue(gamma, "gamma",
                     stan::model::index_uni(1)) - min_eta)),
                "assigning variable eta");
            }
          }
        } else {
          current_statement__ = 156;
          stan::model::assign(eta,
            stan::math::add(stan::model::deep_copy(eta),
              stan::math::dot_product(xbar, beta)), "assigning variable eta");
        }
        current_statement__ = 176;
        if ((stan::math::primitive_value(
               (stan::math::primitive_value(stan::math::logical_eq(family, 4))
               &&
               stan::math::primitive_value(stan::math::logical_gt(z_dim, 0))))
            &&
            stan::math::primitive_value(stan::math::logical_gt(link_phi, 0)))) {
          current_statement__ = 174;
          stan::model::assign(eta_z, stan::math::multiply(betareg_z, omega),
            "assigning variable eta_z");
        } else {
          current_statement__ = 173;
          if ((stan::math::primitive_value(
                 (stan::math::primitive_value(
                    stan::math::logical_eq(family, 4)) &&
                 stan::math::primitive_value(stan::math::logical_eq(z_dim, 0))))
              &&
              stan::math::primitive_value(
                stan::math::logical_eq(has_intercept_z, 1)))) {
            current_statement__ = 171;
            stan::model::assign(eta_z, stan::math::rep_vector(0.0, N),
              "assigning variable eta_z");
          }
        }
        current_statement__ = 190;
        if (stan::math::logical_eq(has_intercept_z, 1)) {
          current_statement__ = 188;
          if (stan::math::logical_gt(link_phi, 1)) {
            current_statement__ = 185;
            stan::model::assign(omega_int,
              (stan::model::rvalue(omega_int, "omega_int",
                 stan::model::index_uni(1)) - stan::math::min(eta_z)),
              "assigning variable omega_int", stan::model::index_uni(1));
            current_statement__ = 186;
            stan::model::assign(eta_z,
              stan::math::add(stan::model::deep_copy(eta_z),
                (stan::model::rvalue(gamma_z, "gamma_z",
                   stan::model::index_uni(1)) - stan::math::min(eta_z))),
              "assigning variable eta_z");
          } else {
            current_statement__ = 183;
            stan::model::assign(eta_z,
              stan::math::add(stan::model::deep_copy(eta_z),
                stan::model::rvalue(gamma_z, "gamma_z",
                  stan::model::index_uni(1))), "assigning variable eta_z");
          }
        } else {
          current_statement__ = 181;
          if (stan::math::logical_gt(link_phi, 1)) {
            current_statement__ = 179;
            stan::model::assign(eta_z,
              stan::math::add(stan::model::deep_copy(eta_z),
                (stan::math::dot_product(zbar, omega) -
                stan::math::min(eta_z))), "assigning variable eta_z");
          } else {
            current_statement__ = 177;
            stan::model::assign(eta_z,
              stan::math::add(stan::model::deep_copy(eta_z),
                stan::math::dot_product(zbar, omega)),
              "assigning variable eta_z");
          }
        }
        current_statement__ = 271;
        if (stan::math::logical_gt(SSfun, 0)) {
          current_statement__ = 238;
          stan::math::validate_non_negative_index("eta_nlmer", "len_y", len_y);
          Eigen::Matrix<double,-1,1> eta_nlmer =
            Eigen::Matrix<double,-1,1>::Constant(len_y,
              std::numeric_limits<double>::quiet_NaN());
          current_statement__ = 240;
          stan::math::validate_non_negative_index("P", "len_y", len_y);
          current_statement__ = 241;
          stan::math::validate_non_negative_index("P", "K", K);
          Eigen::Matrix<double,-1,-1> P =
            Eigen::Matrix<double,-1,-1>::Constant(len_y, K,
              std::numeric_limits<double>::quiet_NaN());
          current_statement__ = 243;
          stan::model::assign(P, reshape_vec(eta, len_y, K, pstream__),
            "assigning variable P");
          current_statement__ = 267;
          if (stan::math::logical_lt(SSfun, 5)) {
            current_statement__ = 265;
            if (stan::math::logical_lte(SSfun, 2)) {
              current_statement__ = 263;
              if (stan::math::logical_eq(SSfun, 1)) {
                current_statement__ = 262;
                stan::model::assign(eta_nlmer, SS_asymp(input, P, pstream__),
                  "assigning variable eta_nlmer");
              } else {
                current_statement__ = 261;
                stan::model::assign(eta_nlmer,
                  SS_asympOff(input, P, pstream__),
                  "assigning variable eta_nlmer");
              }
            } else {
              current_statement__ = 260;
              if (stan::math::logical_eq(SSfun, 3)) {
                current_statement__ = 259;
                stan::model::assign(eta_nlmer,
                  SS_asympOrig(input, P, pstream__),
                  "assigning variable eta_nlmer");
              } else {
                current_statement__ = 258;
                stan::model::assign(eta_nlmer, SS_biexp(input, P, pstream__),
                  "assigning variable eta_nlmer");
              }
            }
          } else {
            current_statement__ = 256;
            if (stan::math::logical_lte(SSfun, 7)) {
              current_statement__ = 254;
              if (stan::math::logical_eq(SSfun, 5)) {
                current_statement__ = 253;
                stan::model::assign(eta_nlmer,
                  SS_fol(Dose, input, P, pstream__),
                  "assigning variable eta_nlmer");
              } else {
                current_statement__ = 252;
                if (stan::math::logical_eq(SSfun, 6)) {
                  current_statement__ = 251;
                  stan::model::assign(eta_nlmer, SS_fpl(input, P, pstream__),
                    "assigning variable eta_nlmer");
                } else {
                  current_statement__ = 250;
                  stan::model::assign(eta_nlmer,
                    SS_gompertz(input, P, pstream__),
                    "assigning variable eta_nlmer");
                }
              }
            } else {
              current_statement__ = 248;
              if (stan::math::logical_eq(SSfun, 8)) {
                current_statement__ = 247;
                stan::model::assign(eta_nlmer, SS_logis(input, P, pstream__),
                  "assigning variable eta_nlmer");
              } else {
                current_statement__ = 246;
                if (stan::math::logical_eq(SSfun, 9)) {
                  current_statement__ = 245;
                  stan::model::assign(eta_nlmer,
                    SS_micmen(input, P, pstream__),
                    "assigning variable eta_nlmer");
                } else {
                  current_statement__ = 244;
                  stan::model::assign(eta_nlmer,
                    SS_weibull(input, P, pstream__),
                    "assigning variable eta_nlmer");
                }
              }
            }
          }
          current_statement__ = 269;
          for (int n = 1; n <= len_y; ++n) {
            current_statement__ = 268;
            mean_PPD = (mean_PPD +
              stan::math::normal_rng(
                stan::model::rvalue(eta_nlmer, "eta_nlmer",
                  stan::model::index_uni(n)), aux, base_rng__));
          }
        } else {
          current_statement__ = 237;
          if (stan::math::logical_eq(family, 1)) {
            current_statement__ = 232;
            stan::math::validate_non_negative_index("mu", "N", N);
            Eigen::Matrix<double,-1,1> mu =
              Eigen::Matrix<double,-1,1>::Constant(N,
                std::numeric_limits<double>::quiet_NaN());
            current_statement__ = 233;
            stan::model::assign(mu,
              (stan::math::logical_gt(link, 1) ? stan::math::eval(
                                                   linkinv_gauss(eta, link,
                                                     pstream__)) : stan::math::eval(
                                                                    eta)),
              "assigning variable mu");
            current_statement__ = 235;
            for (int n = 1; n <= len_y; ++n) {
              current_statement__ = 234;
              mean_PPD = (mean_PPD +
                stan::math::normal_rng(
                  stan::model::rvalue(mu, "mu", stan::model::index_uni(n)),
                  aux, base_rng__));
            }
          } else {
            current_statement__ = 231;
            if (stan::math::logical_eq(family, 2)) {
              current_statement__ = 226;
              stan::math::validate_non_negative_index("mu", "N", N);
              Eigen::Matrix<double,-1,1> mu =
                Eigen::Matrix<double,-1,1>::Constant(N,
                  std::numeric_limits<double>::quiet_NaN());
              current_statement__ = 227;
              stan::model::assign(mu,
                (stan::math::logical_gt(link, 1) ? stan::math::eval(
                                                     linkinv_gamma(eta, link,
                                                       pstream__)) : 
                stan::math::eval(eta)), "assigning variable mu");
              current_statement__ = 229;
              for (int n = 1; n <= len_y; ++n) {
                current_statement__ = 228;
                mean_PPD = (mean_PPD +
                  stan::math::gamma_rng(aux, (aux /
                    stan::model::rvalue(mu, "mu", stan::model::index_uni(n))),
                    base_rng__));
              }
            } else {
              current_statement__ = 225;
              if (stan::math::logical_eq(family, 3)) {
                current_statement__ = 220;
                stan::math::validate_non_negative_index("mu", "N", N);
                Eigen::Matrix<double,-1,1> mu =
                  Eigen::Matrix<double,-1,1>::Constant(N,
                    std::numeric_limits<double>::quiet_NaN());
                current_statement__ = 221;
                stan::model::assign(mu,
                  (stan::math::logical_gt(link, 1) ? stan::math::eval(
                                                       linkinv_inv_gaussian(
                                                         eta, link, pstream__)) : 
                  stan::math::eval(eta)), "assigning variable mu");
                current_statement__ = 223;
                for (int n = 1; n <= len_y; ++n) {
                  current_statement__ = 222;
                  mean_PPD = (mean_PPD +
                    inv_gaussian_rng(
                      stan::model::rvalue(mu, "mu", stan::model::index_uni(n)),
                      aux, base_rng__, pstream__));
                }
              } else {
                current_statement__ = 219;
                if ((stan::math::primitive_value(
                       stan::math::logical_eq(family, 4))
                    &&
                    stan::math::primitive_value(
                      stan::math::logical_eq(link_phi, 0)))) {
                  current_statement__ = 207;
                  stan::math::validate_non_negative_index("mu", "N", N);
                  Eigen::Matrix<double,-1,1> mu =
                    Eigen::Matrix<double,-1,1>::Constant(N,
                      std::numeric_limits<double>::quiet_NaN());
                  current_statement__ = 208;
                  stan::model::assign(mu, linkinv_beta(eta, link, pstream__),
                    "assigning variable mu");
                  current_statement__ = 217;
                  for (int n = 1; n <= N; ++n) {
                    double mu_n = std::numeric_limits<double>::quiet_NaN();
                    current_statement__ = 209;
                    mu_n = stan::model::rvalue(mu, "mu",
                             stan::model::index_uni(n));
                    current_statement__ = 215;
                    if (stan::math::logical_lte(aux, 0)) {
                      current_statement__ = 214;
                      mean_PPD = (mean_PPD +
                        stan::math::bernoulli_rng(0.5, base_rng__));
                    } else {
                      current_statement__ = 213;
                      if (stan::math::logical_gte(mu_n, 1)) {
                        current_statement__ = 212;
                        mean_PPD = (mean_PPD + 1);
                      } else {
                        current_statement__ = 211;
                        if (stan::math::logical_gt(mu_n, 0)) {
                          current_statement__ = 210;
                          mean_PPD = (mean_PPD +
                            stan::math::beta_rng((mu_n * aux), ((1 - mu_n) *
                              aux), base_rng__));
                        }
                      }
                    }
                  }
                } else {
                  current_statement__ = 206;
                  if ((stan::math::primitive_value(
                         stan::math::logical_eq(family, 4))
                      &&
                      stan::math::primitive_value(
                        stan::math::logical_gt(link_phi, 0)))) {
                    current_statement__ = 191;
                    stan::math::validate_non_negative_index("mu", "N", N);
                    Eigen::Matrix<double,-1,1> mu =
                      Eigen::Matrix<double,-1,1>::Constant(N,
                        std::numeric_limits<double>::quiet_NaN());
                    current_statement__ = 192;
                    stan::model::assign(mu,
                      linkinv_beta(eta, link, pstream__),
                      "assigning variable mu");
                    current_statement__ = 193;
                    stan::math::validate_non_negative_index("phi", "N", N);
                    Eigen::Matrix<double,-1,1> phi =
                      Eigen::Matrix<double,-1,1>::Constant(N,
                        std::numeric_limits<double>::quiet_NaN());
                    current_statement__ = 194;
                    stan::model::assign(phi,
                      linkinv_beta_z(eta_z, link_phi, pstream__),
                      "assigning variable phi");
                    current_statement__ = 204;
                    for (int n = 1; n <= N; ++n) {
                      double mu_n = std::numeric_limits<double>::quiet_NaN();
                      current_statement__ = 195;
                      mu_n = stan::model::rvalue(mu, "mu",
                               stan::model::index_uni(n));
                      double aux_n = std::numeric_limits<double>::quiet_NaN();
                      current_statement__ = 196;
                      aux_n = stan::model::rvalue(phi, "phi",
                                stan::model::index_uni(n));
                      current_statement__ = 202;
                      if (stan::math::logical_lte(aux_n, 0)) {
                        current_statement__ = 201;
                        mean_PPD = (mean_PPD +
                          stan::math::bernoulli_rng(0.5, base_rng__));
                      } else {
                        current_statement__ = 200;
                        if (stan::math::logical_gte(mu_n, 1)) {
                          current_statement__ = 199;
                          mean_PPD = (mean_PPD + 1);
                        } else {
                          current_statement__ = 198;
                          if (stan::math::logical_gt(mu_n, 0)) {
                            current_statement__ = 197;
                            mean_PPD = (mean_PPD +
                              stan::math::beta_rng((mu_n * aux_n), ((1 -
                                mu_n) * aux_n), base_rng__));
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        current_statement__ = 272;
        mean_PPD = (mean_PPD / len_y);
      }
      out__.write(mean_PPD);
      out__.write(alpha);
      out__.write(omega_int);
    } 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__> gamma =
        std::vector<local_scalar_t__>(has_intercept, DUMMY_VAR__);
      current_statement__ = 1;
      stan::model::assign(gamma,
        in__.read<std::vector<local_scalar_t__>>(has_intercept),
        "assigning variable gamma");
      out__.write_free_lub(make_lower(family, link, pstream__),
        make_upper(family, link, pstream__), gamma);
      Eigen::Matrix<local_scalar_t__,-1,1> z_beta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_beta_1dim__,
          DUMMY_VAR__);
      current_statement__ = 2;
      stan::model::assign(z_beta,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(z_beta_1dim__),
        "assigning variable z_beta");
      out__.write(z_beta);
      Eigen::Matrix<local_scalar_t__,-1,1> z_beta_smooth =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K_smooth, DUMMY_VAR__);
      current_statement__ = 3;
      stan::model::assign(z_beta_smooth,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(K_smooth),
        "assigning variable z_beta_smooth");
      out__.write(z_beta_smooth);
      Eigen::Matrix<local_scalar_t__,-1,1> smooth_sd_raw =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(smooth_sd_raw_1dim__,
          DUMMY_VAR__);
      current_statement__ = 4;
      stan::model::assign(smooth_sd_raw,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(smooth_sd_raw_1dim__),
        "assigning variable smooth_sd_raw");
      out__.write_free_lb(0, smooth_sd_raw);
      std::vector<local_scalar_t__> global =
        std::vector<local_scalar_t__>(hs, DUMMY_VAR__);
      current_statement__ = 5;
      stan::model::assign(global,
        in__.read<std::vector<local_scalar_t__>>(hs),
        "assigning variable global");
      out__.write_free_lb(0, global);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> local =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(hs,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__));
      current_statement__ = 6;
      for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
        current_statement__ = 6;
        for (int sym2__ = 1; sym2__ <= hs; ++sym2__) {
          current_statement__ = 6;
          stan::model::assign(local, in__.read<local_scalar_t__>(),
            "assigning variable local", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, local);
      std::vector<local_scalar_t__> caux =
        std::vector<local_scalar_t__>(caux_1dim__, DUMMY_VAR__);
      current_statement__ = 7;
      stan::model::assign(caux,
        in__.read<std::vector<local_scalar_t__>>(caux_1dim__),
        "assigning variable caux");
      out__.write_free_lb(0, caux);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> mix =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(mix_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__));
      current_statement__ = 8;
      for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
        current_statement__ = 8;
        for (int sym2__ = 1; sym2__ <= mix_1dim__; ++sym2__) {
          current_statement__ = 8;
          stan::model::assign(mix, in__.read<local_scalar_t__>(),
            "assigning variable mix", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, mix);
      std::vector<local_scalar_t__> one_over_lambda =
        std::vector<local_scalar_t__>(one_over_lambda_1dim__, DUMMY_VAR__);
      current_statement__ = 9;
      stan::model::assign(one_over_lambda,
        in__.read<std::vector<local_scalar_t__>>(one_over_lambda_1dim__),
        "assigning variable one_over_lambda");
      out__.write_free_lb(0, one_over_lambda);
      Eigen::Matrix<local_scalar_t__,-1,1> z_b =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(q, DUMMY_VAR__);
      current_statement__ = 10;
      stan::model::assign(z_b,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(q),
        "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(len_z_T, DUMMY_VAR__);
      current_statement__ = 11;
      stan::model::assign(z_T,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(len_z_T),
        "assigning variable z_T");
      out__.write(z_T);
      Eigen::Matrix<local_scalar_t__,-1,1> rho =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(len_rho, DUMMY_VAR__);
      current_statement__ = 12;
      stan::model::assign(rho,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(len_rho),
        "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(len_concentration,
          DUMMY_VAR__);
      current_statement__ = 13;
      stan::model::assign(zeta,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(len_concentration),
        "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(t, DUMMY_VAR__);
      current_statement__ = 14;
      stan::model::assign(tau,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(t),
        "assigning variable tau");
      out__.write_free_lb(0, tau);
      local_scalar_t__ aux_unscaled = DUMMY_VAR__;
      current_statement__ = 15;
      aux_unscaled = in__.read<local_scalar_t__>();
      out__.write_free_lb(0, aux_unscaled);
      Eigen::Matrix<local_scalar_t__,-1,1> z_omega =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_omega_1dim__,
          DUMMY_VAR__);
      current_statement__ = 16;
      stan::model::assign(z_omega,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(z_omega_1dim__),
        "assigning variable z_omega");
      out__.write(z_omega);
      std::vector<local_scalar_t__> gamma_z =
        std::vector<local_scalar_t__>(has_intercept_z, DUMMY_VAR__);
      current_statement__ = 17;
      stan::model::assign(gamma_z,
        in__.read<std::vector<local_scalar_t__>>(has_intercept_z),
        "assigning variable gamma_z");
      out__.write_free_lb((stan::math::logical_lte(link_phi, 1) ? stan::math::negative_infinity(
                                                                    ) : 0),
        gamma_z);
      std::vector<local_scalar_t__> global_z =
        std::vector<local_scalar_t__>(hs_z, DUMMY_VAR__);
      current_statement__ = 18;
      stan::model::assign(global_z,
        in__.read<std::vector<local_scalar_t__>>(hs_z),
        "assigning variable global_z");
      out__.write_free_lb(0, global_z);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> local_z =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(hs_z,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_dim, DUMMY_VAR__));
      current_statement__ = 19;
      for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
        current_statement__ = 19;
        for (int sym2__ = 1; sym2__ <= hs_z; ++sym2__) {
          current_statement__ = 19;
          stan::model::assign(local_z, in__.read<local_scalar_t__>(),
            "assigning variable local_z", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, local_z);
      std::vector<local_scalar_t__> caux_z =
        std::vector<local_scalar_t__>(caux_z_1dim__, DUMMY_VAR__);
      current_statement__ = 20;
      stan::model::assign(caux_z,
        in__.read<std::vector<local_scalar_t__>>(caux_z_1dim__),
        "assigning variable caux_z");
      out__.write_free_lb(0, caux_z);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> S_z =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(S_z_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_dim, DUMMY_VAR__));
      current_statement__ = 21;
      for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
        current_statement__ = 21;
        for (int sym2__ = 1; sym2__ <= S_z_1dim__; ++sym2__) {
          current_statement__ = 21;
          stan::model::assign(S_z, in__.read<local_scalar_t__>(),
            "assigning variable S_z", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, S_z);
      std::vector<local_scalar_t__> one_over_lambda_z =
        std::vector<local_scalar_t__>(one_over_lambda_z_1dim__, DUMMY_VAR__);
      current_statement__ = 22;
      stan::model::assign(one_over_lambda_z,
        in__.read<std::vector<local_scalar_t__>>(one_over_lambda_z_1dim__),
        "assigning variable one_over_lambda_z");
      out__.write_free_lb(0, one_over_lambda_z);
    } 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", "gamma", "double",
        std::vector<size_t>{static_cast<size_t>(has_intercept)});
      current_statement__ = 2;
      context__.validate_dims("parameter initialization", "z_beta", "double",
        std::vector<size_t>{static_cast<size_t>(z_beta_1dim__)});
      current_statement__ = 3;
      context__.validate_dims("parameter initialization", "z_beta_smooth",
        "double", std::vector<size_t>{static_cast<size_t>(K_smooth)});
      current_statement__ = 4;
      context__.validate_dims("parameter initialization", "smooth_sd_raw",
        "double",
        std::vector<size_t>{static_cast<size_t>(smooth_sd_raw_1dim__)});
      current_statement__ = 5;
      context__.validate_dims("parameter initialization", "global", "double",
        std::vector<size_t>{static_cast<size_t>(hs)});
      current_statement__ = 6;
      context__.validate_dims("parameter initialization", "local", "double",
        std::vector<size_t>{static_cast<size_t>(hs), static_cast<size_t>(K)});
      current_statement__ = 7;
      context__.validate_dims("parameter initialization", "caux", "double",
        std::vector<size_t>{static_cast<size_t>(caux_1dim__)});
      current_statement__ = 8;
      context__.validate_dims("parameter initialization", "mix", "double",
        std::vector<size_t>{static_cast<size_t>(mix_1dim__),
          static_cast<size_t>(K)});
      current_statement__ = 9;
      context__.validate_dims("parameter initialization", "one_over_lambda",
        "double",
        std::vector<size_t>{static_cast<size_t>(one_over_lambda_1dim__)});
      current_statement__ = 10;
      context__.validate_dims("parameter initialization", "z_b", "double",
        std::vector<size_t>{static_cast<size_t>(q)});
      current_statement__ = 11;
      context__.validate_dims("parameter initialization", "z_T", "double",
        std::vector<size_t>{static_cast<size_t>(len_z_T)});
      current_statement__ = 12;
      context__.validate_dims("parameter initialization", "rho", "double",
        std::vector<size_t>{static_cast<size_t>(len_rho)});
      current_statement__ = 13;
      context__.validate_dims("parameter initialization", "zeta", "double",
        std::vector<size_t>{static_cast<size_t>(len_concentration)});
      current_statement__ = 14;
      context__.validate_dims("parameter initialization", "tau", "double",
        std::vector<size_t>{static_cast<size_t>(t)});
      current_statement__ = 15;
      context__.validate_dims("parameter initialization", "aux_unscaled",
        "double", std::vector<size_t>{});
      current_statement__ = 16;
      context__.validate_dims("parameter initialization", "z_omega",
        "double", std::vector<size_t>{static_cast<size_t>(z_omega_1dim__)});
      current_statement__ = 17;
      context__.validate_dims("parameter initialization", "gamma_z",
        "double", std::vector<size_t>{static_cast<size_t>(has_intercept_z)});
      current_statement__ = 18;
      context__.validate_dims("parameter initialization", "global_z",
        "double", std::vector<size_t>{static_cast<size_t>(hs_z)});
      current_statement__ = 19;
      context__.validate_dims("parameter initialization", "local_z",
        "double",
        std::vector<size_t>{static_cast<size_t>(hs_z),
          static_cast<size_t>(z_dim)});
      current_statement__ = 20;
      context__.validate_dims("parameter initialization", "caux_z", "double",
        std::vector<size_t>{static_cast<size_t>(caux_z_1dim__)});
      current_statement__ = 21;
      context__.validate_dims("parameter initialization", "S_z", "double",
        std::vector<size_t>{static_cast<size_t>(S_z_1dim__),
          static_cast<size_t>(z_dim)});
      current_statement__ = 22;
      context__.validate_dims("parameter initialization",
        "one_over_lambda_z", "double",
        std::vector<size_t>{static_cast<size_t>(one_over_lambda_z_1dim__)});
      int pos__ = std::numeric_limits<int>::min();
      pos__ = 1;
      std::vector<local_scalar_t__> gamma =
        std::vector<local_scalar_t__>(has_intercept, DUMMY_VAR__);
      current_statement__ = 1;
      gamma = context__.vals_r("gamma");
      out__.write_free_lub(make_lower(family, link, pstream__),
        make_upper(family, link, pstream__), gamma);
      Eigen::Matrix<local_scalar_t__,-1,1> z_beta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_beta_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_beta_flat__;
        current_statement__ = 2;
        z_beta_flat__ = context__.vals_r("z_beta");
        current_statement__ = 2;
        pos__ = 1;
        current_statement__ = 2;
        for (int sym1__ = 1; sym1__ <= z_beta_1dim__; ++sym1__) {
          current_statement__ = 2;
          stan::model::assign(z_beta, z_beta_flat__[(pos__ - 1)],
            "assigning variable z_beta", stan::model::index_uni(sym1__));
          current_statement__ = 2;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_beta);
      Eigen::Matrix<local_scalar_t__,-1,1> z_beta_smooth =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K_smooth, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_beta_smooth_flat__;
        current_statement__ = 3;
        z_beta_smooth_flat__ = context__.vals_r("z_beta_smooth");
        current_statement__ = 3;
        pos__ = 1;
        current_statement__ = 3;
        for (int sym1__ = 1; sym1__ <= K_smooth; ++sym1__) {
          current_statement__ = 3;
          stan::model::assign(z_beta_smooth, z_beta_smooth_flat__[(pos__ -
            1)], "assigning variable z_beta_smooth",
            stan::model::index_uni(sym1__));
          current_statement__ = 3;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_beta_smooth);
      Eigen::Matrix<local_scalar_t__,-1,1> smooth_sd_raw =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(smooth_sd_raw_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> smooth_sd_raw_flat__;
        current_statement__ = 4;
        smooth_sd_raw_flat__ = context__.vals_r("smooth_sd_raw");
        current_statement__ = 4;
        pos__ = 1;
        current_statement__ = 4;
        for (int sym1__ = 1; sym1__ <= smooth_sd_raw_1dim__; ++sym1__) {
          current_statement__ = 4;
          stan::model::assign(smooth_sd_raw, smooth_sd_raw_flat__[(pos__ -
            1)], "assigning variable smooth_sd_raw",
            stan::model::index_uni(sym1__));
          current_statement__ = 4;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, smooth_sd_raw);
      std::vector<local_scalar_t__> global =
        std::vector<local_scalar_t__>(hs, DUMMY_VAR__);
      current_statement__ = 5;
      global = context__.vals_r("global");
      out__.write_free_lb(0, global);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> local =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(hs,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> local_flat__;
        current_statement__ = 6;
        local_flat__ = context__.vals_r("local");
        current_statement__ = 6;
        pos__ = 1;
        current_statement__ = 6;
        for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
          current_statement__ = 6;
          for (int sym2__ = 1; sym2__ <= hs; ++sym2__) {
            current_statement__ = 6;
            stan::model::assign(local, local_flat__[(pos__ - 1)],
              "assigning variable local", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 6;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, local);
      std::vector<local_scalar_t__> caux =
        std::vector<local_scalar_t__>(caux_1dim__, DUMMY_VAR__);
      current_statement__ = 7;
      caux = context__.vals_r("caux");
      out__.write_free_lb(0, caux);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> mix =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(mix_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(K, DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> mix_flat__;
        current_statement__ = 8;
        mix_flat__ = context__.vals_r("mix");
        current_statement__ = 8;
        pos__ = 1;
        current_statement__ = 8;
        for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
          current_statement__ = 8;
          for (int sym2__ = 1; sym2__ <= mix_1dim__; ++sym2__) {
            current_statement__ = 8;
            stan::model::assign(mix, mix_flat__[(pos__ - 1)],
              "assigning variable mix", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 8;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, mix);
      std::vector<local_scalar_t__> one_over_lambda =
        std::vector<local_scalar_t__>(one_over_lambda_1dim__, DUMMY_VAR__);
      current_statement__ = 9;
      one_over_lambda = context__.vals_r("one_over_lambda");
      out__.write_free_lb(0, one_over_lambda);
      Eigen::Matrix<local_scalar_t__,-1,1> z_b =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(q, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_b_flat__;
        current_statement__ = 10;
        z_b_flat__ = context__.vals_r("z_b");
        current_statement__ = 10;
        pos__ = 1;
        current_statement__ = 10;
        for (int sym1__ = 1; sym1__ <= q; ++sym1__) {
          current_statement__ = 10;
          stan::model::assign(z_b, z_b_flat__[(pos__ - 1)],
            "assigning variable z_b", stan::model::index_uni(sym1__));
          current_statement__ = 10;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_b);
      Eigen::Matrix<local_scalar_t__,-1,1> z_T =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(len_z_T, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_T_flat__;
        current_statement__ = 11;
        z_T_flat__ = context__.vals_r("z_T");
        current_statement__ = 11;
        pos__ = 1;
        current_statement__ = 11;
        for (int sym1__ = 1; sym1__ <= len_z_T; ++sym1__) {
          current_statement__ = 11;
          stan::model::assign(z_T, z_T_flat__[(pos__ - 1)],
            "assigning variable z_T", stan::model::index_uni(sym1__));
          current_statement__ = 11;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_T);
      Eigen::Matrix<local_scalar_t__,-1,1> rho =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(len_rho, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> rho_flat__;
        current_statement__ = 12;
        rho_flat__ = context__.vals_r("rho");
        current_statement__ = 12;
        pos__ = 1;
        current_statement__ = 12;
        for (int sym1__ = 1; sym1__ <= len_rho; ++sym1__) {
          current_statement__ = 12;
          stan::model::assign(rho, rho_flat__[(pos__ - 1)],
            "assigning variable rho", stan::model::index_uni(sym1__));
          current_statement__ = 12;
          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(len_concentration,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> zeta_flat__;
        current_statement__ = 13;
        zeta_flat__ = context__.vals_r("zeta");
        current_statement__ = 13;
        pos__ = 1;
        current_statement__ = 13;
        for (int sym1__ = 1; sym1__ <= len_concentration; ++sym1__) {
          current_statement__ = 13;
          stan::model::assign(zeta, zeta_flat__[(pos__ - 1)],
            "assigning variable zeta", stan::model::index_uni(sym1__));
          current_statement__ = 13;
          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(t, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> tau_flat__;
        current_statement__ = 14;
        tau_flat__ = context__.vals_r("tau");
        current_statement__ = 14;
        pos__ = 1;
        current_statement__ = 14;
        for (int sym1__ = 1; sym1__ <= t; ++sym1__) {
          current_statement__ = 14;
          stan::model::assign(tau, tau_flat__[(pos__ - 1)],
            "assigning variable tau", stan::model::index_uni(sym1__));
          current_statement__ = 14;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, tau);
      local_scalar_t__ aux_unscaled = DUMMY_VAR__;
      current_statement__ = 15;
      aux_unscaled = context__.vals_r("aux_unscaled")[(1 - 1)];
      out__.write_free_lb(0, aux_unscaled);
      Eigen::Matrix<local_scalar_t__,-1,1> z_omega =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_omega_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_omega_flat__;
        current_statement__ = 16;
        z_omega_flat__ = context__.vals_r("z_omega");
        current_statement__ = 16;
        pos__ = 1;
        current_statement__ = 16;
        for (int sym1__ = 1; sym1__ <= z_omega_1dim__; ++sym1__) {
          current_statement__ = 16;
          stan::model::assign(z_omega, z_omega_flat__[(pos__ - 1)],
            "assigning variable z_omega", stan::model::index_uni(sym1__));
          current_statement__ = 16;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_omega);
      std::vector<local_scalar_t__> gamma_z =
        std::vector<local_scalar_t__>(has_intercept_z, DUMMY_VAR__);
      current_statement__ = 17;
      gamma_z = context__.vals_r("gamma_z");
      out__.write_free_lb((stan::math::logical_lte(link_phi, 1) ? stan::math::negative_infinity(
                                                                    ) : 0),
        gamma_z);
      std::vector<local_scalar_t__> global_z =
        std::vector<local_scalar_t__>(hs_z, DUMMY_VAR__);
      current_statement__ = 18;
      global_z = context__.vals_r("global_z");
      out__.write_free_lb(0, global_z);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> local_z =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(hs_z,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_dim, DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> local_z_flat__;
        current_statement__ = 19;
        local_z_flat__ = context__.vals_r("local_z");
        current_statement__ = 19;
        pos__ = 1;
        current_statement__ = 19;
        for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
          current_statement__ = 19;
          for (int sym2__ = 1; sym2__ <= hs_z; ++sym2__) {
            current_statement__ = 19;
            stan::model::assign(local_z, local_z_flat__[(pos__ - 1)],
              "assigning variable local_z", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 19;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, local_z);
      std::vector<local_scalar_t__> caux_z =
        std::vector<local_scalar_t__>(caux_z_1dim__, DUMMY_VAR__);
      current_statement__ = 20;
      caux_z = context__.vals_r("caux_z");
      out__.write_free_lb(0, caux_z);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> S_z =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(S_z_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_dim, DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> S_z_flat__;
        current_statement__ = 21;
        S_z_flat__ = context__.vals_r("S_z");
        current_statement__ = 21;
        pos__ = 1;
        current_statement__ = 21;
        for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
          current_statement__ = 21;
          for (int sym2__ = 1; sym2__ <= S_z_1dim__; ++sym2__) {
            current_statement__ = 21;
            stan::model::assign(S_z, S_z_flat__[(pos__ - 1)],
              "assigning variable S_z", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 21;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, S_z);
      std::vector<local_scalar_t__> one_over_lambda_z =
        std::vector<local_scalar_t__>(one_over_lambda_z_1dim__, DUMMY_VAR__);
      current_statement__ = 22;
      one_over_lambda_z = context__.vals_r("one_over_lambda_z");
      out__.write_free_lb(0, one_over_lambda_z);
    } 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>{"gamma", "z_beta", "z_beta_smooth",
                "smooth_sd_raw", "global", "local", "caux", "mix",
                "one_over_lambda", "z_b", "z_T", "rho", "zeta", "tau",
                "aux_unscaled", "z_omega", "gamma_z", "global_z", "local_z",
                "caux_z", "S_z", "one_over_lambda_z"};
    if (emit_transformed_parameters__) {
      std::vector<std::string>
        temp{"aux", "omega", "beta", "beta_smooth", "smooth_sd", "b",
             "theta_L"};
      names__.reserve(names__.size() + temp.size());
      names__.insert(names__.end(), temp.begin(), temp.end());
    }
    if (emit_generated_quantities__) {
      std::vector<std::string> temp{"mean_PPD", "alpha", "omega_int"};
      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>(
                                                                    has_intercept)},
                std::vector<size_t>{static_cast<size_t>(z_beta_1dim__)},
                std::vector<size_t>{static_cast<size_t>(K_smooth)},
                std::vector<size_t>{static_cast<size_t>(smooth_sd_raw_1dim__)},
                std::vector<size_t>{static_cast<size_t>(hs)},
                std::vector<size_t>{static_cast<size_t>(hs),
                  static_cast<size_t>(K)},
                std::vector<size_t>{static_cast<size_t>(caux_1dim__)},
                std::vector<size_t>{static_cast<size_t>(mix_1dim__),
                  static_cast<size_t>(K)},
                std::vector<size_t>{static_cast<size_t>(
                                      one_over_lambda_1dim__)},
                std::vector<size_t>{static_cast<size_t>(q)},
                std::vector<size_t>{static_cast<size_t>(len_z_T)},
                std::vector<size_t>{static_cast<size_t>(len_rho)},
                std::vector<size_t>{static_cast<size_t>(len_concentration)},
                std::vector<size_t>{static_cast<size_t>(t)},
                std::vector<size_t>{},
                std::vector<size_t>{static_cast<size_t>(z_omega_1dim__)},
                std::vector<size_t>{static_cast<size_t>(has_intercept_z)},
                std::vector<size_t>{static_cast<size_t>(hs_z)},
                std::vector<size_t>{static_cast<size_t>(hs_z),
                  static_cast<size_t>(z_dim)},
                std::vector<size_t>{static_cast<size_t>(caux_z_1dim__)},
                std::vector<size_t>{static_cast<size_t>(S_z_1dim__),
                  static_cast<size_t>(z_dim)},
                std::vector<size_t>{static_cast<size_t>(
                                      one_over_lambda_z_1dim__)}};
    if (emit_transformed_parameters__) {
      std::vector<std::vector<size_t>>
        temp{std::vector<size_t>{},
             std::vector<size_t>{static_cast<size_t>(z_dim)},
             std::vector<size_t>{static_cast<size_t>(K)},
             std::vector<size_t>{static_cast<size_t>(K_smooth)},
             std::vector<size_t>{static_cast<size_t>(smooth_sd_1dim__)},
             std::vector<size_t>{static_cast<size_t>(q)},
             std::vector<size_t>{static_cast<size_t>(len_theta_L)}};
      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>(has_intercept)},
             std::vector<size_t>{static_cast<size_t>(has_intercept_z)}};
      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__ <= has_intercept; ++sym1__) {
      param_names__.emplace_back(std::string() + "gamma" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_beta_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_beta" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= K_smooth; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_beta_smooth" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= smooth_sd_raw_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "smooth_sd_raw" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= hs; ++sym1__) {
      param_names__.emplace_back(std::string() + "global" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= hs; ++sym2__) {
        param_names__.emplace_back(std::string() + "local" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= caux_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "caux" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= mix_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "mix" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= one_over_lambda_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "one_over_lambda" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= q; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_b" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= len_z_T; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_T" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= len_rho; ++sym1__) {
      param_names__.emplace_back(std::string() + "rho" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= len_concentration; ++sym1__) {
      param_names__.emplace_back(std::string() + "zeta" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= t; ++sym1__) {
      param_names__.emplace_back(std::string() + "tau" + '.' +
        std::to_string(sym1__));
    }
    param_names__.emplace_back(std::string() + "aux_unscaled");
    for (int sym1__ = 1; sym1__ <= z_omega_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_omega" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= has_intercept_z; ++sym1__) {
      param_names__.emplace_back(std::string() + "gamma_z" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= hs_z; ++sym1__) {
      param_names__.emplace_back(std::string() + "global_z" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= hs_z; ++sym2__) {
        param_names__.emplace_back(std::string() + "local_z" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= caux_z_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "caux_z" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= S_z_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "S_z" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= one_over_lambda_z_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "one_over_lambda_z" + '.' +
        std::to_string(sym1__));
    }
    if (emit_transformed_parameters__) {
      param_names__.emplace_back(std::string() + "aux");
      for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
        param_names__.emplace_back(std::string() + "omega" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
        param_names__.emplace_back(std::string() + "beta" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= K_smooth; ++sym1__) {
        param_names__.emplace_back(std::string() + "beta_smooth" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= smooth_sd_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "smooth_sd" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= q; ++sym1__) {
        param_names__.emplace_back(std::string() + "b" + '.' +
          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__));
      }
    }
    if (emit_generated_quantities__) {
      param_names__.emplace_back(std::string() + "mean_PPD");
      for (int sym1__ = 1; sym1__ <= has_intercept; ++sym1__) {
        param_names__.emplace_back(std::string() + "alpha" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= has_intercept_z; ++sym1__) {
        param_names__.emplace_back(std::string() + "omega_int" + '.' +
          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__ <= has_intercept; ++sym1__) {
      param_names__.emplace_back(std::string() + "gamma" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_beta_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_beta" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= K_smooth; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_beta_smooth" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= smooth_sd_raw_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "smooth_sd_raw" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= hs; ++sym1__) {
      param_names__.emplace_back(std::string() + "global" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= hs; ++sym2__) {
        param_names__.emplace_back(std::string() + "local" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= caux_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "caux" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= mix_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "mix" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= one_over_lambda_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "one_over_lambda" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= q; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_b" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= len_z_T; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_T" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= len_rho; ++sym1__) {
      param_names__.emplace_back(std::string() + "rho" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= len_concentration; ++sym1__) {
      param_names__.emplace_back(std::string() + "zeta" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= t; ++sym1__) {
      param_names__.emplace_back(std::string() + "tau" + '.' +
        std::to_string(sym1__));
    }
    param_names__.emplace_back(std::string() + "aux_unscaled");
    for (int sym1__ = 1; sym1__ <= z_omega_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_omega" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= has_intercept_z; ++sym1__) {
      param_names__.emplace_back(std::string() + "gamma_z" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= hs_z; ++sym1__) {
      param_names__.emplace_back(std::string() + "global_z" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= hs_z; ++sym2__) {
        param_names__.emplace_back(std::string() + "local_z" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= caux_z_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "caux_z" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= S_z_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "S_z" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= one_over_lambda_z_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "one_over_lambda_z" + '.' +
        std::to_string(sym1__));
    }
    if (emit_transformed_parameters__) {
      param_names__.emplace_back(std::string() + "aux");
      for (int sym1__ = 1; sym1__ <= z_dim; ++sym1__) {
        param_names__.emplace_back(std::string() + "omega" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= K; ++sym1__) {
        param_names__.emplace_back(std::string() + "beta" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= K_smooth; ++sym1__) {
        param_names__.emplace_back(std::string() + "beta_smooth" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= smooth_sd_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "smooth_sd" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= q; ++sym1__) {
        param_names__.emplace_back(std::string() + "b" + '.' +
          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__));
      }
    }
    if (emit_generated_quantities__) {
      param_names__.emplace_back(std::string() + "mean_PPD");
      for (int sym1__ = 1; sym1__ <= has_intercept; ++sym1__) {
        param_names__.emplace_back(std::string() + "alpha" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= has_intercept_z; ++sym1__) {
        param_names__.emplace_back(std::string() + "omega_int" + '.' +
          std::to_string(sym1__));
      }
    }
  }
  inline std::string get_constrained_sizedtypes() const {
    return std::string("[{\"name\":\"gamma\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(has_intercept) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"z_beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_beta_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_beta_smooth\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(K_smooth) + "},\"block\":\"parameters\"},{\"name\":\"smooth_sd_raw\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(smooth_sd_raw_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"global\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(hs) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"local\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(hs) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(K) + "}},\"block\":\"parameters\"},{\"name\":\"caux\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(caux_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"mix\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(mix_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(K) + "}},\"block\":\"parameters\"},{\"name\":\"one_over_lambda\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(one_over_lambda_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"z_b\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(q) + "},\"block\":\"parameters\"},{\"name\":\"z_T\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(len_z_T) + "},\"block\":\"parameters\"},{\"name\":\"rho\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(len_rho) + "},\"block\":\"parameters\"},{\"name\":\"zeta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(len_concentration) + "},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(t) + "},\"block\":\"parameters\"},{\"name\":\"aux_unscaled\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"z_omega\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_omega_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"gamma_z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(has_intercept_z) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"global_z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(hs_z) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"local_z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(hs_z) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_dim) + "}},\"block\":\"parameters\"},{\"name\":\"caux_z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(caux_z_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"S_z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(S_z_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_dim) + "}},\"block\":\"parameters\"},{\"name\":\"one_over_lambda_z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(one_over_lambda_z_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"aux\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"omega\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_dim) + "},\"block\":\"transformed_parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(K) + "},\"block\":\"transformed_parameters\"},{\"name\":\"beta_smooth\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(K_smooth) + "},\"block\":\"transformed_parameters\"},{\"name\":\"smooth_sd\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(smooth_sd_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"b\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(q) + "},\"block\":\"transformed_parameters\"},{\"name\":\"theta_L\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(len_theta_L) + "},\"block\":\"transformed_parameters\"},{\"name\":\"mean_PPD\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"alpha\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(has_intercept) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"omega_int\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(has_intercept_z) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"}]");
  }
  inline std::string get_unconstrained_sizedtypes() const {
    return std::string("[{\"name\":\"gamma\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(has_intercept) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"z_beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_beta_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_beta_smooth\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(K_smooth) + "},\"block\":\"parameters\"},{\"name\":\"smooth_sd_raw\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(smooth_sd_raw_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"global\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(hs) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"local\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(hs) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(K) + "}},\"block\":\"parameters\"},{\"name\":\"caux\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(caux_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"mix\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(mix_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(K) + "}},\"block\":\"parameters\"},{\"name\":\"one_over_lambda\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(one_over_lambda_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"z_b\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(q) + "},\"block\":\"parameters\"},{\"name\":\"z_T\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(len_z_T) + "},\"block\":\"parameters\"},{\"name\":\"rho\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(len_rho) + "},\"block\":\"parameters\"},{\"name\":\"zeta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(len_concentration) + "},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(t) + "},\"block\":\"parameters\"},{\"name\":\"aux_unscaled\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"},{\"name\":\"z_omega\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_omega_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"gamma_z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(has_intercept_z) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"global_z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(hs_z) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"local_z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(hs_z) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_dim) + "}},\"block\":\"parameters\"},{\"name\":\"caux_z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(caux_z_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"S_z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(S_z_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_dim) + "}},\"block\":\"parameters\"},{\"name\":\"one_over_lambda_z\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(one_over_lambda_z_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"aux\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"omega\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_dim) + "},\"block\":\"transformed_parameters\"},{\"name\":\"beta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(K) + "},\"block\":\"transformed_parameters\"},{\"name\":\"beta_smooth\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(K_smooth) + "},\"block\":\"transformed_parameters\"},{\"name\":\"smooth_sd\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(smooth_sd_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"b\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(q) + "},\"block\":\"transformed_parameters\"},{\"name\":\"theta_L\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(len_theta_L) + "},\"block\":\"transformed_parameters\"},{\"name\":\"mean_PPD\",\"type\":{\"name\":\"real\"},\"block\":\"generated_quantities\"},{\"name\":\"alpha\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(has_intercept) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"omega_int\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(has_intercept_z) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"}]");
  }
  // Begin method overload boilerplate
  template <typename RNG> inline void
  write_array(RNG& base_rng, Eigen::Matrix<double,-1,1>& params_r,
              Eigen::Matrix<double,-1,1>& vars, const bool
              emit_transformed_parameters = true, const bool
              emit_generated_quantities = true, std::ostream*
              pstream = nullptr) const {
    const size_t num_params__ = (((((((((((((((((((((has_intercept +
      z_beta_1dim__) + K_smooth) + smooth_sd_raw_1dim__) + hs) + (hs * K)) +
      caux_1dim__) + (mix_1dim__ * K)) + one_over_lambda_1dim__) + q) +
      len_z_T) + len_rho) + len_concentration) + t) + 1) + z_omega_1dim__) +
      has_intercept_z) + hs_z) + (hs_z * z_dim)) + caux_z_1dim__) +
      (S_z_1dim__ * z_dim)) + one_over_lambda_z_1dim__);
    const size_t num_transformed = emit_transformed_parameters * (((((((1 +
      z_dim) + K) + K_smooth) + smooth_sd_1dim__) + q) + len_theta_L));
    const size_t num_gen_quantities = emit_generated_quantities * (((1 +
      has_intercept) + has_intercept_z));
    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__ = (((((((((((((((((((((has_intercept +
      z_beta_1dim__) + K_smooth) + smooth_sd_raw_1dim__) + hs) + (hs * K)) +
      caux_1dim__) + (mix_1dim__ * K)) + one_over_lambda_1dim__) + q) +
      len_z_T) + len_rho) + len_concentration) + t) + 1) + z_omega_1dim__) +
      has_intercept_z) + hs_z) + (hs_z * z_dim)) + caux_z_1dim__) +
      (S_z_1dim__ * z_dim)) + one_over_lambda_z_1dim__);
    const size_t num_transformed = emit_transformed_parameters * (((((((1 +
      z_dim) + K) + K_smooth) + smooth_sd_1dim__) + q) + len_theta_L));
    const size_t num_gen_quantities = emit_generated_quantities * (((1 +
      has_intercept) + has_intercept_z));
    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_continuous_namespace::model_continuous;
#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_continuous_namespace::profiles__;
}
#endif
#endif
