// 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_mvmer_namespace {
using stan::model::model_base_crtp;
using namespace stan::math;
stan::math::profile_map profiles__;
static constexpr std::array<const char*, 1213> locations_array__ =
  {" (found before start of program)",
  " (in 'mvmer', line 1456, column 2 to line 1457, column 12)",
  " (in 'mvmer', line 1458, column 2 to line 1459, column 12)",
  " (in 'mvmer', line 1460, column 2 to line 1461, column 12)",
  " (in 'mvmer', line 1464, column 2 to column 25)",
  " (in 'mvmer', line 1465, column 2 to column 25)",
  " (in 'mvmer', line 1466, column 2 to column 25)",
  " (in 'mvmer', line 1469, column 2 to column 46)",
  " (in 'mvmer', line 1470, column 2 to column 52)",
  " (in 'mvmer', line 1471, column 2 to column 69)",
  " (in 'mvmer', line 1472, column 2 to column 72)",
  " (in 'mvmer', line 1473, column 2 to column 55)",
  " (in 'mvmer', line 1477, column 4 to column 60)",
  " (in 'mvmer', line 1479, column 4 to column 86)",
  " (in 'mvmer', line 1481, column 4 to column 82)",
  " (in 'mvmer', line 1485, column 4 to column 60)",
  " (in 'mvmer', line 1487, column 4 to column 86)",
  " (in 'mvmer', line 1489, column 4 to column 82)",
  " (in 'mvmer', line 1492, column 2 to column 49)",
  " (in 'mvmer', line 1493, column 2 to column 49)",
  " (in 'mvmer', line 1494, column 2 to column 49)",
  " (in 'mvmer', line 1497, column 2 to column 37)",
  " (in 'mvmer', line 1498, column 2 to column 37)",
  " (in 'mvmer', line 1499, column 2 to column 37)",
  " (in 'mvmer', line 1500, column 2 to column 45)",
  " (in 'mvmer', line 1501, column 2 to column 45)",
  " (in 'mvmer', line 1502, column 2 to column 45)",
  " (in 'mvmer', line 1503, column 2 to column 40)",
  " (in 'mvmer', line 1504, column 2 to column 40)",
  " (in 'mvmer', line 1505, column 2 to column 40)",
  " (in 'mvmer', line 1506, column 2 to column 50)",
  " (in 'mvmer', line 1507, column 2 to column 50)",
  " (in 'mvmer', line 1508, column 2 to column 50)",
  " (in 'mvmer', line 1509, column 2 to column 83)",
  " (in 'mvmer', line 1510, column 2 to column 83)",
  " (in 'mvmer', line 1511, column 2 to column 83)",
  " (in 'mvmer', line 1517, column 2 to column 23)",
  " (in 'mvmer', line 1518, column 2 to column 23)",
  " (in 'mvmer', line 1519, column 2 to column 23)",
  " (in 'mvmer', line 1520, column 2 to column 31)",
  " (in 'mvmer', line 1521, column 2 to column 31)",
  " (in 'mvmer', line 1522, column 2 to column 31)",
  " (in 'mvmer', line 1523, column 2 to column 30)",
  " (in 'mvmer', line 1524, column 2 to column 25)",
  " (in 'mvmer', line 1527, column 2 to column 40)",
  " (in 'mvmer', line 1528, column 2 to column 40)",
  " (in 'mvmer', line 1706, column 2 to column 25)",
  " (in 'mvmer', line 1707, column 2 to column 44)",
  " (in 'mvmer', line 1708, column 2 to column 44)",
  " (in 'mvmer', line 1709, column 2 to column 44)",
  " (in 'mvmer', line 1710, column 2 to column 73)",
  " (in 'mvmer', line 1711, column 2 to column 73)",
  " (in 'mvmer', line 1712, column 2 to column 43)",
  " (in 'mvmer', line 1713, column 2 to column 43)",
  " (in 'mvmer', line 1532, column 4 to line 1533, column 75)",
  " (in 'mvmer', line 1535, column 6 to column 29)",
  " (in 'mvmer', line 1534, column 4 to line 1535, column 29)",
  " (in 'mvmer', line 1531, column 23 to line 1536, column 3)",
  " (in 'mvmer', line 1531, column 2 to line 1536, column 3)",
  " (in 'mvmer', line 1539, column 4 to line 1542, column 49)",
  " (in 'mvmer', line 1538, column 2 to line 1542, column 49)",
  " (in 'mvmer', line 1545, column 6 to line 1546, column 77)",
  " (in 'mvmer', line 1548, column 8 to column 31)",
  " (in 'mvmer', line 1547, column 6 to line 1548, column 31)",
  " (in 'mvmer', line 1544, column 25 to line 1549, column 5)",
  " (in 'mvmer', line 1544, column 4 to line 1549, column 5)",
  " (in 'mvmer', line 1551, column 6 to line 1554, column 51)",
  " (in 'mvmer', line 1550, column 4 to line 1554, column 51)",
  " (in 'mvmer', line 1543, column 13 to line 1555, column 3)",
  " (in 'mvmer', line 1543, column 2 to line 1555, column 3)",
  " (in 'mvmer', line 1558, column 6 to line 1559, column 77)",
  " (in 'mvmer', line 1561, column 8 to column 31)",
  " (in 'mvmer', line 1560, column 6 to line 1561, column 31)",
  " (in 'mvmer', line 1557, column 25 to line 1562, column 5)",
  " (in 'mvmer', line 1557, column 4 to line 1562, column 5)",
  " (in 'mvmer', line 1564, column 6 to line 1567, column 51)",
  " (in 'mvmer', line 1563, column 4 to line 1567, column 51)",
  " (in 'mvmer', line 1556, column 13 to line 1568, column 3)",
  " (in 'mvmer', line 1556, column 2 to line 1568, column 3)",
  " (in 'mvmer', line 1590, column 6 to column 63)",
  " (in 'mvmer', line 1589, column 9 to line 1590, column 63)",
  " (in 'mvmer', line 1588, column 6 to column 35)",
  " (in 'mvmer', line 1587, column 4 to line 1590, column 63)",
  " (in 'mvmer', line 1595, column 6 to column 63)",
  " (in 'mvmer', line 1594, column 9 to line 1595, column 63)",
  " (in 'mvmer', line 1593, column 6 to column 35)",
  " (in 'mvmer', line 1592, column 4 to line 1595, column 63)",
  " (in 'mvmer', line 1585, column 36 to line 1596, column 3)",
  " (in 'mvmer', line 1585, column 7 to line 1596, column 3)",
  " (in 'mvmer', line 1572, column 4 to column 17)",
  " (in 'mvmer', line 1574, column 4 to line 1575, column 58)",
  " (in 'mvmer', line 1578, column 6 to column 51)",
  " (in 'mvmer', line 1577, column 4 to line 1578, column 51)",
  " (in 'mvmer', line 1581, column 6 to column 51)",
  " (in 'mvmer', line 1580, column 4 to line 1581, column 51)",
  " (in 'mvmer', line 1571, column 31 to line 1582, column 3)",
  " (in 'mvmer', line 1571, column 2 to line 1596, column 3)",
  " (in 'mvmer', line 1717, column 4 to column 27)",
  " (in 'mvmer', line 1718, column 4 to column 27)",
  " (in 'mvmer', line 1722, column 13 to column 21)",
  " (in 'mvmer', line 1722, column 6 to line 1726, column 28)",
  " (in 'mvmer', line 1727, column 6 to column 58)",
  " (in 'mvmer', line 1721, column 15 to line 1728, column 5)",
  " (in 'mvmer', line 1721, column 4 to line 1728, column 5)",
  " (in 'mvmer', line 1732, column 13 to column 21)",
  " (in 'mvmer', line 1732, column 6 to column 29)",
  " (in 'mvmer', line 1733, column 6 to column 35)",
  " (in 'mvmer', line 1734, column 6 to column 35)",
  " (in 'mvmer', line 1735, column 6 to line 1738, column 46)",
  " (in 'mvmer', line 1739, column 6 to column 58)",
  " (in 'mvmer', line 1731, column 15 to line 1740, column 5)",
  " (in 'mvmer', line 1731, column 4 to line 1740, column 5)",
  " (in 'mvmer', line 1744, column 13 to column 21)",
  " (in 'mvmer', line 1744, column 6 to column 29)",
  " (in 'mvmer', line 1745, column 6 to column 35)",
  " (in 'mvmer', line 1746, column 6 to column 35)",
  " (in 'mvmer', line 1747, column 6 to line 1750, column 46)",
  " (in 'mvmer', line 1751, column 6 to column 58)",
  " (in 'mvmer', line 1743, column 15 to line 1752, column 5)",
  " (in 'mvmer', line 1743, column 4 to line 1752, column 5)",
  " (in 'mvmer', line 1716, column 2 to line 1753, column 3)",
  " (in 'mvmer', line 1757, column 4 to column 58)",
  " (in 'mvmer', line 1756, column 4 to line 1757, column 58)",
  " (in 'mvmer', line 1759, column 4 to column 58)",
  " (in 'mvmer', line 1758, column 2 to line 1759, column 58)",
  " (in 'mvmer', line 1761, column 4 to column 58)",
  " (in 'mvmer', line 1760, column 2 to line 1761, column 58)",
  " (in 'mvmer', line 1770, column 6 to line 1771, column 73)",
  " (in 'mvmer', line 1769, column 49 to line 1772, column 5)",
  " (in 'mvmer', line 1769, column 9 to line 1772, column 5)",
  " (in 'mvmer', line 1767, column 6 to column 35)",
  " (in 'mvmer', line 1766, column 45 to line 1768, column 5)",
  " (in 'mvmer', line 1766, column 4 to line 1772, column 5)",
  " (in 'mvmer', line 1779, column 6 to line 1780, column 73)",
  " (in 'mvmer', line 1778, column 49 to line 1781, column 5)",
  " (in 'mvmer', line 1778, column 9 to line 1781, column 5)",
  " (in 'mvmer', line 1776, column 6 to column 35)",
  " (in 'mvmer', line 1775, column 45 to line 1777, column 5)",
  " (in 'mvmer', line 1775, column 4 to line 1781, column 5)",
  " (in 'mvmer', line 1602, column 9 to column 17)",
  " (in 'mvmer', line 1602, column 2 to column 25)",
  " (in 'mvmer', line 1603, column 9 to column 17)",
  " (in 'mvmer', line 1603, column 2 to column 25)",
  " (in 'mvmer', line 1604, column 9 to column 17)",
  " (in 'mvmer', line 1604, column 2 to column 25)",
  " (in 'mvmer', line 1608, column 4 to column 27)",
  " (in 'mvmer', line 1609, column 4 to column 27)",
  " (in 'mvmer', line 1610, column 4 to line 1611, column 101)",
  " (in 'mvmer', line 1607, column 13 to line 1612, column 3)",
  " (in 'mvmer', line 1607, column 2 to line 1612, column 3)",
  " (in 'mvmer', line 1616, column 4 to column 36)",
  " (in 'mvmer', line 1617, column 4 to column 36)",
  " (in 'mvmer', line 1618, column 4 to line 1619, column 101)",
  " (in 'mvmer', line 1615, column 13 to line 1620, column 3)",
  " (in 'mvmer', line 1615, column 2 to line 1620, column 3)",
  " (in 'mvmer', line 1624, column 4 to column 43)",
  " (in 'mvmer', line 1625, column 4 to column 43)",
  " (in 'mvmer', line 1626, column 4 to line 1627, column 101)",
  " (in 'mvmer', line 1623, column 13 to line 1628, column 3)",
  " (in 'mvmer', line 1623, column 2 to line 1628, column 3)",
  " (in 'mvmer', line 1632, column 4 to column 102)",
  " (in 'mvmer', line 1634, column 6 to column 104)",
  " (in 'mvmer', line 1633, column 4 to line 1634, column 104)",
  " (in 'mvmer', line 1636, column 6 to column 104)",
  " (in 'mvmer', line 1635, column 4 to line 1636, column 104)",
  " (in 'mvmer', line 1631, column 21 to line 1637, column 3)",
  " (in 'mvmer', line 1631, column 2 to line 1637, column 3)",
  " (in 'mvmer', line 1643, column 4 to line 1644, column 60)",
  " (in 'mvmer', line 1642, column 2 to line 1644, column 60)",
  " (in 'mvmer', line 1646, column 4 to line 1647, column 60)",
  " (in 'mvmer', line 1645, column 2 to line 1647, column 60)",
  " (in 'mvmer', line 1649, column 4 to line 1650, column 60)",
  " (in 'mvmer', line 1648, column 2 to line 1650, column 60)",
  " (in 'mvmer', line 1654, column 4 to line 1655, column 74)",
  " (in 'mvmer', line 1653, column 2 to line 1655, column 74)",
  " (in 'mvmer', line 1657, column 4 to line 1658, column 74)",
  " (in 'mvmer', line 1656, column 2 to line 1658, column 74)",
  " (in 'mvmer', line 1660, column 3 to line 1661, column 74)",
  " (in 'mvmer', line 1659, column 2 to line 1661, column 74)",
  " (in 'mvmer', line 1665, column 4 to line 1667, column 35)",
  " (in 'mvmer', line 1664, column 2 to line 1667, column 35)",
  " (in 'mvmer', line 1669, column 4 to line 1671, column 35)",
  " (in 'mvmer', line 1668, column 2 to line 1671, column 35)",
  " (in 'mvmer', line 1673, column 4 to line 1675, column 35)",
  " (in 'mvmer', line 1672, column 2 to line 1675, column 35)",
  " (in 'mvmer', line 1685, column 6 to column 70)",
  " (in 'mvmer', line 1687, column 6 to column 55)",
  " (in 'mvmer', line 1690, column 8 to column 79)",
  " (in 'mvmer', line 1689, column 6 to line 1690, column 79)",
  " (in 'mvmer', line 1683, column 17 to line 1691, column 5)",
  " (in 'mvmer', line 1683, column 4 to line 1691, column 5)",
  " (in 'mvmer', line 1694, column 6 to column 70)",
  " (in 'mvmer', line 1696, column 6 to column 55)",
  " (in 'mvmer', line 1699, column 8 to column 79)",
  " (in 'mvmer', line 1698, column 6 to line 1699, column 79)",
  " (in 'mvmer', line 1692, column 17 to line 1700, column 5)",
  " (in 'mvmer', line 1692, column 4 to line 1700, column 5)",
  " (in 'mvmer', line 1682, column 36 to line 1701, column 3)",
  " (in 'mvmer', line 1682, column 7 to line 1701, column 3)",
  " (in 'mvmer', line 1679, column 4 to line 1680, column 54)",
  " (in 'mvmer', line 1678, column 31 to line 1681, column 3)",
  " (in 'mvmer', line 1678, column 2 to line 1701, column 3)",
  " (in 'mvmer', line 1241, column 2 to column 25)",
  " (in 'mvmer', line 1242, column 2 to column 40)",
  " (in 'mvmer', line 1243, column 2 to column 35)",
  " (in 'mvmer', line 1244, column 2 to column 42)",
  " (in 'mvmer', line 1245, column 2 to column 47)",
  " (in 'mvmer', line 1246, column 2 to column 30)",
  " (in 'mvmer', line 1247, column 2 to column 30)",
  " (in 'mvmer', line 1248, column 2 to column 27)",
  " (in 'mvmer', line 1251, column 2 to column 17)",
  " (in 'mvmer', line 1252, column 8 to column 9)",
  " (in 'mvmer', line 1252, column 2 to column 26)",
  " (in 'mvmer', line 1253, column 8 to column 9)",
  " (in 'mvmer', line 1253, column 2 to column 26)",
  " (in 'mvmer', line 1254, column 2 to column 17)",
  " (in 'mvmer', line 1255, column 2 to column 27)",
  " (in 'mvmer', line 1260, column 4 to column 21)",
  " (in 'mvmer', line 1261, column 4 to column 21)",
  " (in 'mvmer', line 1262, column 4 to column 34)",
  " (in 'mvmer', line 1263, column 4 to column 36)",
  " (in 'mvmer', line 1266, column 4 to column 21)",
  " (in 'mvmer', line 1267, column 4 to column 21)",
  " (in 'mvmer', line 1268, column 4 to column 34)",
  " (in 'mvmer', line 1269, column 4 to column 36)",
  " (in 'mvmer', line 1275, column 8 to column 40)",
  " (in 'mvmer', line 1275, column 2 to column 61)",
  " (in 'mvmer', line 1276, column 8 to column 40)",
  " (in 'mvmer', line 1276, column 2 to column 61)",
  " (in 'mvmer', line 1277, column 8 to column 40)",
  " (in 'mvmer', line 1277, column 2 to column 61)",
  " (in 'mvmer', line 1278, column 9 to column 41)",
  " (in 'mvmer', line 1278, column 2 to column 50)",
  " (in 'mvmer', line 1279, column 9 to column 41)",
  " (in 'mvmer', line 1279, column 2 to column 50)",
  " (in 'mvmer', line 1280, column 9 to column 41)",
  " (in 'mvmer', line 1280, column 2 to column 50)",
  " (in 'mvmer', line 1281, column 9 to column 17)",
  " (in 'mvmer', line 1281, column 18 to column 23)",
  " (in 'mvmer', line 1281, column 2 to column 29)",
  " (in 'mvmer', line 1282, column 9 to column 17)",
  " (in 'mvmer', line 1282, column 18 to column 23)",
  " (in 'mvmer', line 1282, column 2 to column 29)",
  " (in 'mvmer', line 1283, column 9 to column 17)",
  " (in 'mvmer', line 1283, column 18 to column 23)",
  " (in 'mvmer', line 1283, column 2 to column 29)",
  " (in 'mvmer', line 1284, column 9 to column 14)",
  " (in 'mvmer', line 1284, column 2 to column 23)",
  " (in 'mvmer', line 1285, column 9 to column 14)",
  " (in 'mvmer', line 1285, column 2 to column 23)",
  " (in 'mvmer', line 1286, column 9 to column 14)",
  " (in 'mvmer', line 1286, column 2 to column 23)",
  " (in 'mvmer', line 1296, column 8 to column 9)",
  " (in 'mvmer', line 1296, column 2 to column 31)",
  " (in 'mvmer', line 1297, column 8 to column 9)",
  " (in 'mvmer', line 1297, column 2 to column 29)",
  " (in 'mvmer', line 1300, column 8 to column 18)",
  " (in 'mvmer', line 1300, column 27 to column 56)",
  " (in 'mvmer', line 1300, column 2 to column 64)",
  " (in 'mvmer', line 1301, column 8 to column 18)",
  " (in 'mvmer', line 1301, column 27 to column 56)",
  " (in 'mvmer', line 1301, column 2 to column 64)",
  " (in 'mvmer', line 1302, column 8 to column 18)",
  " (in 'mvmer', line 1302, column 27 to column 56)",
  " (in 'mvmer', line 1302, column 2 to column 64)",
  " (in 'mvmer', line 1303, column 8 to column 37)",
  " (in 'mvmer', line 1303, column 2 to column 61)",
  " (in 'mvmer', line 1304, column 8 to column 37)",
  " (in 'mvmer', line 1304, column 2 to column 61)",
  " (in 'mvmer', line 1305, column 8 to column 37)",
  " (in 'mvmer', line 1305, column 2 to column 61)",
  " (in 'mvmer', line 1308, column 8 to column 18)",
  " (in 'mvmer', line 1308, column 27 to column 56)",
  " (in 'mvmer', line 1308, column 2 to column 64)",
  " (in 'mvmer', line 1309, column 8 to column 18)",
  " (in 'mvmer', line 1309, column 27 to column 56)",
  " (in 'mvmer', line 1309, column 2 to column 64)",
  " (in 'mvmer', line 1310, column 8 to column 18)",
  " (in 'mvmer', line 1310, column 27 to column 56)",
  " (in 'mvmer', line 1310, column 2 to column 64)",
  " (in 'mvmer', line 1311, column 8 to column 37)",
  " (in 'mvmer', line 1311, column 2 to column 61)",
  " (in 'mvmer', line 1312, column 8 to column 37)",
  " (in 'mvmer', line 1312, column 2 to column 61)",
  " (in 'mvmer', line 1313, column 8 to column 37)",
  " (in 'mvmer', line 1313, column 2 to column 61)",
  " (in 'mvmer', line 1317, column 2 to column 45)",
  " (in 'mvmer', line 1318, column 8 to column 9)",
  " (in 'mvmer', line 1318, column 2 to column 59)",
  " (in 'mvmer', line 1321, column 8 to column 9)",
  " (in 'mvmer', line 1321, column 2 to column 53)",
  " (in 'mvmer', line 1324, column 2 to column 42)",
  " (in 'mvmer', line 1327, column 2 to column 32)",
  " (in 'mvmer', line 1330, column 2 to column 43)",
  " (in 'mvmer', line 1331, column 9 to column 37)",
  " (in 'mvmer', line 1331, column 2 to column 49)",
  " (in 'mvmer', line 1332, column 9 to column 37)",
  " (in 'mvmer', line 1332, column 2 to column 49)",
  " (in 'mvmer', line 1333, column 9 to column 37)",
  " (in 'mvmer', line 1333, column 2 to column 49)",
  " (in 'mvmer', line 1342, column 9 to column 14)",
  " (in 'mvmer', line 1342, column 2 to column 30)",
  " (in 'mvmer', line 1343, column 9 to column 14)",
  " (in 'mvmer', line 1343, column 2 to column 30)",
  " (in 'mvmer', line 1344, column 9 to column 14)",
  " (in 'mvmer', line 1344, column 2 to column 30)",
  " (in 'mvmer', line 1345, column 18 to column 23)",
  " (in 'mvmer', line 1345, column 2 to column 40)",
  " (in 'mvmer', line 1346, column 18 to column 23)",
  " (in 'mvmer', line 1346, column 2 to column 40)",
  " (in 'mvmer', line 1347, column 18 to column 23)",
  " (in 'mvmer', line 1347, column 2 to column 40)",
  " (in 'mvmer', line 1348, column 18 to column 23)",
  " (in 'mvmer', line 1348, column 2 to column 37)",
  " (in 'mvmer', line 1349, column 18 to column 23)",
  " (in 'mvmer', line 1349, column 2 to column 37)",
  " (in 'mvmer', line 1350, column 18 to column 23)",
  " (in 'mvmer', line 1350, column 2 to column 37)",
  " (in 'mvmer', line 1351, column 18 to column 19)",
  " (in 'mvmer', line 1351, column 2 to column 39)",
  " (in 'mvmer', line 1352, column 18 to column 19)",
  " (in 'mvmer', line 1352, column 2 to column 42)",
  " (in 'mvmer', line 1353, column 18 to column 19)",
  " (in 'mvmer', line 1353, column 2 to column 31)",
  " (in 'mvmer', line 1354, column 18 to column 19)",
  " (in 'mvmer', line 1354, column 2 to column 34)",
  " (in 'mvmer', line 1357, column 9 to column 10)",
  " (in 'mvmer', line 1357, column 2 to column 39)",
  " (in 'mvmer', line 1358, column 18 to column 19)",
  " (in 'mvmer', line 1358, column 2 to column 49)",
  " (in 'mvmer', line 1359, column 18 to column 19)",
  " (in 'mvmer', line 1359, column 2 to column 46)",
  " (in 'mvmer', line 1362, column 18 to column 19)",
  " (in 'mvmer', line 1362, column 2 to column 42)",
  " (in 'mvmer', line 1363, column 18 to column 19)",
  " (in 'mvmer', line 1363, column 2 to column 43)",
  " (in 'mvmer', line 1364, column 18 to column 19)",
  " (in 'mvmer', line 1364, column 2 to column 40)",
  " (in 'mvmer', line 1367, column 2 to column 33)",
  " (in 'mvmer', line 1368, column 2 to column 34)",
  " (in 'mvmer', line 1369, column 18 to column 19)",
  " (in 'mvmer', line 1369, column 2 to column 35)",
  " (in 'mvmer', line 1370, column 18 to column 19)",
  " (in 'mvmer', line 1370, column 2 to column 35)",
  " (in 'mvmer', line 1371, column 8 to column 25)",
  " (in 'mvmer', line 1371, column 2 to column 64)",
  " (in 'mvmer', line 1372, column 8 to column 26)",
  " (in 'mvmer', line 1372, column 2 to column 65)",
  " (in 'mvmer', line 1375, column 18 to column 21)",
  " (in 'mvmer', line 1375, column 2 to column 38)",
  " (in 'mvmer', line 1376, column 18 to column 21)",
  " (in 'mvmer', line 1376, column 2 to column 38)",
  " (in 'mvmer', line 1377, column 18 to column 21)",
  " (in 'mvmer', line 1377, column 2 to column 35)",
  " (in 'mvmer', line 1378, column 18 to column 21)",
  " (in 'mvmer', line 1378, column 2 to column 35)",
  " (in 'mvmer', line 1379, column 2 to column 40)",
  " (in 'mvmer', line 1380, column 2 to column 40)",
  " (in 'mvmer', line 1387, column 2 to column 68)",
  " (in 'mvmer', line 1388, column 2 to column 68)",
  " (in 'mvmer', line 1389, column 2 to column 68)",
  " (in 'mvmer', line 1392, column 2 to column 27)",
  " (in 'mvmer', line 1393, column 2 to column 48)",
  " (in 'mvmer', line 1394, column 2 to column 36)",
  " (in 'mvmer', line 1395, column 2 to column 23)",
  " (in 'mvmer', line 1396, column 8 to column 25)",
  " (in 'mvmer', line 1396, column 2 to column 47)",
  " (in 'mvmer', line 1399, column 8 to column 60)",
  " (in 'mvmer', line 1399, column 2 to column 76)",
  " (in 'mvmer', line 1400, column 8 to column 60)",
  " (in 'mvmer', line 1400, column 2 to column 76)",
  " (in 'mvmer', line 1403, column 2 to line 1404, column 38)",
  " (in 'mvmer', line 1405, column 2 to line 1406, column 38)",
  " (in 'mvmer', line 1407, column 2 to line 1408, column 38)",
  " (in 'mvmer', line 1409, column 9 to column 47)",
  " (in 'mvmer', line 1409, column 2 to column 57)",
  " (in 'mvmer', line 1410, column 9 to column 47)",
  " (in 'mvmer', line 1410, column 2 to column 57)",
  " (in 'mvmer', line 1411, column 9 to column 47)",
  " (in 'mvmer', line 1411, column 2 to column 57)",
  " (in 'mvmer', line 1412, column 9 to column 47)",
  " (in 'mvmer', line 1412, column 2 to column 56)",
  " (in 'mvmer', line 1413, column 9 to column 47)",
  " (in 'mvmer', line 1413, column 2 to column 56)",
  " (in 'mvmer', line 1414, column 9 to column 47)",
  " (in 'mvmer', line 1414, column 2 to column 56)",
  " (in 'mvmer', line 1416, column 4 to column 27)",
  " (in 'mvmer', line 1417, column 4 to column 25)",
  " (in 'mvmer', line 1415, column 31 to line 1418, column 3)",
  " (in 'mvmer', line 1415, column 2 to line 1418, column 3)",
  " (in 'mvmer', line 1420, column 4 to column 27)",
  " (in 'mvmer', line 1421, column 4 to column 25)",
  " (in 'mvmer', line 1419, column 31 to line 1422, column 3)",
  " (in 'mvmer', line 1419, column 2 to line 1422, column 3)",
  " (in 'mvmer', line 1424, column 4 to column 27)",
  " (in 'mvmer', line 1425, column 4 to column 25)",
  " (in 'mvmer', line 1423, column 31 to line 1426, column 3)",
  " (in 'mvmer', line 1423, column 2 to line 1426, column 3)",
  " (in 'mvmer', line 1433, column 10 to column 48)",
  " (in 'mvmer', line 1434, column 10 to column 19)",
  " (in 'mvmer', line 1432, column 26 to line 1435, column 9)",
  " (in 'mvmer', line 1432, column 8 to line 1435, column 9)",
  " (in 'mvmer', line 1431, column 20 to line 1436, column 7)",
  " (in 'mvmer', line 1431, column 6 to line 1436, column 7)",
  " (in 'mvmer', line 1437, column 24 to column 44)",
  " (in 'mvmer', line 1437, column 6 to column 44)",
  " (in 'mvmer', line 1430, column 19 to line 1438, column 5)",
  " (in 'mvmer', line 1430, column 4 to line 1438, column 5)",
  " (in 'mvmer', line 1429, column 31 to line 1439, column 3)",
  " (in 'mvmer', line 1429, column 2 to line 1439, column 3)",
  " (in 'mvmer', line 1444, column 6 to column 41)",
  " (in 'mvmer', line 1443, column 4 to line 1444, column 41)",
  " (in 'mvmer', line 1446, column 6 to column 41)",
  " (in 'mvmer', line 1445, column 4 to line 1446, column 41)",
  " (in 'mvmer', line 1442, column 31 to line 1447, column 3)",
  " (in 'mvmer', line 1442, column 2 to line 1447, column 3)",
  " (in 'mvmer', line 1456, column 8 to column 29)",
  " (in 'mvmer', line 1458, column 8 to column 29)",
  " (in 'mvmer', line 1460, column 8 to column 29)",
  " (in 'mvmer', line 1464, column 9 to column 14)",
  " (in 'mvmer', line 1465, column 9 to column 14)",
  " (in 'mvmer', line 1466, column 9 to column 14)",
  " (in 'mvmer', line 1469, column 9 to column 40)",
  " (in 'mvmer', line 1470, column 9 to column 46)",
  " (in 'mvmer', line 1471, column 26 to column 63)",
  " (in 'mvmer', line 1472, column 18 to column 65)",
  " (in 'mvmer', line 1473, column 18 to column 49)",
  " (in 'mvmer', line 1477, column 20 to column 53)",
  " (in 'mvmer', line 1479, column 11 to column 56)",
  " (in 'mvmer', line 1479, column 58 to column 76)",
  " (in 'mvmer', line 1481, column 25 to column 69)",
  " (in 'mvmer', line 1485, column 20 to column 53)",
  " (in 'mvmer', line 1487, column 11 to column 56)",
  " (in 'mvmer', line 1487, column 58 to column 76)",
  " (in 'mvmer', line 1489, column 25 to column 69)",
  " (in 'mvmer', line 1492, column 8 to column 18)",
  " (in 'mvmer', line 1493, column 8 to column 18)",
  " (in 'mvmer', line 1494, column 8 to column 18)",
  " (in 'mvmer', line 1497, column 8 to column 12)",
  " (in 'mvmer', line 1498, column 8 to column 12)",
  " (in 'mvmer', line 1499, column 8 to column 12)",
  " (in 'mvmer', line 1500, column 8 to column 12)",
  " (in 'mvmer', line 1500, column 30 to column 35)",
  " (in 'mvmer', line 1501, column 8 to column 12)",
  " (in 'mvmer', line 1501, column 30 to column 35)",
  " (in 'mvmer', line 1502, column 8 to column 12)",
  " (in 'mvmer', line 1502, column 30 to column 35)",
  " (in 'mvmer', line 1503, column 8 to column 16)",
  " (in 'mvmer', line 1504, column 8 to column 16)",
  " (in 'mvmer', line 1505, column 8 to column 16)",
  " (in 'mvmer', line 1506, column 8 to column 28)",
  " (in 'mvmer', line 1507, column 8 to column 28)",
  " (in 'mvmer', line 1508, column 8 to column 28)",
  " (in 'mvmer', line 1509, column 8 to column 52)",
  " (in 'mvmer', line 1509, column 70 to column 75)",
  " (in 'mvmer', line 1510, column 8 to column 52)",
  " (in 'mvmer', line 1510, column 70 to column 75)",
  " (in 'mvmer', line 1511, column 8 to column 52)",
  " (in 'mvmer', line 1511, column 70 to column 75)",
  " (in 'mvmer', line 1517, column 9 to column 14)",
  " (in 'mvmer', line 1518, column 9 to column 14)",
  " (in 'mvmer', line 1519, column 9 to column 14)",
  " (in 'mvmer', line 1520, column 8 to column 18)",
  " (in 'mvmer', line 1521, column 8 to column 18)",
  " (in 'mvmer', line 1522, column 8 to column 18)",
  " (in 'mvmer', line 1523, column 9 to column 20)",
  " (in 'mvmer', line 1527, column 9 to column 27)",
  " (in 'mvmer', line 1527, column 29 to column 32)",
  " (in 'mvmer', line 1528, column 9 to column 27)",
  " (in 'mvmer', line 1528, column 29 to column 32)",
  " (in 'mvmer', line 1706, column 8 to column 9)",
  " (in 'mvmer', line 1707, column 8 to column 29)",
  " (in 'mvmer', line 1708, column 8 to column 29)",
  " (in 'mvmer', line 1709, column 8 to column 29)",
  " (in 'mvmer', line 1710, column 9 to column 65)",
  " (in 'mvmer', line 1711, column 9 to column 65)",
  " (in 'mvmer', line 1712, column 9 to column 18)",
  " (in 'mvmer', line 1713, column 9 to column 18)",
  " (in 'mvmer', line 46, column 11 to column 22)",
  " (in 'mvmer', line 46, column 4 to column 32)",
  " (in 'mvmer', line 47, column 4 to column 22)",
  " (in 'mvmer', line 48, column 4 to column 21)",
  " (in 'mvmer', line 49, column 4 to column 21)",
  " (in 'mvmer', line 50, column 4 to column 25)",
  " (in 'mvmer', line 54, column 6 to column 20)",
  " (in 'mvmer', line 61, column 15 to column 17)",
  " (in 'mvmer', line 61, column 18 to column 20)",
  " (in 'mvmer', line 61, column 8 to column 26)",
  " (in 'mvmer', line 62, column 8 to column 21)",
  " (in 'mvmer', line 63, column 8 to column 17)",
  " (in 'mvmer', line 64, column 8 to column 69)",
  " (in 'mvmer', line 65, column 15 to column 17)",
  " (in 'mvmer', line 65, column 8 to column 53)",
  " (in 'mvmer', line 66, column 8 to column 22)",
  " (in 'mvmer', line 69, column 8 to column 24)",
  " (in 'mvmer', line 70, column 8 to column 42)",
  " (in 'mvmer', line 71, column 8 to column 27)",
  " (in 'mvmer', line 74, column 8 to column 42)",
  " (in 'mvmer', line 75, column 8 to column 40)",
  " (in 'mvmer', line 76, column 8 to column 22)",
  " (in 'mvmer', line 77, column 8 to column 53)",
  " (in 'mvmer', line 78, column 8 to column 33)",
  " (in 'mvmer', line 81, column 10 to column 26)",
  " (in 'mvmer', line 82, column 17 to column 18)",
  " (in 'mvmer', line 82, column 10 to column 54)",
  " (in 'mvmer', line 83, column 10 to column 78)",
  " (in 'mvmer', line 84, column 10 to column 24)",
  " (in 'mvmer', line 85, column 10 to column 46)",
  " (in 'mvmer', line 86, column 24 to column 61)",
  " (in 'mvmer', line 86, column 10 to column 61)",
  " (in 'mvmer', line 87, column 10 to column 61)",
  " (in 'mvmer', line 88, column 10 to column 24)",
  " (in 'mvmer', line 80, column 30 to line 89, column 9)",
  " (in 'mvmer', line 80, column 8 to line 89, column 9)",
  " (in 'mvmer', line 93, column 10 to column 43)",
  " (in 'mvmer', line 94, column 10 to column 28)",
  " (in 'mvmer', line 92, column 40 to line 95, column 9)",
  " (in 'mvmer', line 92, column 24 to line 95, column 9)",
  " (in 'mvmer', line 92, column 8 to line 95, column 9)",
  " (in 'mvmer', line 60, column 11 to line 96, column 7)",
  " (in 'mvmer', line 56, column 8 to column 63)",
  " (in 'mvmer', line 58, column 8 to column 26)",
  " (in 'mvmer', line 55, column 19 to line 59, column 7)",
  " (in 'mvmer', line 55, column 6 to line 96, column 7)",
  " (in 'mvmer', line 53, column 25 to line 97, column 5)",
  " (in 'mvmer', line 53, column 4 to line 97, column 5)",
  " (in 'mvmer', line 98, column 4 to column 19)",
  " (in 'mvmer', line 45, column 46 to line 99, column 3)",
  " (in 'mvmer', line 113, column 11 to column 20)",
  " (in 'mvmer', line 113, column 4 to column 24)",
  " (in 'mvmer', line 114, column 4 to column 19)",
  " (in 'mvmer', line 115, column 4 to column 25)",
  " (in 'mvmer', line 117, column 6 to column 20)",
  " (in 'mvmer', line 126, column 15 to column 17)",
  " (in 'mvmer', line 126, column 18 to column 20)",
  " (in 'mvmer', line 126, column 8 to column 50)",
  " (in 'mvmer', line 128, column 10 to column 43)",
  " (in 'mvmer', line 129, column 10 to column 28)",
  " (in 'mvmer', line 131, column 12 to column 45)",
  " (in 'mvmer', line 132, column 12 to column 30)",
  " (in 'mvmer', line 130, column 29 to line 133, column 11)",
  " (in 'mvmer', line 130, column 10 to line 133, column 11)",
  " (in 'mvmer', line 127, column 24 to line 134, column 9)",
  " (in 'mvmer', line 127, column 8 to line 134, column 9)",
  " (in 'mvmer', line 136, column 17 to column 19)",
  " (in 'mvmer', line 136, column 10 to column 59)",
  " (in 'mvmer', line 137, column 10 to column 22)",
  " (in 'mvmer', line 138, column 26 to column 50)",
  " (in 'mvmer', line 138, column 10 to column 50)",
  " (in 'mvmer', line 139, column 10 to column 27)",
  " (in 'mvmer', line 135, column 26 to line 140, column 9)",
  " (in 'mvmer', line 135, column 8 to line 140, column 9)",
  " (in 'mvmer', line 125, column 11 to line 141, column 7)",
  " (in 'mvmer', line 119, column 8 to column 51)",
  " (in 'mvmer', line 121, column 10 to column 40)",
  " (in 'mvmer', line 120, column 8 to line 121, column 40)",
  " (in 'mvmer', line 122, column 8 to column 23)",
  " (in 'mvmer', line 123, column 8 to column 26)",
  " (in 'mvmer', line 118, column 19 to line 124, column 7)",
  " (in 'mvmer', line 118, column 6 to line 141, column 7)",
  " (in 'mvmer', line 116, column 25 to line 142, column 5)",
  " (in 'mvmer', line 116, column 4 to line 142, column 5)",
  " (in 'mvmer', line 143, column 4 to column 13)",
  " (in 'mvmer', line 112, column 74 to line 144, column 3)",
  " (in 'mvmer', line 164, column 4 to column 16)",
  " (in 'mvmer', line 165, column 4 to column 20)",
  " (in 'mvmer', line 166, column 4 to column 20)",
  " (in 'mvmer', line 167, column 4 to column 34)",
  " (in 'mvmer', line 168, column 4 to column 34)",
  " (in 'mvmer', line 170, column 13 to column 21)",
  " (in 'mvmer', line 170, column 6 to column 30)",
  " (in 'mvmer', line 171, column 13 to column 21)",
  " (in 'mvmer', line 171, column 6 to column 30)",
  " (in 'mvmer', line 172, column 6 to column 59)",
  " (in 'mvmer', line 173, column 6 to column 19)",
  " (in 'mvmer', line 174, column 6 to column 21)",
  " (in 'mvmer', line 175, column 6 to column 21)",
  " (in 'mvmer', line 177, column 8 to column 18)",
  " (in 'mvmer', line 178, column 8 to column 28)",
  " (in 'mvmer', line 179, column 8 to column 23)",
  " (in 'mvmer', line 176, column 28 to line 180, column 7)",
  " (in 'mvmer', line 176, column 6 to line 180, column 7)",
  " (in 'mvmer', line 181, column 6 to column 74)",
  " (in 'mvmer', line 182, column 6 to column 26)",
  " (in 'mvmer', line 169, column 33 to line 183, column 5)",
  " (in 'mvmer', line 169, column 19 to line 183, column 5)",
  " (in 'mvmer', line 169, column 4 to line 183, column 5)",
  " (in 'mvmer', line 184, column 4 to column 38)",
  " (in 'mvmer', line 185, column 4 to column 38)",
  " (in 'mvmer', line 186, column 4 to column 14)",
  " (in 'mvmer', line 163, column 38 to line 187, column 3)",
  " (in 'mvmer', line 202, column 4 to column 25)",
  " (in 'mvmer', line 203, column 11 to column 12)",
  " (in 'mvmer', line 203, column 4 to column 50)",
  " (in 'mvmer', line 204, column 4 to column 78)",
  " (in 'mvmer', line 205, column 11 to column 12)",
  " (in 'mvmer', line 205, column 4 to column 39)",
  " (in 'mvmer', line 206, column 11 to column 12)",
  " (in 'mvmer', line 206, column 4 to column 82)",
  " (in 'mvmer', line 207, column 4 to column 40)",
  " (in 'mvmer', line 201, column 70 to line 208, column 3)",
  " (in 'mvmer', line 223, column 4 to column 25)",
  " (in 'mvmer', line 224, column 11 to column 12)",
  " (in 'mvmer', line 224, column 4 to column 50)",
  " (in 'mvmer', line 225, column 11 to column 12)",
  " (in 'mvmer', line 225, column 4 to column 47)",
  " (in 'mvmer', line 226, column 4 to column 78)",
  " (in 'mvmer', line 227, column 11 to column 12)",
  " (in 'mvmer', line 227, column 4 to column 50)",
  " (in 'mvmer', line 228, column 11 to column 12)",
  " (in 'mvmer', line 228, column 4 to line 229, column 69)",
  " (in 'mvmer', line 230, column 4 to column 40)",
  " (in 'mvmer', line 222, column 74 to line 231, column 3)",
  " (in 'mvmer', line 244, column 4 to column 24)",
  " (in 'mvmer', line 245, column 4 to column 21)",
  " (in 'mvmer', line 246, column 4 to column 22)",
  " (in 'mvmer', line 247, column 4 to column 22)",
  " (in 'mvmer', line 248, column 4 to column 22)",
  " (in 'mvmer', line 249, column 4 to column 26)",
  " (in 'mvmer', line 250, column 4 to column 24)",
  " (in 'mvmer', line 251, column 4 to column 25)",
  " (in 'mvmer', line 252, column 4 to line 254, column 84)",
  " (in 'mvmer', line 243, column 28 to line 255, column 3)",
  " (in 'mvmer', line 266, column 10 to column 11)",
  " (in 'mvmer', line 266, column 12 to column 13)",
  " (in 'mvmer', line 266, column 4 to column 21)",
  " (in 'mvmer', line 267, column 4 to column 16)",
  " (in 'mvmer', line 269, column 6 to column 22)",
  " (in 'mvmer', line 270, column 6 to column 15)",
  " (in 'mvmer', line 268, column 45 to line 271, column 5)",
  " (in 'mvmer', line 268, column 30 to line 271, column 5)",
  " (in 'mvmer', line 268, column 15 to line 271, column 5)",
  " (in 'mvmer', line 268, column 4 to line 271, column 5)",
  " (in 'mvmer', line 272, column 4 to column 13)",
  " (in 'mvmer', line 265, column 51 to line 273, column 3)",
  " (in 'mvmer', line 291, column 21 to column 48)",
  " (in 'mvmer', line 291, column 4 to column 48)",
  " (in 'mvmer', line 293, column 21 to column 48)",
  " (in 'mvmer', line 293, column 6 to column 48)",
  " (in 'mvmer', line 294, column 6 to column 15)",
  " (in 'mvmer', line 292, column 21 to line 295, column 5)",
  " (in 'mvmer', line 292, column 4 to line 295, column 5)",
  " (in 'mvmer', line 296, column 4 to column 31)",
  " (in 'mvmer', line 290, column 40 to line 297, column 3)",
  " (in 'mvmer', line 307, column 34 to column 43)",
  " (in 'mvmer', line 307, column 4 to column 43)",
  " (in 'mvmer', line 308, column 4 to column 31)",
  " (in 'mvmer', line 306, column 40 to line 309, column 3)",
  " (in 'mvmer', line 325, column 9 to column 32)",
  " (in 'mvmer', line 324, column 24 to column 49)",
  " (in 'mvmer', line 324, column 9 to line 325, column 32)",
  " (in 'mvmer', line 323, column 24 to column 41)",
  " (in 'mvmer', line 323, column 9 to line 325, column 32)",
  " (in 'mvmer', line 322, column 24 to column 55)",
  " (in 'mvmer', line 322, column 9 to line 325, column 32)",
  " (in 'mvmer', line 321, column 24 to column 41)",
  " (in 'mvmer', line 321, column 9 to line 325, column 32)",
  " (in 'mvmer', line 320, column 24 to column 47)",
  " (in 'mvmer', line 320, column 4 to line 325, column 32)",
  " (in 'mvmer', line 326, column 4 to column 15)",
  " (in 'mvmer', line 319, column 44 to line 327, column 3)",
  " (in 'mvmer', line 339, column 4 to column 16)",
  " (in 'mvmer', line 360, column 9 to column 32)",
  " (in 'mvmer', line 357, column 6 to column 39)",
  " (in 'mvmer', line 358, column 6 to column 28)",
  " (in 'mvmer', line 356, column 23 to line 359, column 5)",
  " (in 'mvmer', line 356, column 9 to line 360, column 32)",
  " (in 'mvmer', line 353, column 6 to column 33)",
  " (in 'mvmer', line 354, column 6 to column 22)",
  " (in 'mvmer', line 352, column 23 to line 355, column 5)",
  " (in 'mvmer', line 352, column 9 to line 360, column 32)",
  " (in 'mvmer', line 349, column 6 to column 38)",
  " (in 'mvmer', line 350, column 6 to column 38)",
  " (in 'mvmer', line 348, column 24 to line 351, column 5)",
  " (in 'mvmer', line 348, column 9 to line 360, column 32)",
  " (in 'mvmer', line 345, column 6 to column 38)",
  " (in 'mvmer', line 346, column 6 to column 38)",
  " (in 'mvmer', line 344, column 24 to line 347, column 5)",
  " (in 'mvmer', line 344, column 9 to line 360, column 32)",
  " (in 'mvmer', line 341, column 6 to column 40)",
  " (in 'mvmer', line 342, column 6 to column 40)",
  " (in 'mvmer', line 340, column 19 to line 343, column 5)",
  " (in 'mvmer', line 340, column 4 to line 360, column 32)",
  " (in 'mvmer', line 361, column 4 to column 14)",
  " (in 'mvmer', line 338, column 68 to line 362, column 3)",
  " (in 'mvmer', line 374, column 4 to column 22)",
  " (in 'mvmer', line 375, column 11 to column 12)",
  " (in 'mvmer', line 375, column 4 to column 17)",
  " (in 'mvmer', line 383, column 9 to column 32)",
  " (in 'mvmer', line 380, column 13 to column 14)",
  " (in 'mvmer', line 380, column 6 to column 45)",
  " (in 'mvmer', line 381, column 21 to column 55)",
  " (in 'mvmer', line 381, column 6 to column 55)",
  " (in 'mvmer', line 379, column 24 to line 382, column 5)",
  " (in 'mvmer', line 379, column 9 to line 383, column 32)",
  " (in 'mvmer', line 377, column 21 to column 62)",
  " (in 'mvmer', line 377, column 6 to column 62)",
  " (in 'mvmer', line 376, column 19 to line 378, column 5)",
  " (in 'mvmer', line 376, column 4 to line 383, column 32)",
  " (in 'mvmer', line 384, column 4 to column 14)",
  " (in 'mvmer', line 373, column 46 to line 385, column 3)",
  " (in 'mvmer', line 396, column 40 to column 66)",
  " (in 'mvmer', line 396, column 4 to column 66)",
  " (in 'mvmer', line 397, column 18 to column 27)",
  " (in 'mvmer', line 397, column 4 to column 27)",
  " (in 'mvmer', line 403, column 6 to column 26)",
  " (in 'mvmer', line 404, column 6 to line 405, column 79)",
  " (in 'mvmer', line 402, column 9 to line 406, column 5)",
  " (in 'mvmer', line 399, column 20 to column 38)",
  " (in 'mvmer', line 399, column 6 to column 38)",
  " (in 'mvmer', line 400, column 6 to column 45)",
  " (in 'mvmer', line 398, column 20 to line 401, column 5)",
  " (in 'mvmer', line 398, column 4 to line 406, column 5)",
  " (in 'mvmer', line 407, column 4 to column 26)",
  " (in 'mvmer', line 395, column 56 to line 408, column 3)",
  " (in 'mvmer', line 421, column 4 to column 39)",
  " (in 'mvmer', line 422, column 4 to column 17)",
  " (in 'mvmer', line 423, column 4 to column 17)",
  " (in 'mvmer', line 424, column 11 to column 12)",
  " (in 'mvmer', line 424, column 4 to column 23)",
  " (in 'mvmer', line 426, column 6 to column 29)",
  " (in 'mvmer', line 427, column 6 to column 32)",
  " (in 'mvmer', line 428, column 6 to column 28)",
  " (in 'mvmer', line 429, column 13 to column 16)",
  " (in 'mvmer', line 429, column 6 to line 430, column 63)",
  " (in 'mvmer', line 431, column 6 to column 54)",
  " (in 'mvmer', line 432, column 6 to column 18)",
  " (in 'mvmer', line 433, column 6 to column 18)",
  " (in 'mvmer', line 425, column 19 to line 434, column 5)",
  " (in 'mvmer', line 425, column 4 to line 434, column 5)",
  " (in 'mvmer', line 435, column 4 to column 37)",
  " (in 'mvmer', line 420, column 91 to line 436, column 3)",
  " (in 'mvmer', line 451, column 9 to column 32)",
  " (in 'mvmer', line 450, column 24 to column 49)",
  " (in 'mvmer', line 450, column 9 to line 451, column 32)",
  " (in 'mvmer', line 449, column 24 to column 41)",
  " (in 'mvmer', line 449, column 9 to line 451, column 32)",
  " (in 'mvmer', line 448, column 24 to column 55)",
  " (in 'mvmer', line 448, column 9 to line 451, column 32)",
  " (in 'mvmer', line 447, column 24 to column 41)",
  " (in 'mvmer', line 447, column 9 to line 451, column 32)",
  " (in 'mvmer', line 446, column 24 to column 47)",
  " (in 'mvmer', line 446, column 4 to line 451, column 32)",
  " (in 'mvmer', line 452, column 4 to column 15)",
  " (in 'mvmer', line 445, column 45 to line 453, column 3)",
  " (in 'mvmer', line 464, column 4 to column 16)",
  " (in 'mvmer', line 482, column 9 to column 32)",
  " (in 'mvmer', line 476, column 8 to column 40)",
  " (in 'mvmer', line 477, column 8 to column 44)",
  " (in 'mvmer', line 478, column 8 to column 47)",
  " (in 'mvmer', line 479, column 8 to column 39)",
  " (in 'mvmer', line 475, column 35 to line 480, column 7)",
  " (in 'mvmer', line 475, column 6 to line 480, column 7)",
  " (in 'mvmer', line 474, column 24 to line 481, column 5)",
  " (in 'mvmer', line 474, column 9 to line 482, column 32)",
  " (in 'mvmer', line 469, column 8 to column 28)",
  " (in 'mvmer', line 470, column 8 to column 53)",
  " (in 'mvmer', line 471, column 8 to column 39)",
  " (in 'mvmer', line 468, column 35 to line 472, column 7)",
  " (in 'mvmer', line 468, column 6 to line 472, column 7)",
  " (in 'mvmer', line 467, column 24 to line 473, column 5)",
  " (in 'mvmer', line 467, column 9 to line 482, column 32)",
  " (in 'mvmer', line 466, column 24 to column 83)",
  " (in 'mvmer', line 466, column 9 to line 482, column 32)",
  " (in 'mvmer', line 465, column 19 to column 62)",
  " (in 'mvmer', line 465, column 4 to line 482, column 32)",
  " (in 'mvmer', line 483, column 4 to column 14)",
  " (in 'mvmer', line 463, column 75 to line 484, column 3)",
  " (in 'mvmer', line 494, column 4 to column 22)",
  " (in 'mvmer', line 495, column 11 to column 12)",
  " (in 'mvmer', line 495, column 4 to column 17)",
  " (in 'mvmer', line 504, column 9 to column 32)",
  " (in 'mvmer', line 501, column 13 to column 14)",
  " (in 'mvmer', line 501, column 6 to column 46)",
  " (in 'mvmer', line 502, column 21 to column 69)",
  " (in 'mvmer', line 502, column 6 to column 69)",
  " (in 'mvmer', line 500, column 24 to line 503, column 5)",
  " (in 'mvmer', line 500, column 9 to line 504, column 32)",
  " (in 'mvmer', line 498, column 8 to column 62)",
  " (in 'mvmer', line 497, column 6 to line 498, column 62)",
  " (in 'mvmer', line 496, column 19 to line 499, column 5)",
  " (in 'mvmer', line 496, column 4 to line 504, column 32)",
  " (in 'mvmer', line 505, column 4 to column 14)",
  " (in 'mvmer', line 493, column 75 to line 506, column 3)",
  " (in 'mvmer', line 519, column 9 to column 32)",
  " (in 'mvmer', line 518, column 24 to column 40)",
  " (in 'mvmer', line 518, column 9 to line 519, column 32)",
  " (in 'mvmer', line 517, column 24 to column 40)",
  " (in 'mvmer', line 517, column 9 to line 519, column 32)",
  " (in 'mvmer', line 516, column 24 to column 35)",
  " (in 'mvmer', line 516, column 4 to line 519, column 32)",
  " (in 'mvmer', line 520, column 4 to column 15)",
  " (in 'mvmer', line 515, column 45 to line 521, column 3)",
  " (in 'mvmer', line 531, column 4 to line 532, column 65)",
  " (in 'mvmer', line 530, column 62 to line 533, column 3)",
  " (in 'mvmer', line 546, column 9 to column 32)",
  " (in 'mvmer', line 545, column 24 to column 40)",
  " (in 'mvmer', line 545, column 9 to line 546, column 32)",
  " (in 'mvmer', line 544, column 24 to column 40)",
  " (in 'mvmer', line 544, column 9 to line 546, column 32)",
  " (in 'mvmer', line 543, column 24 to column 35)",
  " (in 'mvmer', line 543, column 4 to line 546, column 32)",
  " (in 'mvmer', line 547, column 4 to column 15)",
  " (in 'mvmer', line 542, column 45 to line 548, column 3)",
  " (in 'mvmer', line 562, column 4 to line 563, column 39)",
  " (in 'mvmer', line 570, column 9 to column 32)",
  " (in 'mvmer', line 569, column 6 to column 65)",
  " (in 'mvmer', line 568, column 9 to line 570, column 32)",
  " (in 'mvmer', line 567, column 6 to column 59)",
  " (in 'mvmer', line 566, column 9 to line 570, column 32)",
  " (in 'mvmer', line 565, column 6 to column 59)",
  " (in 'mvmer', line 564, column 4 to line 570, column 32)",
  " (in 'mvmer', line 571, column 4 to column 15)",
  " (in 'mvmer', line 561, column 42 to line 572, column 3)",
  " (in 'mvmer', line 583, column 4 to column 22)",
  " (in 'mvmer', line 584, column 11 to column 12)",
  " (in 'mvmer', line 584, column 4 to column 17)",
  " (in 'mvmer', line 600, column 9 to column 32)",
  " (in 'mvmer', line 597, column 8 to column 57)",
  " (in 'mvmer', line 596, column 21 to line 598, column 7)",
  " (in 'mvmer', line 596, column 6 to line 598, column 7)",
  " (in 'mvmer', line 595, column 24 to line 599, column 5)",
  " (in 'mvmer', line 595, column 9 to line 600, column 32)",
  " (in 'mvmer', line 592, column 8 to column 62)",
  " (in 'mvmer', line 591, column 21 to line 593, column 7)",
  " (in 'mvmer', line 591, column 6 to line 593, column 7)",
  " (in 'mvmer', line 590, column 24 to line 594, column 5)",
  " (in 'mvmer', line 590, column 9 to line 600, column 32)",
  " (in 'mvmer', line 587, column 8 to column 57)",
  " (in 'mvmer', line 586, column 21 to line 588, column 7)",
  " (in 'mvmer', line 586, column 6 to line 588, column 7)",
  " (in 'mvmer', line 585, column 19 to line 589, column 5)",
  " (in 'mvmer', line 585, column 4 to line 600, column 32)",
  " (in 'mvmer', line 601, column 4 to column 14)",
  " (in 'mvmer', line 582, column 62 to line 602, column 3)",
  " (in 'mvmer', line 616, column 9 to column 32)",
  " (in 'mvmer', line 615, column 24 to column 45)",
  " (in 'mvmer', line 615, column 9 to line 616, column 32)",
  " (in 'mvmer', line 614, column 24 to column 40)",
  " (in 'mvmer', line 614, column 9 to line 616, column 32)",
  " (in 'mvmer', line 613, column 24 to column 40)",
  " (in 'mvmer', line 613, column 9 to line 616, column 32)",
  " (in 'mvmer', line 612, column 24 to column 35)",
  " (in 'mvmer', line 612, column 4 to line 616, column 32)",
  " (in 'mvmer', line 617, column 4 to column 15)",
  " (in 'mvmer', line 611, column 52 to line 618, column 3)",
  " (in 'mvmer', line 632, column 4 to line 634, column 60)",
  " (in 'mvmer', line 631, column 51 to line 635, column 3)",
  " (in 'mvmer', line 650, column 11 to column 18)",
  " (in 'mvmer', line 650, column 4 to column 57)",
  " (in 'mvmer', line 651, column 4 to line 652, column 67)",
  " (in 'mvmer', line 649, column 64 to line 653, column 3)",
  " (in 'mvmer', line 665, column 4 to column 26)",
  " (in 'mvmer', line 666, column 4 to column 30)",
  " (in 'mvmer', line 667, column 4 to column 37)",
  " (in 'mvmer', line 668, column 4 to line 669, column 26)",
  " (in 'mvmer', line 671, column 9 to column 24)",
  " (in 'mvmer', line 670, column 30 to column 39)",
  " (in 'mvmer', line 670, column 4 to line 671, column 24)",
  " (in 'mvmer', line 664, column 46 to line 672, column 3)",
  " (in 'mvmer', line 688, column 9 to column 32)",
  " (in 'mvmer', line 687, column 24 to column 53)",
  " (in 'mvmer', line 687, column 9 to line 688, column 32)",
  " (in 'mvmer', line 686, column 24 to column 40)",
  " (in 'mvmer', line 686, column 9 to line 688, column 32)",
  " (in 'mvmer', line 685, column 24 to column 54)",
  " (in 'mvmer', line 685, column 9 to line 688, column 32)",
  " (in 'mvmer', line 684, column 24 to column 48)",
  " (in 'mvmer', line 684, column 9 to line 688, column 32)",
  " (in 'mvmer', line 683, column 24 to column 40)",
  " (in 'mvmer', line 683, column 9 to line 688, column 32)",
  " (in 'mvmer', line 682, column 19 to column 41)",
  " (in 'mvmer', line 682, column 4 to line 688, column 32)",
  " (in 'mvmer', line 689, column 4 to column 15)",
  " (in 'mvmer', line 681, column 44 to line 690, column 3)",
  " (in 'mvmer', line 703, column 9 to column 32)",
  " (in 'mvmer', line 702, column 24 to column 43)",
  " (in 'mvmer', line 702, column 9 to line 703, column 32)",
  " (in 'mvmer', line 701, column 24 to column 35)",
  " (in 'mvmer', line 701, column 9 to line 703, column 32)",
  " (in 'mvmer', line 700, column 19 to column 35)",
  " (in 'mvmer', line 700, column 4 to line 703, column 32)",
  " (in 'mvmer', line 704, column 4 to column 15)",
  " (in 'mvmer', line 699, column 46 to line 705, column 3)",
  " (in 'mvmer', line 717, column 11 to column 18)",
  " (in 'mvmer', line 717, column 4 to column 23)",
  " (in 'mvmer', line 718, column 11 to column 18)",
  " (in 'mvmer', line 718, column 4 to column 49)",
  " (in 'mvmer', line 720, column 6 to column 77)",
  " (in 'mvmer', line 719, column 25 to line 721, column 5)",
  " (in 'mvmer', line 719, column 4 to line 721, column 5)",
  " (in 'mvmer', line 722, column 4 to column 14)",
  " (in 'mvmer', line 716, column 66 to line 723, column 3)",
  " (in 'mvmer', line 736, column 11 to column 18)",
  " (in 'mvmer', line 736, column 4 to column 23)",
  " (in 'mvmer', line 737, column 11 to column 18)",
  " (in 'mvmer', line 737, column 4 to column 49)",
  " (in 'mvmer', line 738, column 11 to column 18)",
  " (in 'mvmer', line 738, column 4 to column 59)",
  " (in 'mvmer', line 740, column 6 to column 69)",
  " (in 'mvmer', line 739, column 25 to line 741, column 5)",
  " (in 'mvmer', line 739, column 4 to line 741, column 5)",
  " (in 'mvmer', line 742, column 4 to column 14)",
  " (in 'mvmer', line 735, column 79 to line 743, column 3)",
  " (in 'mvmer', line 757, column 9 to column 32)",
  " (in 'mvmer', line 756, column 24 to column 44)",
  " (in 'mvmer', line 756, column 9 to line 757, column 32)",
  " (in 'mvmer', line 755, column 24 to column 35)",
  " (in 'mvmer', line 755, column 9 to line 757, column 32)",
  " (in 'mvmer', line 754, column 24 to column 40)",
  " (in 'mvmer', line 754, column 4 to line 757, column 32)",
  " (in 'mvmer', line 758, column 4 to column 15)",
  " (in 'mvmer', line 753, column 45 to line 759, column 3)",
  " (in 'mvmer', line 770, column 4 to column 22)",
  " (in 'mvmer', line 771, column 11 to column 12)",
  " (in 'mvmer', line 771, column 4 to column 17)",
  " (in 'mvmer', line 778, column 9 to column 32)",
  " (in 'mvmer', line 775, column 13 to column 14)",
  " (in 'mvmer', line 775, column 6 to column 47)",
  " (in 'mvmer', line 776, column 21 to column 58)",
  " (in 'mvmer', line 776, column 6 to column 58)",
  " (in 'mvmer', line 774, column 24 to line 777, column 5)",
  " (in 'mvmer', line 774, column 9 to line 778, column 32)",
  " (in 'mvmer', line 773, column 21 to column 61)",
  " (in 'mvmer', line 773, column 6 to column 61)",
  " (in 'mvmer', line 772, column 4 to line 778, column 32)",
  " (in 'mvmer', line 779, column 4 to column 14)",
  " (in 'mvmer', line 769, column 54 to line 780, column 3)",
  " (in 'mvmer', line 792, column 4 to column 22)",
  " (in 'mvmer', line 793, column 11 to column 12)",
  " (in 'mvmer', line 793, column 4 to column 45)",
  " (in 'mvmer', line 794, column 11 to column 12)",
  " (in 'mvmer', line 794, column 4 to column 17)",
  " (in 'mvmer', line 795, column 19 to column 69)",
  " (in 'mvmer', line 795, column 4 to column 69)",
  " (in 'mvmer', line 796, column 4 to column 14)",
  " (in 'mvmer', line 791, column 64 to line 797, column 3)",
  " (in 'mvmer', line 806, column 4 to column 15)",
  " (in 'mvmer', line 808, column 30 to column 37)",
  " (in 'mvmer', line 808, column 9 to column 37)",
  " (in 'mvmer', line 807, column 25 to column 32)",
  " (in 'mvmer', line 807, column 4 to line 808, column 37)",
  " (in 'mvmer', line 809, column 4 to column 14)",
  " (in 'mvmer', line 805, column 39 to line 810, column 3)",
  " (in 'mvmer', line 820, column 4 to column 57)",
  " (in 'mvmer', line 819, column 30 to line 821, column 3)",
  " (in 'mvmer', line 823, column 4 to column 57)",
  " (in 'mvmer', line 822, column 30 to line 824, column 3)",
  " (in 'mvmer', line 833, column 10 to column 30)",
  " (in 'mvmer', line 833, column 4 to column 44)",
  " (in 'mvmer', line 834, column 4 to column 17)",
  " (in 'mvmer', line 837, column 8 to column 42)",
  " (in 'mvmer', line 838, column 8 to column 18)",
  " (in 'mvmer', line 836, column 23 to line 839, column 7)",
  " (in 'mvmer', line 836, column 6 to line 839, column 7)",
  " (in 'mvmer', line 835, column 21 to line 840, column 5)",
  " (in 'mvmer', line 835, column 4 to line 840, column 5)",
  " (in 'mvmer', line 841, column 4 to column 19)",
  " (in 'mvmer', line 832, column 41 to line 842, column 3)",
  " (in 'mvmer', line 855, column 4 to column 13)",
  " (in 'mvmer', line 859, column 6 to column 39)",
  " (in 'mvmer', line 861, column 8 to column 26)",
  " (in 'mvmer', line 860, column 6 to line 861, column 26)",
  " (in 'mvmer', line 858, column 9 to line 862, column 5)",
  " (in 'mvmer', line 857, column 6 to column 25)",
  " (in 'mvmer', line 856, column 4 to line 862, column 5)",
  " (in 'mvmer', line 863, column 4 to column 15)",
  " (in 'mvmer', line 854, column 51 to line 864, column 3)",
  " (in 'mvmer', line 879, column 11 to column 23)",
  " (in 'mvmer', line 879, column 4 to column 30)",
  " (in 'mvmer', line 902, column 6 to column 77)",
  " (in 'mvmer', line 901, column 9 to line 902, column 77)",
  " (in 'mvmer', line 900, column 6 to column 68)",
  " (in 'mvmer', line 899, column 9 to line 902, column 77)",
  " (in 'mvmer', line 893, column 6 to column 45)",
  " (in 'mvmer', line 897, column 8 to column 78)",
  " (in 'mvmer', line 895, column 8 to column 83)",
  " (in 'mvmer', line 894, column 6 to line 897, column 78)",
  " (in 'mvmer', line 892, column 30 to line 898, column 5)",
  " (in 'mvmer', line 892, column 9 to line 902, column 77)",
  " (in 'mvmer', line 886, column 6 to column 45)",
  " (in 'mvmer', line 890, column 8 to column 74)",
  " (in 'mvmer', line 888, column 8 to column 79)",
  " (in 'mvmer', line 887, column 6 to line 890, column 74)",
  " (in 'mvmer', line 885, column 30 to line 891, column 5)",
  " (in 'mvmer', line 885, column 9 to line 902, column 77)",
  " (in 'mvmer', line 883, column 6 to column 77)",
  " (in 'mvmer', line 882, column 60 to line 884, column 5)",
  " (in 'mvmer', line 882, column 30 to line 884, column 5)",
  " (in 'mvmer', line 882, column 9 to line 902, column 77)",
  " (in 'mvmer', line 881, column 30 to column 72)",
  " (in 'mvmer', line 881, column 9 to line 902, column 77)",
  " (in 'mvmer', line 880, column 25 to column 39)",
  " (in 'mvmer', line 880, column 4 to line 902, column 77)",
  " (in 'mvmer', line 903, column 4 to column 16)",
  " (in 'mvmer', line 878, column 85 to line 904, column 3)",
  " (in 'mvmer', line 920, column 11 to column 15)",
  " (in 'mvmer', line 920, column 16 to column 20)",
  " (in 'mvmer', line 920, column 4 to column 31)",
  " (in 'mvmer', line 921, column 4 to column 18)",
  " (in 'mvmer', line 922, column 4 to column 19)",
  " (in 'mvmer', line 923, column 4 to column 25)",
  " (in 'mvmer', line 926, column 8 to column 47)",
  " (in 'mvmer', line 927, column 8 to column 30)",
  " (in 'mvmer', line 925, column 25 to line 928, column 7)",
  " (in 'mvmer', line 925, column 6 to line 928, column 7)",
  " (in 'mvmer', line 924, column 15 to line 929, column 5)",
  " (in 'mvmer', line 924, column 4 to line 929, column 5)",
  " (in 'mvmer', line 936, column 13 to column 15)",
  " (in 'mvmer', line 936, column 16 to column 18)",
  " (in 'mvmer', line 936, column 6 to column 48)",
  " (in 'mvmer', line 938, column 8 to column 41)",
  " (in 'mvmer', line 939, column 8 to column 26)",
  " (in 'mvmer', line 941, column 10 to column 43)",
  " (in 'mvmer', line 942, column 10 to column 28)",
  " (in 'mvmer', line 940, column 27 to line 943, column 9)",
  " (in 'mvmer', line 940, column 8 to line 943, column 9)",
  " (in 'mvmer', line 937, column 22 to line 944, column 7)",
  " (in 'mvmer', line 937, column 6 to line 944, column 7)",
  " (in 'mvmer', line 946, column 15 to column 17)",
  " (in 'mvmer', line 946, column 8 to column 57)",
  " (in 'mvmer', line 947, column 8 to column 28)",
  " (in 'mvmer', line 948, column 8 to column 21)",
  " (in 'mvmer', line 945, column 24 to line 949, column 7)",
  " (in 'mvmer', line 945, column 6 to line 949, column 7)",
  " (in 'mvmer', line 935, column 9 to line 950, column 5)",
  " (in 'mvmer', line 931, column 6 to column 49)",
  " (in 'mvmer', line 933, column 8 to column 48)",
  " (in 'mvmer', line 932, column 6 to line 933, column 48)",
  " (in 'mvmer', line 930, column 17 to line 934, column 5)",
  " (in 'mvmer', line 930, column 4 to line 950, column 5)",
  " (in 'mvmer', line 951, column 4 to column 21)",
  " (in 'mvmer', line 919, column 88 to line 952, column 3)",
  " (in 'mvmer', line 976, column 4 to column 20)",
  " (in 'mvmer', line 977, column 4 to column 23)",
  " (in 'mvmer', line 978, column 4 to column 22)",
  " (in 'mvmer', line 979, column 4 to column 22)",
  " (in 'mvmer', line 980, column 11 to column 12)",
  " (in 'mvmer', line 980, column 4 to column 18)",
  " (in 'mvmer', line 983, column 9 to column 34)",
  " (in 'mvmer', line 982, column 15 to column 30)",
  " (in 'mvmer', line 982, column 4 to line 983, column 34)",
  " (in 'mvmer', line 988, column 36 to column 63)",
  " (in 'mvmer', line 988, column 11 to column 63)",
  " (in 'mvmer', line 987, column 36 to column 63)",
  " (in 'mvmer', line 987, column 11 to line 988, column 63)",
  " (in 'mvmer', line 986, column 31 to column 47)",
  " (in 'mvmer', line 986, column 6 to line 988, column 63)",
  " (in 'mvmer', line 985, column 28 to line 989, column 5)",
  " (in 'mvmer', line 985, column 4 to line 989, column 5)",
  " (in 'mvmer', line 994, column 10 to column 66)",
  " (in 'mvmer', line 993, column 8 to line 994, column 66)",
  " (in 'mvmer', line 992, column 6 to line 994, column 66)",
  " (in 'mvmer', line 991, column 16 to line 995, column 5)",
  " (in 'mvmer', line 991, column 4 to line 995, column 5)",
  " (in 'mvmer', line 999, column 10 to column 66)",
  " (in 'mvmer', line 998, column 8 to line 999, column 66)",
  " (in 'mvmer', line 997, column 6 to line 999, column 66)",
  " (in 'mvmer', line 996, column 16 to line 1000, column 5)",
  " (in 'mvmer', line 996, column 4 to line 1000, column 5)",
  " (in 'mvmer', line 1002, column 22 to column 37)",
  " (in 'mvmer', line 1002, column 4 to column 37)",
  " (in 'mvmer', line 1004, column 4 to column 15)",
  " (in 'mvmer', line 975, column 53 to line 1005, column 3)",
  " (in 'mvmer', line 1016, column 11 to column 20)",
  " (in 'mvmer', line 1016, column 4 to column 25)",
  " (in 'mvmer', line 1028, column 6 to column 36)",
  " (in 'mvmer', line 1027, column 9 to line 1028, column 36)",
  " (in 'mvmer', line 1026, column 6 to column 36)",
  " (in 'mvmer', line 1025, column 9 to line 1028, column 36)",
  " (in 'mvmer', line 1024, column 6 to column 35)",
  " (in 'mvmer', line 1023, column 9 to line 1028, column 36)",
  " (in 'mvmer', line 1022, column 6 to column 43)",
  " (in 'mvmer', line 1021, column 9 to line 1028, column 36)",
  " (in 'mvmer', line 1020, column 6 to column 36)",
  " (in 'mvmer', line 1019, column 9 to line 1028, column 36)",
  " (in 'mvmer', line 1018, column 6 to column 36)",
  " (in 'mvmer', line 1017, column 4 to line 1028, column 36)",
  " (in 'mvmer', line 1029, column 4 to column 14)",
  " (in 'mvmer', line 1015, column 55 to line 1030, column 3)",
  " (in 'mvmer', line 1043, column 4 to column 16)",
  " (in 'mvmer', line 1071, column 9 to column 35)",
  " (in 'mvmer', line 1069, column 11 to column 83)",
  " (in 'mvmer', line 1068, column 23 to column 78)",
  " (in 'mvmer', line 1068, column 8 to line 1069, column 83)",
  " (in 'mvmer', line 1067, column 26 to line 1070, column 5)",
  " (in 'mvmer', line 1067, column 9 to line 1071, column 35)",
  " (in 'mvmer', line 1065, column 11 to column 68)",
  " (in 'mvmer', line 1064, column 21 to column 61)",
  " (in 'mvmer', line 1064, column 6 to line 1065, column 68)",
  " (in 'mvmer', line 1063, column 41 to line 1066, column 5)",
  " (in 'mvmer', line 1063, column 9 to line 1071, column 35)",
  " (in 'mvmer', line 1061, column 6 to column 53)",
  " (in 'mvmer', line 1060, column 26 to line 1062, column 5)",
  " (in 'mvmer', line 1060, column 9 to line 1071, column 35)",
  " (in 'mvmer', line 1058, column 11 to column 69)",
  " (in 'mvmer', line 1057, column 21 to column 65)",
  " (in 'mvmer', line 1057, column 6 to line 1058, column 69)",
  " (in 'mvmer', line 1056, column 26 to line 1059, column 5)",
  " (in 'mvmer', line 1056, column 9 to line 1071, column 35)",
  " (in 'mvmer', line 1053, column 6 to line 1054, column 56)",
  " (in 'mvmer', line 1052, column 26 to line 1055, column 5)",
  " (in 'mvmer', line 1052, column 9 to line 1071, column 35)",
  " (in 'mvmer', line 1050, column 6 to column 59)",
  " (in 'mvmer', line 1049, column 26 to line 1051, column 5)",
  " (in 'mvmer', line 1049, column 9 to line 1071, column 35)",
  " (in 'mvmer', line 1047, column 11 to column 56)",
  " (in 'mvmer', line 1046, column 26 to column 69)",
  " (in 'mvmer', line 1046, column 11 to line 1047, column 56)",
  " (in 'mvmer', line 1045, column 21 to column 61)",
  " (in 'mvmer', line 1045, column 6 to line 1047, column 56)",
  " (in 'mvmer', line 1044, column 21 to line 1048, column 5)",
  " (in 'mvmer', line 1044, column 4 to line 1071, column 35)",
  " (in 'mvmer', line 1072, column 4 to column 14)",
  " (in 'mvmer', line 1042, column 81 to line 1073, column 3)",
  " (in 'mvmer', line 1093, column 4 to column 16)",
  " (in 'mvmer', line 1125, column 6 to column 39)",
  " (in 'mvmer', line 1124, column 30 to line 1126, column 5)",
  " (in 'mvmer', line 1124, column 9 to line 1126, column 5)",
  " (in 'mvmer', line 1120, column 6 to column 39)",
  " (in 'mvmer', line 1121, column 6 to column 41)",
  " (in 'mvmer', line 1122, column 6 to column 62)",
  " (in 'mvmer', line 1119, column 30 to line 1123, column 5)",
  " (in 'mvmer', line 1119, column 9 to line 1126, column 5)",
  " (in 'mvmer', line 1116, column 6 to column 39)",
  " (in 'mvmer', line 1117, column 6 to column 41)",
  " (in 'mvmer', line 1115, column 30 to line 1118, column 5)",
  " (in 'mvmer', line 1115, column 9 to line 1126, column 5)",
  " (in 'mvmer', line 1105, column 6 to column 39)",
  " (in 'mvmer', line 1106, column 6 to column 41)",
  " (in 'mvmer', line 1107, column 6 to column 70)",
  " (in 'mvmer', line 1108, column 6 to column 41)",
  " (in 'mvmer', line 1110, column 6 to column 76)",
  " (in 'mvmer', line 1111, column 6 to column 42)",
  " (in 'mvmer', line 1112, column 6 to column 85)",
  " (in 'mvmer', line 1113, column 6 to column 64)",
  " (in 'mvmer', line 1104, column 30 to line 1114, column 5)",
  " (in 'mvmer', line 1104, column 9 to line 1126, column 5)",
  " (in 'mvmer', line 1097, column 6 to column 39)",
  " (in 'mvmer', line 1098, column 6 to column 41)",
  " (in 'mvmer', line 1099, column 6 to column 70)",
  " (in 'mvmer', line 1100, column 6 to column 42)",
  " (in 'mvmer', line 1101, column 6 to column 85)",
  " (in 'mvmer', line 1102, column 6 to column 64)",
  " (in 'mvmer', line 1096, column 30 to line 1103, column 5)",
  " (in 'mvmer', line 1096, column 9 to line 1126, column 5)",
  " (in 'mvmer', line 1095, column 30 to column 63)",
  " (in 'mvmer', line 1095, column 9 to line 1126, column 5)",
  " (in 'mvmer', line 1094, column 30 to column 63)",
  " (in 'mvmer', line 1094, column 4 to line 1126, column 5)",
  " (in 'mvmer', line 1127, column 4 to column 14)",
  " (in 'mvmer', line 1092, column 48 to line 1129, column 3)",
  " (in 'mvmer', line 1142, column 4 to column 16)",
  " (in 'mvmer', line 1146, column 6 to column 53)",
  " (in 'mvmer', line 1145, column 9 to line 1146, column 53)",
  " (in 'mvmer', line 1144, column 6 to column 46)",
  " (in 'mvmer', line 1143, column 4 to line 1146, column 53)",
  " (in 'mvmer', line 1149, column 4 to column 14)",
  " (in 'mvmer', line 1141, column 80 to line 1150, column 3)",
  " (in 'mvmer', line 1163, column 4 to column 16)",
  " (in 'mvmer', line 1170, column 8 to column 49)",
  " (in 'mvmer', line 1168, column 8 to column 54)",
  " (in 'mvmer', line 1167, column 11 to line 1170, column 49)",
  " (in 'mvmer', line 1166, column 8 to column 47)",
  " (in 'mvmer', line 1165, column 6 to line 1170, column 49)",
  " (in 'mvmer', line 1164, column 31 to line 1171, column 5)",
  " (in 'mvmer', line 1164, column 4 to line 1171, column 5)",
  " (in 'mvmer', line 1172, column 4 to column 14)",
  " (in 'mvmer', line 1162, column 66 to line 1173, column 3)",
  " (in 'mvmer', line 1187, column 4 to column 21)",
  " (in 'mvmer', line 1188, column 4 to column 22)",
  " (in 'mvmer', line 1218, column 6 to column 40)",
  " (in 'mvmer', line 1220, column 8 to column 24)",
  " (in 'mvmer', line 1224, column 10 to column 57)",
  " (in 'mvmer', line 1222, column 10 to column 29)",
  " (in 'mvmer', line 1221, column 8 to line 1224, column 57)",
  " (in 'mvmer', line 1228, column 10 to column 63)",
  " (in 'mvmer', line 1226, column 10 to column 46)",
  " (in 'mvmer', line 1225, column 8 to line 1228, column 63)",
  " (in 'mvmer', line 1219, column 21 to line 1229, column 7)",
  " (in 'mvmer', line 1219, column 6 to line 1229, column 7)",
  " (in 'mvmer', line 1217, column 26 to line 1230, column 5)",
  " (in 'mvmer', line 1217, column 9 to line 1230, column 5)",
  " (in 'mvmer', line 1209, column 6 to column 40)",
  " (in 'mvmer', line 1214, column 10 to column 53)",
  " (in 'mvmer', line 1212, column 10 to column 41)",
  " (in 'mvmer', line 1211, column 8 to line 1214, column 53)",
  " (in 'mvmer', line 1210, column 21 to line 1215, column 7)",
  " (in 'mvmer', line 1210, column 6 to line 1215, column 7)",
  " (in 'mvmer', line 1208, column 41 to line 1216, column 5)",
  " (in 'mvmer', line 1208, column 9 to line 1230, column 5)",
  " (in 'mvmer', line 1206, column 6 to column 53)",
  " (in 'mvmer', line 1205, column 26 to line 1207, column 5)",
  " (in 'mvmer', line 1205, column 9 to line 1230, column 5)",
  " (in 'mvmer', line 1203, column 8 to column 41)",
  " (in 'mvmer', line 1202, column 6 to line 1203, column 41)",
  " (in 'mvmer', line 1201, column 26 to line 1204, column 5)",
  " (in 'mvmer', line 1201, column 9 to line 1230, column 5)",
  " (in 'mvmer', line 1199, column 8 to column 52)",
  " (in 'mvmer', line 1198, column 6 to line 1199, column 52)",
  " (in 'mvmer', line 1197, column 26 to line 1200, column 5)",
  " (in 'mvmer', line 1197, column 9 to line 1230, column 5)",
  " (in 'mvmer', line 1195, column 8 to column 54)",
  " (in 'mvmer', line 1194, column 6 to line 1195, column 54)",
  " (in 'mvmer', line 1193, column 26 to line 1196, column 5)",
  " (in 'mvmer', line 1193, column 9 to line 1230, column 5)",
  " (in 'mvmer', line 1191, column 8 to column 46)",
  " (in 'mvmer', line 1190, column 6 to line 1191, column 46)",
  " (in 'mvmer', line 1189, column 21 to line 1192, column 5)",
  " (in 'mvmer', line 1189, column 4 to line 1230, column 5)",
  " (in 'mvmer', line 1231, column 4 to column 18)",
  " (in 'mvmer', line 1232, column 4 to column 20)",
  " (in 'mvmer', line 1186, column 61 to line 1233, column 3)"};
template <typename T2__, typename T3__, typename T4__, typename T5__,
          typename T6__, typename T7__,
          stan::require_all_t<stan::is_stan_scalar<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>,
                              stan::is_col_vector<T5__>,
                              stan::is_vt_not_complex<T5__>,
                              stan::is_col_vector<T6__>,
                              stan::is_vt_not_complex<T6__>,
                              stan::is_col_vector<T7__>,
                              stan::is_vt_not_complex<T7__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<T2__, stan::base_type_t<T3__>,
                stan::base_type_t<T4__>, stan::base_type_t<T5__>,
                stan::base_type_t<T6__>,
                stan::promote_args_t<stan::base_type_t<T7__>>>,-1,1>
make_theta_L(const int& len_theta_L, const std::vector<int>& p, const T2__&
             dispersion, const T3__& tau_arg__, const T4__& scale_arg__,
             const T5__& zeta_arg__, const T6__& rho_arg__, const T7__&
             z_T_arg__, std::ostream* pstream__);
template <typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>>,-1,1>
make_b(const T0__& z_b_arg__, const T1__& theta_L_arg__,
       const std::vector<int>& p, const std::vector<int>& l, std::ostream*
       pstream__);
template <bool propto__, typename T0__, typename T1__, typename T2__,
          typename T3__, typename T4__, typename T5__, typename T6__,
          typename T7__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_col_vector<T7__>,
                              stan::is_vt_not_complex<T7__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>,
  stan::base_type_t<T2__>, stan::base_type_t<T3__>, stan::base_type_t<T4__>,
  stan::promote_args_t<T5__, T6__, stan::base_type_t<T7__>>>
decov_lpdf(const T0__& z_b_arg__, const T1__& z_T_arg__, const T2__&
           rho_arg__, const T3__& zeta_arg__, const T4__& tau_arg__,
           const std::vector<T5__>& regularization, const std::vector<T6__>&
           delta, const T7__& shape_arg__, const int& t,
           const std::vector<int>& p, std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__, typename T3__,
          typename T4__, typename T5__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T4__>,
                              stan::is_stan_scalar<T5__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>, T1__, T2__, T3__,
                T4__, stan::promote_args_t<T5__>>,-1,1>
hs_prior(const T0__& z_beta_arg__, const std::vector<T1__>& global,
         const std::vector<Eigen::Matrix<T2__,-1,1>>& local, const T3__&
         global_prior_scale, const T4__& error_scale, const T5__& c2,
         std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__, typename T3__,
          typename T4__, typename T5__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T4__>,
                              stan::is_stan_scalar<T5__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>, T1__, T2__, T3__,
                T4__, stan::promote_args_t<T5__>>,-1,1>
hsplus_prior(const T0__& z_beta_arg__, const std::vector<T1__>& global,
             const std::vector<Eigen::Matrix<T2__,-1,1>>& local, const T3__&
             global_prior_scale, const T4__& error_scale, const T5__& c2,
             std::ostream* pstream__);
template <typename T0__, typename T1__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T1__>>* = nullptr>
stan::promote_args_t<T0__, T1__>
CFt(const T0__& z, const T1__& df, std::ostream* pstream__);
std::vector<std::vector<int>>
make_V(const int& N, const int& t, const std::vector<int>& v, std::ostream*
       pstream__);
double
make_lower(const int& family, const int& link, std::ostream* pstream__);
double
make_upper(const int& family, const int& link, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_bern(const T0__& eta_arg__, const int& link, std::ostream* pstream__);
template <bool propto__, typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>>
bern_lpdf(const T0__& eta0_arg__, const T1__& eta1_arg__, const int& link,
          const std::vector<int>& N, std::ostream* pstream__);
template <typename T1__,
          stan::require_all_t<stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T1__>>,-1,1>
pw_bern(const int& y, const T1__& eta_arg__, const int& link, std::ostream*
        pstream__);
template <typename T2__,
          stan::require_all_t<stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T2__>>
log_clogit_denom(const int& N_j, const int& D_j, const T2__& eta_j_arg__,
                 std::ostream* pstream__);
template <bool propto__, typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>>
clogit_lpdf(const T0__& eta0_arg__, const T1__& eta1_arg__,
            const std::vector<int>& successes, const std::vector<int>&
            failures, const std::vector<int>& observations, std::ostream*
            pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_binom(const T0__& eta_arg__, const int& link, std::ostream* pstream__);
template <bool propto__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T2__>>
binom_lpmf(const std::vector<int>& y, const std::vector<int>& trials,
           const T2__& eta_arg__, const int& link, std::ostream* pstream__);
template <typename T2__,
          stan::require_all_t<stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T2__>>,-1,1>
pw_binom(const std::vector<int>& y, const std::vector<int>& trials,
         const T2__& eta_arg__, const int& link, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_gauss(const T0__& eta_arg__, const int& link, std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T2__>,-1,1>
pw_gauss(const T0__& y_arg__, const T1__& eta_arg__, const T2__& sigma,
         const int& link, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_gamma(const T0__& eta_arg__, const int& link, std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__, typename T4__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T4__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>, T2__,
  T4__>
GammaReg(const T0__& y_arg__, const T1__& eta_arg__, const T2__& shape,
         const int& link, const T4__& sum_log_y, std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T2__>,-1,1>
pw_gamma(const T0__& y_arg__, const T1__& eta_arg__, const T2__& shape,
         const int& link, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_inv_gaussian(const T0__& eta_arg__, const int& link, std::ostream*
                     pstream__);
template <typename T0__, typename T1__, typename T2__, typename T3__,
          typename T4__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>, T2__,
  T3__, stan::base_type_t<T4__>>
inv_gaussian(const T0__& y_arg__, const T1__& mu_arg__, const T2__& lambda,
             const T3__& sum_log_y, const T4__& sqrt_y_arg__, std::ostream*
             pstream__);
template <typename T0__, typename T1__, typename T2__, typename T4__,
          typename T5__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>,
                              stan::is_col_vector<T5__>,
                              stan::is_vt_not_complex<T5__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T2__, stan::base_type_t<T4__>,
                stan::base_type_t<T5__>>,-1,1>
pw_inv_gaussian(const T0__& y_arg__, const T1__& eta_arg__, const T2__&
                lambda, const int& link, const T4__& log_y_arg__, const T5__&
                sqrt_y_arg__, std::ostream* pstream__);
template <typename T0__, typename T1__, typename RNG,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T1__>>* = nullptr>
stan::promote_args_t<T0__, T1__>
inv_gaussian_rng(const T0__& mu, const T1__& lambda, RNG& base_rng__,
                 std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_beta(const T0__& eta_arg__, const int& link, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_beta_z(const T0__& eta_arg__, const int& link, std::ostream*
               pstream__);
template <typename T0__, typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, T2__>,-1,1>
pw_beta(const T0__& y_arg__, const T1__& eta_arg__, const T2__& dispersion,
        const int& link, std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>, stan::base_type_t<T2__>>,-1,1>
pw_beta_z(const T0__& y_arg__, const T1__& eta_arg__, const T2__&
          eta_z_arg__, const int& link, const int& link_phi, std::ostream*
          pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_count(const T0__& eta_arg__, const int& link, std::ostream* pstream__);
template <typename T1__,
          stan::require_all_t<stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T1__>>,-1,1>
pw_pois(const std::vector<int>& y, const T1__& eta_arg__, const int& link,
        std::ostream* pstream__);
template <typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T1__>, T2__>,-1,1>
pw_nb(const std::vector<int>& y, const T1__& eta_arg__, const T2__& theta,
      const int& link, std::ostream* pstream__);
int get_nvars_for_hs(const int& prior_dist, std::ostream* pstream__);
double lb(const int& intercept_type, std::ostream* pstream__);
double ub(const int& intercept_type, std::ostream* pstream__);
std::vector<int> lower_tri_indices(const int& dim, std::ostream* pstream__);
template <typename T0__, typename T2__, typename T3__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>>* = nullptr>
stan::promote_args_t<T0__, T2__, T3__>
make_aux(const T0__& aux_unscaled, const int& prior_dist, const T2__&
         prior_mean, const T3__& prior_scale, std::ostream* pstream__);
template <typename T0__, typename T2__, typename T3__, typename T4__,
          typename T5__, typename T6__, typename T7__, typename T8__,
          typename T9__, typename T10__, typename T12__, typename T13__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_stan_scalar<T7__>,
                              stan::is_stan_scalar<T8__>,
                              stan::is_stan_scalar<T9__>,
                              stan::is_stan_scalar<T10__>,
                              stan::is_stan_scalar<T12__>,
                              stan::is_stan_scalar<T13__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T2__>, stan::base_type_t<T3__>,
                stan::base_type_t<T4__>, T5__,
                stan::promote_args_t<T6__, T7__, T8__, T9__, T10__,
                  stan::promote_args_t<T12__, T13__>>>,-1,1>
make_beta(const T0__& z_beta_arg__, const int& prior_dist, const T2__&
          prior_mean_arg__, const T3__& prior_scale_arg__, const T4__&
          prior_df_arg__, const T5__& global_prior_scale,
          const std::vector<T6__>& global,
          const std::vector<Eigen::Matrix<T7__,-1,1>>& local,
          const std::vector<T8__>& ool,
          const std::vector<Eigen::Matrix<T9__,-1,1>>& mix,
          const std::vector<T10__>& aux, const int& family, const T12__&
          slab_scale, const std::vector<T13__>& caux, std::ostream* pstream__);
template <typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>>,-1,-1>
make_b_matrix(const T0__& z_b_arg__, const T1__& theta_L_arg__,
              const std::vector<int>& p, const std::vector<int>& l,
              const int& i, std::ostream* pstream__);
template <typename T0__, typename T1__, typename T2__, typename T5__,
          typename T6__, typename T7__, typename T8__, typename T12__,
          stan::require_all_t<stan::is_eigen_matrix_dynamic<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_col_vector<T6__>,
                              stan::is_vt_not_complex<T6__>,
                              stan::is_eigen_matrix_dynamic<T7__>,
                              stan::is_vt_not_complex<T7__>,
                              stan::is_eigen_matrix_dynamic<T8__>,
                              stan::is_vt_not_complex<T8__>,
                              stan::is_col_vector<T12__>,
                              stan::is_vt_not_complex<T12__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>, T1__, T2__, T5__,
                stan::base_type_t<T6__>,
                stan::promote_args_t<stan::base_type_t<T7__>,
                  stan::base_type_t<T8__>, stan::base_type_t<T12__>>>,-1,1>
evaluate_eta(const T0__& X_arg__,
             const std::vector<Eigen::Matrix<T1__,-1,1>>& Z1,
             const std::vector<Eigen::Matrix<T2__,-1,1>>& Z2,
             const std::vector<int>& Z1_id, const std::vector<int>& Z2_id,
             const std::vector<T5__>& gamma, const T6__& beta_arg__,
             const T7__& b1Mat_arg__, const T8__& b2Mat_arg__, const int&
             b1Mat_colshift, const int& b2Mat_colshift, const int&
             intercept_type, const T12__& Ti_arg__, std::ostream* pstream__);
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>* = nullptr>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
evaluate_mu(const T0__& eta_arg__, const int& family, const int& link,
            std::ostream* pstream__);
template <bool propto__, typename T0__, typename T2__, typename T3__,
          typename T6__, typename T7__, typename T8__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_col_vector<T7__>,
                              stan::is_vt_not_complex<T7__>,
                              stan::is_col_vector<T8__>,
                              stan::is_vt_not_complex<T8__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T2__>, T3__,
  T6__, stan::base_type_t<T7__>,
  stan::promote_args_t<stan::base_type_t<T8__>>>
glm_lpdf(const T0__& y_real_arg__, const std::vector<int>& y_integer,
         const T2__& eta_arg__, const std::vector<T3__>& aux, const int&
         family, const int& link, const T6__& sum_log_y, const T7__&
         sqrt_y_arg__, const T8__& log_y_arg__, std::ostream* pstream__);
template <bool propto__, typename T0__, typename T2__, typename T3__,
          typename T4__, typename T5__, typename T6__, typename T7__,
          typename T8__, typename T9__, typename T10__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_stan_scalar<T4__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_stan_scalar<T7__>,
                              stan::is_stan_scalar<T8__>,
                              stan::is_stan_scalar<T9__>,
                              stan::is_stan_scalar<T10__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T2__>,
  stan::base_type_t<T3__>, T4__, T5__,
  stan::promote_args_t<T6__, T7__, T8__, T9__, T10__>>
beta_custom_lpdf(const T0__& z_beta_arg__, const int& prior_dist, const T2__&
                 prior_scale_arg__, const T3__& prior_df_arg__, const T4__&
                 global_prior_df,
                 const std::vector<Eigen::Matrix<T5__,-1,1>>& local,
                 const std::vector<T6__>& global,
                 const std::vector<Eigen::Matrix<T7__,-1,1>>& mix,
                 const std::vector<T8__>& one_over_lambda, const T9__&
                 slab_df, const std::vector<T10__>& caux, std::ostream*
                 pstream__);
template <bool propto__, typename T0__, typename T2__, typename T3__,
          typename T4__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T4__>>* = nullptr>
stan::promote_args_t<T0__, T2__, T3__, T4__>
gamma_custom_lpdf(const T0__& gamma, const int& dist, const T2__& mean_,
                  const T3__& scale, const T4__& df, std::ostream* pstream__);
template <bool propto__, typename T0__, typename T2__, typename T3__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>>* = nullptr>
stan::promote_args_t<T0__, T2__, T3__>
aux_lpdf(const T0__& aux_unscaled, const int& dist, const T2__& scale,
         const T3__& df, std::ostream* pstream__);
template <typename T0__, typename T1__, typename RNG,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>>* = nullptr>
stan::promote_args_t<stan::base_type_t<T0__>, T1__>
mean_PPD_rng(const T0__& mu_arg__, const std::vector<T1__>& aux, const int&
             family, RNG& base_rng__, std::ostream* pstream__);
template <typename 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__ = 478;
    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__ = 480;
    zeta_mark = 1;
    int rho_mark = std::numeric_limits<int>::min();
    current_statement__ = 481;
    rho_mark = 1;
    int z_T_mark = std::numeric_limits<int>::min();
    current_statement__ = 482;
    z_T_mark = 1;
    int theta_L_mark = std::numeric_limits<int>::min();
    current_statement__ = 483;
    theta_L_mark = 1;
    current_statement__ = 525;
    for (int i = 1; i <= stan::math::size(p); ++i) {
      int nc = std::numeric_limits<int>::min();
      current_statement__ = 484;
      nc = stan::model::rvalue(p, "p", stan::model::index_uni(i));
      current_statement__ = 523;
      if (stan::math::logical_eq(nc, 1)) {
        current_statement__ = 520;
        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__ = 521;
        theta_L_mark = (theta_L_mark + 1);
      } else {
        current_statement__ = 485;
        stan::math::validate_non_negative_index("T_i", "nc", nc);
        current_statement__ = 486;
        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__ = 490;
        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__ = 491;
        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__ = 492;
        stan::model::assign(pi, stan::math::segment(zeta, zeta_mark, nc),
          "assigning variable pi");
        current_statement__ = 493;
        stan::model::assign(pi,
          stan::math::divide(stan::model::deep_copy(pi), stan::math::sum(pi)),
          "assigning variable pi");
        current_statement__ = 494;
        zeta_mark = (zeta_mark + nc);
        current_statement__ = 495;
        std_dev = stan::math::sqrt(
                    (stan::model::rvalue(pi, "pi", stan::model::index_uni(1))
                    * trace_T_i));
        current_statement__ = 496;
        stan::model::assign(T_i, std_dev, "assigning variable T_i",
          stan::model::index_uni(1), stan::model::index_uni(1));
        current_statement__ = 497;
        std_dev = stan::math::sqrt(
                    (stan::model::rvalue(pi, "pi", stan::model::index_uni(2))
                    * trace_T_i));
        current_statement__ = 498;
        T21 = ((2.0 *
          stan::model::rvalue(rho, "rho", stan::model::index_uni(rho_mark)))
          - 1.0);
        current_statement__ = 499;
        rho_mark = (rho_mark + 1);
        current_statement__ = 500;
        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__ = 501;
        stan::model::assign(T_i, (std_dev * T21), "assigning variable T_i",
          stan::model::index_uni(2), stan::model::index_uni(1));
        current_statement__ = 513;
        for (int r = 2; r <= (nc - 1); ++r) {
          int rp1 = std::numeric_limits<int>::min();
          current_statement__ = 502;
          rp1 = (r + 1);
          current_statement__ = 503;
          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__ = 504;
          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__ = 505;
          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__ = 506;
          z_T_mark = (z_T_mark + r);
          current_statement__ = 507;
          std_dev = stan::math::sqrt(
                      (stan::model::rvalue(pi, "pi",
                         stan::model::index_uni(rp1)) * trace_T_i));
          current_statement__ = 509;
          for (int c = 1; c <= r; ++c) {
            current_statement__ = 508;
            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__ = 510;
          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__ = 511;
          rho_mark = (rho_mark + 1);
        }
        current_statement__ = 518;
        for (int c = 1; c <= nc; ++c) {
          current_statement__ = 517;
          for (int r = c; r <= nc; ++r) {
            current_statement__ = 514;
            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__ = 515;
            theta_L_mark = (theta_L_mark + 1);
          }
        }
      }
    }
    current_statement__ = 526;
    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__ = 528;
    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__ = 530;
    b_mark = 1;
    int theta_L_mark = std::numeric_limits<int>::min();
    current_statement__ = 531;
    theta_L_mark = 1;
    current_statement__ = 561;
    for (int i = 1; i <= stan::math::size(p); ++i) {
      int nc = std::numeric_limits<int>::min();
      current_statement__ = 532;
      nc = stan::model::rvalue(p, "p", stan::model::index_uni(i));
      current_statement__ = 559;
      if (stan::math::logical_eq(nc, 1)) {
        local_scalar_t__ theta_L_start = DUMMY_VAR__;
        current_statement__ = 553;
        theta_L_start = stan::model::rvalue(theta_L, "theta_L",
                          stan::model::index_uni(theta_L_mark));
        current_statement__ = 555;
        for (int s = b_mark; s <= ((b_mark +
             stan::model::rvalue(l, "l", stan::model::index_uni(i))) -
             1); ++s) {
          current_statement__ = 554;
          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__ = 556;
        b_mark = (b_mark +
          stan::model::rvalue(l, "l", stan::model::index_uni(i)));
        current_statement__ = 557;
        theta_L_mark = (theta_L_mark + 1);
      } else {
        current_statement__ = 533;
        stan::math::validate_non_negative_index("T_i", "nc", nc);
        current_statement__ = 534;
        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__ = 535;
        stan::model::assign(T_i, stan::math::rep_matrix(0, nc, nc),
          "assigning variable T_i");
        current_statement__ = 543;
        for (int c = 1; c <= nc; ++c) {
          current_statement__ = 536;
          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__ = 537;
          theta_L_mark = (theta_L_mark + 1);
          current_statement__ = 541;
          for (int r = (c + 1); r <= nc; ++r) {
            current_statement__ = 538;
            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__ = 539;
            theta_L_mark = (theta_L_mark + 1);
          }
        }
        current_statement__ = 551;
        for (int j = 1; j <=
             stan::model::rvalue(l, "l", stan::model::index_uni(i)); ++j) {
          current_statement__ = 544;
          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__ = 545;
          stan::model::assign(temp,
            stan::math::multiply(T_i, stan::math::segment(z_b, b_mark, nc)),
            "assigning variable temp");
          current_statement__ = 546;
          b_mark = (b_mark - 1);
          current_statement__ = 548;
          for (int s = 1; s <= nc; ++s) {
            current_statement__ = 547;
            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__ = 549;
          b_mark = (b_mark + (nc + 1));
        }
      }
    }
    current_statement__ = 562;
    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__ = 564;
    lp = 0;
    int pos_reg = std::numeric_limits<int>::min();
    current_statement__ = 565;
    pos_reg = 1;
    int pos_rho = std::numeric_limits<int>::min();
    current_statement__ = 566;
    pos_rho = 1;
    current_statement__ = 567;
    lp = (lp + stan::math::normal_lpdf<false>(z_b, 0, 1));
    current_statement__ = 568;
    lp = (lp + stan::math::normal_lpdf<false>(z_T, 0, 1));
    current_statement__ = 586;
    for (int i = 1; i <= t; ++i) {
      current_statement__ = 585;
      if (stan::math::logical_gt(
            stan::model::rvalue(p, "p", stan::model::index_uni(i)), 1)) {
        current_statement__ = 569;
        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__ = 571;
        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__ = 573;
        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__ = 574;
        pos_reg = (pos_reg + 1);
        current_statement__ = 575;
        stan::model::assign(shape1, nu, "assigning variable shape1",
          stan::model::index_uni(1));
        current_statement__ = 576;
        stan::model::assign(shape2, nu, "assigning variable shape2",
          stan::model::index_uni(1));
        current_statement__ = 581;
        for (int j = 2; j <=
             (stan::model::rvalue(p, "p", stan::model::index_uni(i)) -
             1); ++j) {
          current_statement__ = 577;
          nu = (nu - 0.5);
          current_statement__ = 578;
          stan::model::assign(shape1, (0.5 * j), "assigning variable shape1",
            stan::model::index_uni(j));
          current_statement__ = 579;
          stan::model::assign(shape2, nu, "assigning variable shape2",
            stan::model::index_uni(j));
        }
        current_statement__ = 582;
        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__ = 583;
        pos_rho = (pos_rho +
          (stan::model::rvalue(p, "p", stan::model::index_uni(i)) - 1));
      }
    }
    current_statement__ = 587;
    lp = (lp + stan::math::gamma_lpdf<false>(zeta, delta, 1));
    current_statement__ = 588;
    lp = (lp + stan::math::gamma_lpdf<false>(tau, shape, 1));
    current_statement__ = 589;
    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__ = 591;
    K = stan::math::rows(z_beta);
    current_statement__ = 592;
    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__ = 593;
    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__ = 594;
    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__ = 595;
    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__ = 596;
    stan::model::assign(lambda2, stan::math::square(lambda),
      "assigning variable lambda2");
    current_statement__ = 597;
    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__ = 598;
    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__ = 599;
    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__ = 601;
    K = stan::math::rows(z_beta);
    current_statement__ = 602;
    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__ = 603;
    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__ = 604;
    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__ = 605;
    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__ = 606;
    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__ = 607;
    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__ = 608;
    stan::model::assign(lambda_eta2,
      stan::math::square(stan::math::elt_multiply(lambda, eta)),
      "assigning variable lambda_eta2");
    current_statement__ = 609;
    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__ = 610;
    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__ = 611;
    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__ = 613;
    z2 = stan::math::square(z);
    local_scalar_t__ z3 = DUMMY_VAR__;
    current_statement__ = 614;
    z3 = (z2 * z);
    local_scalar_t__ z5 = DUMMY_VAR__;
    current_statement__ = 615;
    z5 = (z2 * z3);
    local_scalar_t__ z7 = DUMMY_VAR__;
    current_statement__ = 616;
    z7 = (z2 * z5);
    local_scalar_t__ z9 = DUMMY_VAR__;
    current_statement__ = 617;
    z9 = (z2 * z7);
    local_scalar_t__ df2 = DUMMY_VAR__;
    current_statement__ = 618;
    df2 = stan::math::square(df);
    local_scalar_t__ df3 = DUMMY_VAR__;
    current_statement__ = 619;
    df3 = (df2 * df);
    local_scalar_t__ df4 = DUMMY_VAR__;
    current_statement__ = 620;
    df4 = (df2 * df2);
    current_statement__ = 621;
    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__ = 623;
    stan::math::validate_non_negative_index("V", "t", t);
    current_statement__ = 624;
    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__ = 626;
    pos = 1;
    current_statement__ = 632;
    if (stan::math::logical_gt(t, 0)) {
      current_statement__ = 631;
      for (int j = 1; j <= N; ++j) {
        current_statement__ = 630;
        for (int i = 1; i <= t; ++i) {
          current_statement__ = 627;
          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__ = 628;
          pos = (pos + 1);
        }
      }
    }
    current_statement__ = 633;
    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__ = 636;
    if (stan::math::logical_eq(family, 1)) {
      current_statement__ = 635;
      return stan::math::negative_infinity();
    }
    current_statement__ = 641;
    if (stan::math::logical_lte(family, 3)) {
      current_statement__ = 638;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 637;
        return stan::math::negative_infinity();
      }
      current_statement__ = 639;
      return 0;
    }
    current_statement__ = 642;
    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__ = 645;
    if ((stan::math::primitive_value(stan::math::logical_eq(family, 4)) &&
        stan::math::primitive_value(stan::math::logical_eq(link, 5)))) {
      current_statement__ = 644;
      return 0;
    }
    current_statement__ = 646;
    return stan::math::positive_infinity();
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_bern(const T0__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 658;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 657;
      return stan::math::inv_logit(eta);
    } else {
      current_statement__ = 656;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 655;
        return stan::math::Phi(eta);
      } else {
        current_statement__ = 654;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 653;
          return stan::math::add(
                   stan::math::divide(stan::math::atan(eta), stan::math::pi()),
                   0.5);
        } else {
          current_statement__ = 652;
          if (stan::math::logical_eq(link, 4)) {
            current_statement__ = 651;
            return stan::math::exp(eta);
          } else {
            current_statement__ = 650;
            if (stan::math::logical_eq(link, 5)) {
              current_statement__ = 649;
              return stan::math::inv_cloglog(eta);
            } else {
              current_statement__ = 648;
              std::stringstream errmsg_stream__;
              stan::math::stan_print(&errmsg_stream__, "Invalid link");
              throw std::domain_error(errmsg_stream__.str());
            }
          }
        }
      }
    }
    current_statement__ = 659;
    return eta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>>
bern_lpdf(const T0__& eta0_arg__, const T1__& eta1_arg__, const int& link,
          const std::vector<int>& N, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>>;
  int current_statement__ = 0;
  const auto& eta0 = stan::math::to_ref(eta0_arg__);
  const auto& eta1 = stan::math::to_ref(eta1_arg__);
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 661;
    lp = 0;
    current_statement__ = 682;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 679;
      lp = (lp + stan::math::logistic_lccdf(eta0, 0, 1));
      current_statement__ = 680;
      lp = (lp + stan::math::logistic_lcdf(eta1, 0, 1));
    } else {
      current_statement__ = 678;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 675;
        lp = (lp + stan::math::normal_lccdf(eta0, 0, 1));
        current_statement__ = 676;
        lp = (lp + stan::math::normal_lcdf(eta1, 0, 1));
      } else {
        current_statement__ = 674;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 671;
          lp = (lp + stan::math::cauchy_lccdf(eta0, 0, 1));
          current_statement__ = 672;
          lp = (lp + stan::math::cauchy_lcdf(eta1, 0, 1));
        } else {
          current_statement__ = 670;
          if (stan::math::logical_eq(link, 4)) {
            current_statement__ = 667;
            lp = (lp + stan::math::sum(stan::math::log1m_exp(eta0)));
            current_statement__ = 668;
            lp = (lp + stan::math::sum(eta1));
          } else {
            current_statement__ = 666;
            if (stan::math::logical_eq(link, 5)) {
              current_statement__ = 663;
              lp = (lp +
                stan::math::sum(
                  stan::math::log1m_exp(
                    stan::math::minus(stan::math::exp(eta1)))));
              current_statement__ = 664;
              lp = (lp +
                stan::math::sum(stan::math::minus(stan::math::exp(eta0))));
            } else {
              current_statement__ = 662;
              std::stringstream errmsg_stream__;
              stan::math::stan_print(&errmsg_stream__, "Invalid link");
              throw std::domain_error(errmsg_stream__.str());
            }
          }
        }
      }
    }
    current_statement__ = 683;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T1__,
          stan::require_all_t<stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T1__>>,-1,1>
pw_bern(const int& y, const T1__& eta_arg__, const int& link, std::ostream*
        pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T1__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 685;
    N = stan::math::rows(eta);
    current_statement__ = 686;
    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__ = 698;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 696;
      for (int n = 1; n <= N; ++n) {
        current_statement__ = 695;
        stan::model::assign(ll,
          stan::math::bernoulli_logit_lpmf<false>(y,
            stan::model::rvalue(eta, "eta", stan::model::index_uni(n))),
          "assigning variable ll", stan::model::index_uni(n));
      }
    } else {
      current_statement__ = 694;
      if (stan::math::logical_lte(link, 5)) {
        current_statement__ = 689;
        stan::math::validate_non_negative_index("pi", "N", N);
        Eigen::Matrix<local_scalar_t__,-1,1> pi =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
        current_statement__ = 690;
        stan::model::assign(pi, linkinv_bern(eta, link, pstream__),
          "assigning variable pi");
        current_statement__ = 692;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 691;
          stan::model::assign(ll,
            stan::math::bernoulli_lpmf<false>(y,
              stan::model::rvalue(pi, "pi", stan::model::index_uni(n))),
            "assigning variable ll", stan::model::index_uni(n));
        }
      } else {
        current_statement__ = 688;
        std::stringstream errmsg_stream__;
        stan::math::stan_print(&errmsg_stream__, "Invalid link");
        throw std::domain_error(errmsg_stream__.str());
      }
    }
    current_statement__ = 699;
    return ll;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T2__,
          stan::require_all_t<stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>*>
stan::promote_args_t<stan::base_type_t<T2__>>
log_clogit_denom(const int& N_j, const int& D_j, const T2__& eta_j_arg__,
                 std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T2__>>;
  int current_statement__ = 0;
  const auto& eta_j = stan::math::to_ref(eta_j_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 702;
    if ((stan::math::primitive_value(stan::math::logical_eq(D_j, 1)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(N_j, stan::math::rows(eta_j))))) {
      current_statement__ = 701;
      return stan::math::log_sum_exp(eta_j);
    }
    current_statement__ = 704;
    if (stan::math::logical_eq(D_j, 0)) {
      current_statement__ = 703;
      return 0;
    }
    current_statement__ = 712;
    if (stan::math::logical_eq(N_j, D_j)) {
      current_statement__ = 709;
      if (stan::math::logical_eq(D_j, 1)) {
        current_statement__ = 708;
        return stan::model::rvalue(eta_j, "eta_j",
                 stan::model::index_uni(N_j));
      }
      current_statement__ = 710;
      return stan::math::sum(stan::math::segment(eta_j, (N_j - 1), 2));
    } else {
      int N_jm1 = std::numeric_limits<int>::min();
      current_statement__ = 705;
      N_jm1 = (N_j - 1);
      current_statement__ = 706;
      return stan::math::log_sum_exp(
               log_clogit_denom(N_jm1, D_j, stan::math::eval(eta_j),
                 pstream__),
               (log_clogit_denom(N_jm1, (D_j - 1), stan::math::eval(eta_j),
                  pstream__) +
               stan::model::rvalue(eta_j, "eta_j",
                 stan::model::index_uni(N_j))));
    }
    current_statement__ = 713;
    return stan::math::not_a_number();
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T1__>>
clogit_lpdf(const T0__& eta0_arg__, const T1__& eta1_arg__,
            const std::vector<int>& successes, const std::vector<int>&
            failures, const std::vector<int>& observations, std::ostream*
            pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>>;
  int current_statement__ = 0;
  const auto& eta0 = stan::math::to_ref(eta0_arg__);
  const auto& eta1 = stan::math::to_ref(eta1_arg__);
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int J = std::numeric_limits<int>::min();
    current_statement__ = 715;
    J = stan::math::num_elements(observations);
    int pos0 = std::numeric_limits<int>::min();
    current_statement__ = 716;
    pos0 = 1;
    int pos1 = std::numeric_limits<int>::min();
    current_statement__ = 717;
    pos1 = 1;
    current_statement__ = 718;
    stan::math::validate_non_negative_index("summands", "J", J);
    Eigen::Matrix<local_scalar_t__,-1,1> summands =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(J, DUMMY_VAR__);
    current_statement__ = 729;
    for (int j = 1; j <= J; ++j) {
      int D_g = std::numeric_limits<int>::min();
      current_statement__ = 720;
      D_g = stan::model::rvalue(successes, "successes",
              stan::model::index_uni(j));
      int N_g = std::numeric_limits<int>::min();
      current_statement__ = 721;
      N_g = stan::model::rvalue(observations, "observations",
              stan::model::index_uni(j));
      int F_g = std::numeric_limits<int>::min();
      current_statement__ = 722;
      F_g = stan::model::rvalue(failures, "failures",
              stan::model::index_uni(j));
      current_statement__ = 723;
      stan::math::validate_non_negative_index("eta_g", "N_g", N_g);
      Eigen::Matrix<local_scalar_t__,-1,1> eta_g =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N_g, DUMMY_VAR__);
      current_statement__ = 724;
      stan::model::assign(eta_g,
        stan::math::append_row(stan::math::segment(eta1, pos1, D_g),
          stan::math::segment(eta0, pos0, F_g)), "assigning variable eta_g");
      current_statement__ = 725;
      stan::model::assign(summands,
        log_clogit_denom(N_g, D_g, eta_g, pstream__),
        "assigning variable summands", stan::model::index_uni(j));
      current_statement__ = 726;
      pos0 = (pos0 + F_g);
      current_statement__ = 727;
      pos1 = (pos1 + D_g);
    }
    current_statement__ = 730;
    return (stan::math::sum(eta1) - stan::math::sum(summands));
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_binom(const T0__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 742;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 741;
      return stan::math::inv_logit(eta);
    } else {
      current_statement__ = 740;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 739;
        return stan::math::Phi(eta);
      } else {
        current_statement__ = 738;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 737;
          return stan::math::add(
                   stan::math::divide(stan::math::atan(eta), stan::math::pi()),
                   0.5);
        } else {
          current_statement__ = 736;
          if (stan::math::logical_eq(link, 4)) {
            current_statement__ = 735;
            return stan::math::exp(eta);
          } else {
            current_statement__ = 734;
            if (stan::math::logical_eq(link, 5)) {
              current_statement__ = 733;
              return stan::math::inv_cloglog(eta);
            } else {
              current_statement__ = 732;
              std::stringstream errmsg_stream__;
              stan::math::stan_print(&errmsg_stream__, "Invalid link");
              throw std::domain_error(errmsg_stream__.str());
            }
          }
        }
      }
    }
    current_statement__ = 743;
    return eta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>*>
stan::promote_args_t<stan::base_type_t<T2__>>
binom_lpmf(const std::vector<int>& y, const std::vector<int>& trials,
           const T2__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T2__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 745;
    lp = 0;
    current_statement__ = 765;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 764;
      lp = (lp + stan::math::binomial_logit_lpmf<false>(y, trials, eta));
    } else {
      current_statement__ = 763;
      if (stan::math::logical_lt(link, 4)) {
        current_statement__ = 762;
        lp = (lp +
          stan::math::binomial_lpmf<false>(y, trials,
            linkinv_binom(eta, link, pstream__)));
      } else {
        current_statement__ = 761;
        if (stan::math::logical_eq(link, 4)) {
          current_statement__ = 759;
          for (int n = 1; n <= stan::math::num_elements(y); ++n) {
            current_statement__ = 755;
            lp = (lp +
              (stan::model::rvalue(y, "y", stan::model::index_uni(n)) *
              stan::model::rvalue(eta, "eta", stan::model::index_uni(n))));
            current_statement__ = 756;
            lp = (lp +
              ((stan::model::rvalue(trials, "trials",
                  stan::model::index_uni(n))
              - stan::model::rvalue(y, "y", stan::model::index_uni(n))) *
              stan::math::log1m_exp(
                stan::model::rvalue(eta, "eta", stan::model::index_uni(n)))));
            current_statement__ = 757;
            lp = (lp +
              stan::math::binomial_coefficient_log(
                stan::model::rvalue(trials, "trials",
                  stan::model::index_uni(n)),
                stan::model::rvalue(y, "y", stan::model::index_uni(n))));
          }
        } else {
          current_statement__ = 754;
          if (stan::math::logical_eq(link, 5)) {
            current_statement__ = 752;
            for (int n = 1; n <= stan::math::num_elements(y); ++n) {
              local_scalar_t__ neg_exp_eta = DUMMY_VAR__;
              current_statement__ = 747;
              neg_exp_eta = -stan::math::exp(
                               stan::model::rvalue(eta, "eta",
                                 stan::model::index_uni(n)));
              current_statement__ = 748;
              lp = (lp +
                (stan::model::rvalue(y, "y", stan::model::index_uni(n)) *
                stan::math::log1m_exp(neg_exp_eta)));
              current_statement__ = 749;
              lp = (lp +
                ((stan::model::rvalue(trials, "trials",
                    stan::model::index_uni(n))
                - stan::model::rvalue(y, "y", stan::model::index_uni(n))) *
                neg_exp_eta));
              current_statement__ = 750;
              lp = (lp +
                stan::math::binomial_coefficient_log(
                  stan::model::rvalue(trials, "trials",
                    stan::model::index_uni(n)),
                  stan::model::rvalue(y, "y", stan::model::index_uni(n))));
            }
          } else {
            current_statement__ = 746;
            std::stringstream errmsg_stream__;
            stan::math::stan_print(&errmsg_stream__, "Invalid link");
            throw std::domain_error(errmsg_stream__.str());
          }
        }
      }
    }
    current_statement__ = 766;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T2__,
          stan::require_all_t<stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T2__>>,-1,1>
pw_binom(const std::vector<int>& y, const std::vector<int>& trials,
         const T2__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T2__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 768;
    N = stan::math::rows(eta);
    current_statement__ = 769;
    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__ = 781;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 779;
      for (int n = 1; n <= N; ++n) {
        current_statement__ = 778;
        stan::model::assign(ll,
          stan::math::binomial_logit_lpmf<false>(
            stan::model::rvalue(y, "y", stan::model::index_uni(n)),
            stan::model::rvalue(trials, "trials", stan::model::index_uni(n)),
            stan::model::rvalue(eta, "eta", stan::model::index_uni(n))),
          "assigning variable ll", stan::model::index_uni(n));
      }
    } else {
      current_statement__ = 777;
      if (stan::math::logical_lte(link, 5)) {
        current_statement__ = 772;
        stan::math::validate_non_negative_index("pi", "N", N);
        Eigen::Matrix<local_scalar_t__,-1,1> pi =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
        current_statement__ = 773;
        stan::model::assign(pi, linkinv_binom(eta, link, pstream__),
          "assigning variable pi");
        current_statement__ = 775;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 774;
          stan::model::assign(ll,
            stan::math::binomial_lpmf<false>(
              stan::model::rvalue(y, "y", stan::model::index_uni(n)),
              stan::model::rvalue(trials, "trials", stan::model::index_uni(n)),
              stan::model::rvalue(pi, "pi", stan::model::index_uni(n))),
            "assigning variable ll", stan::model::index_uni(n));
        }
      } else {
        current_statement__ = 771;
        std::stringstream errmsg_stream__;
        stan::math::stan_print(&errmsg_stream__, "Invalid link");
        throw std::domain_error(errmsg_stream__.str());
      }
    }
    current_statement__ = 782;
    return ll;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_gauss(const T0__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 790;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 789;
      return eta;
    } else {
      current_statement__ = 788;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 787;
        return stan::math::exp(eta);
      } else {
        current_statement__ = 786;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 785;
          return stan::math::inv(eta);
        } else {
          current_statement__ = 784;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 791;
    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__ = 793;
    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__ = 801;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 800;
      return eta;
    } else {
      current_statement__ = 799;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 798;
        return stan::math::exp(eta);
      } else {
        current_statement__ = 797;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 796;
          return stan::math::inv(eta);
        } else {
          current_statement__ = 795;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 802;
    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__ = 804;
    ret = ((stan::math::rows(y) * ((shape * stan::math::log(shape)) -
      stan::math::lgamma(shape))) + ((shape - 1) * sum_log_y));
    current_statement__ = 811;
    if (stan::math::logical_eq(link, 2)) {
      current_statement__ = 810;
      ret = (ret - ((shape * stan::math::sum(eta)) + (shape *
        stan::math::sum(stan::math::elt_divide(y, stan::math::exp(eta))))));
    } else {
      current_statement__ = 809;
      if (stan::math::logical_eq(link, 1)) {
        current_statement__ = 808;
        ret = (ret - ((shape * stan::math::sum(stan::math::log(eta))) +
          (shape * stan::math::sum(stan::math::elt_divide(y, eta)))));
      } else {
        current_statement__ = 807;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 806;
          ret = (ret + ((shape * stan::math::sum(stan::math::log(eta))) -
            (shape * stan::math::dot_product(eta, y))));
        } else {
          current_statement__ = 805;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 812;
    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__ = 814;
    N = stan::math::rows(eta);
    current_statement__ = 815;
    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__ = 832;
    if (stan::math::logical_eq(link, 3)) {
      current_statement__ = 830;
      for (int n = 1; n <= N; ++n) {
        current_statement__ = 828;
        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__ = 827;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 825;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 823;
          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__ = 822;
        if (stan::math::logical_eq(link, 1)) {
          current_statement__ = 820;
          for (int n = 1; n <= N; ++n) {
            current_statement__ = 818;
            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__ = 817;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 833;
    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__ = 843;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 842;
      return eta;
    } else {
      current_statement__ = 841;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 840;
        return stan::math::exp(eta);
      } else {
        current_statement__ = 839;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 838;
          return stan::math::inv(eta);
        } else {
          current_statement__ = 837;
          if (stan::math::logical_eq(link, 4)) {
            current_statement__ = 836;
            return stan::math::inv_sqrt(eta);
          } else {
            current_statement__ = 835;
            std::stringstream errmsg_stream__;
            stan::math::stan_print(&errmsg_stream__, "Invalid link");
            throw std::domain_error(errmsg_stream__.str());
          }
        }
      }
    }
    current_statement__ = 844;
    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__ = 846;
    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__ = 848;
    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__ = 849;
    stan::model::assign(mu, linkinv_inv_gaussian(eta, link, pstream__),
      "assigning variable mu");
    current_statement__ = 850;
    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__ = 852;
    mu2 = stan::math::square(mu);
    local_scalar_t__ z = DUMMY_VAR__;
    current_statement__ = 853;
    z = stan::math::uniform_rng(0, 1, base_rng__);
    local_scalar_t__ y = DUMMY_VAR__;
    current_statement__ = 854;
    y = stan::math::square(stan::math::normal_rng(0, 1, base_rng__));
    local_scalar_t__ x = DUMMY_VAR__;
    current_statement__ = 855;
    x = (mu + (((mu2 * y) - (mu *
      stan::math::sqrt(((((4 * mu) * lambda) * y) + (mu2 *
        stan::math::square(y))))))
      / (2 * lambda)));
    current_statement__ = 858;
    if (stan::math::logical_lte(z, (mu / (mu + x)))) {
      current_statement__ = 857;
      return x;
    } else {
      current_statement__ = 856;
      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__ = 872;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 871;
      return stan::math::inv_logit(eta);
    } else {
      current_statement__ = 870;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 869;
        return stan::math::Phi(eta);
      } else {
        current_statement__ = 868;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 867;
          return stan::math::inv_cloglog(eta);
        } else {
          current_statement__ = 866;
          if (stan::math::logical_eq(link, 4)) {
            current_statement__ = 865;
            return stan::math::add(0.5,
                     stan::math::divide(stan::math::atan(eta),
                       stan::math::pi()));
          } else {
            current_statement__ = 864;
            if (stan::math::logical_eq(link, 5)) {
              current_statement__ = 863;
              return stan::math::exp(eta);
            } else {
              current_statement__ = 862;
              if (stan::math::logical_eq(link, 6)) {
                current_statement__ = 861;
                return stan::math::subtract(1,
                         stan::math::inv_cloglog(stan::math::minus(eta)));
              } else {
                current_statement__ = 860;
                std::stringstream errmsg_stream__;
                stan::math::stan_print(&errmsg_stream__, "invalid link");
                throw std::domain_error(errmsg_stream__.str());
              }
            }
          }
        }
      }
    }
    current_statement__ = 873;
    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__ = 881;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 880;
      return stan::math::exp(eta);
    } else {
      current_statement__ = 879;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 878;
        return eta;
      } else {
        current_statement__ = 877;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 876;
          return stan::math::square(eta);
        } else {
          current_statement__ = 875;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 882;
    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__ = 884;
    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__ = 886;
    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__ = 887;
    stan::model::assign(mu, linkinv_beta(eta, link, pstream__),
      "assigning variable mu");
    current_statement__ = 890;
    for (int n = 1; n <= stan::math::rows(y); ++n) {
      current_statement__ = 888;
      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__ = 891;
    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__ = 893;
    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__ = 895;
    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__ = 896;
    stan::model::assign(mu, linkinv_beta(eta, link, pstream__),
      "assigning variable mu");
    current_statement__ = 897;
    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__ = 898;
    stan::model::assign(mu_z, linkinv_beta_z(eta_z, link_phi, pstream__),
      "assigning variable mu_z");
    current_statement__ = 901;
    for (int n = 1; n <= stan::math::rows(y); ++n) {
      current_statement__ = 899;
      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__ = 902;
    return ll;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
linkinv_count(const T0__& eta_arg__, const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 910;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 909;
      return stan::math::exp(eta);
    } else {
      current_statement__ = 908;
      if (stan::math::logical_eq(link, 2)) {
        current_statement__ = 907;
        return eta;
      } else {
        current_statement__ = 906;
        if (stan::math::logical_eq(link, 3)) {
          current_statement__ = 905;
          return stan::math::square(eta);
        } else {
          current_statement__ = 904;
          std::stringstream errmsg_stream__;
          stan::math::stan_print(&errmsg_stream__, "Invalid link");
          throw std::domain_error(errmsg_stream__.str());
        }
      }
    }
    current_statement__ = 911;
    return eta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T1__,
          stan::require_all_t<stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T1__>>,-1,1>
pw_pois(const std::vector<int>& y, const T1__& eta_arg__, const int& link,
        std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T1__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 913;
    N = stan::math::rows(eta);
    current_statement__ = 914;
    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__ = 925;
    if (stan::math::logical_eq(link, 1)) {
      current_statement__ = 924;
      for (int n = 1; n <= N; ++n) {
        current_statement__ = 923;
        stan::model::assign(ll,
          stan::math::poisson_log_lpmf<false>(
            stan::model::rvalue(y, "y", stan::model::index_uni(n)),
            stan::model::rvalue(eta, "eta", stan::model::index_uni(n))),
          "assigning variable ll", stan::model::index_uni(n));
      }
    } else {
      current_statement__ = 922;
      if (stan::math::logical_lte(link, 3)) {
        current_statement__ = 917;
        stan::math::validate_non_negative_index("phi", "N", N);
        Eigen::Matrix<local_scalar_t__,-1,1> phi =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
        current_statement__ = 918;
        stan::model::assign(phi, linkinv_count(eta, link, pstream__),
          "assigning variable phi");
        current_statement__ = 920;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 919;
          stan::model::assign(ll,
            stan::math::poisson_lpmf<false>(
              stan::model::rvalue(y, "y", stan::model::index_uni(n)),
              stan::model::rvalue(phi, "phi", stan::model::index_uni(n))),
            "assigning variable ll", stan::model::index_uni(n));
        }
      } else {
        current_statement__ = 916;
        std::stringstream errmsg_stream__;
        stan::math::stan_print(&errmsg_stream__, "Invalid link");
        throw std::domain_error(errmsg_stream__.str());
      }
    }
    current_statement__ = 926;
    return ll;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T1__, typename T2__,
          stan::require_all_t<stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>,
                              stan::is_stan_scalar<T2__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T1__>, T2__>,-1,1>
pw_nb(const std::vector<int>& y, const T1__& eta_arg__, const T2__& theta,
      const int& link, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T1__>,
                             T2__>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 928;
    N = stan::math::rows(eta);
    current_statement__ = 929;
    stan::math::validate_non_negative_index("rho", "N", N);
    Eigen::Matrix<local_scalar_t__,-1,1> rho =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(N, DUMMY_VAR__);
    current_statement__ = 930;
    stan::model::assign(rho, linkinv_count(eta, link, pstream__),
      "assigning variable rho");
    current_statement__ = 931;
    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__ = 934;
    for (int n = 1; n <= N; ++n) {
      current_statement__ = 933;
      stan::model::assign(ll,
        stan::math::neg_binomial_2_lpmf<false>(
          stan::model::rvalue(y, "y", stan::model::index_uni(n)),
          stan::model::rvalue(rho, "rho", stan::model::index_uni(n)), theta),
        "assigning variable ll", stan::model::index_uni(n));
    }
    current_statement__ = 935;
    return ll;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
int get_nvars_for_hs(const int& prior_dist, std::ostream* pstream__) {
  using local_scalar_t__ = double;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int hs = std::numeric_limits<int>::min();
    current_statement__ = 937;
    hs = 0;
    current_statement__ = 941;
    if (stan::math::logical_eq(prior_dist, 3)) {
      current_statement__ = 940;
      hs = 2;
    } else {
      current_statement__ = 939;
      if (stan::math::logical_eq(prior_dist, 4)) {
        current_statement__ = 938;
        hs = 4;
      }
    }
    current_statement__ = 942;
    return hs;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
double lb(const int& intercept_type, std::ostream* pstream__) {
  using local_scalar_t__ = double;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 944;
    return (stan::math::logical_eq(intercept_type, 2) ? 0 : stan::math::negative_infinity(
                                                              ));
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
double ub(const int& intercept_type, std::ostream* pstream__) {
  using local_scalar_t__ = double;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 946;
    return (stan::math::logical_eq(intercept_type, 3) ? 0 : stan::math::positive_infinity(
                                                              ));
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
std::vector<int> lower_tri_indices(const int& dim, std::ostream* pstream__) {
  using local_scalar_t__ = double;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 948;
    stan::math::validate_non_negative_index("indices",
      "dim + choose(dim, 2)", (dim + stan::math::choose(dim, 2)));
    std::vector<int> indices =
      std::vector<int>((dim + stan::math::choose(dim, 2)),
        std::numeric_limits<int>::min());
    int mark = std::numeric_limits<int>::min();
    current_statement__ = 950;
    mark = 1;
    current_statement__ = 956;
    for (int r = 1; r <= dim; ++r) {
      current_statement__ = 954;
      for (int c = r; c <= dim; ++c) {
        current_statement__ = 951;
        stan::model::assign(indices, (((r - 1) * dim) + c),
          "assigning variable indices", stan::model::index_uni(mark));
        current_statement__ = 952;
        mark = (mark + 1);
      }
    }
    current_statement__ = 957;
    return indices;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T2__, typename T3__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>>*>
stan::promote_args_t<T0__, T2__, T3__>
make_aux(const T0__& aux_unscaled, const int& prior_dist, const T2__&
         prior_mean, const T3__& prior_scale, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<T0__, T2__, T3__>;
  int current_statement__ = 0;
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ aux = DUMMY_VAR__;
    current_statement__ = 965;
    if (stan::math::logical_eq(prior_dist, 0)) {
      current_statement__ = 964;
      aux = aux_unscaled;
    } else {
      current_statement__ = 960;
      aux = (prior_scale * aux_unscaled);
      current_statement__ = 962;
      if (stan::math::logical_lte(prior_dist, 2)) {
        current_statement__ = 961;
        aux = (aux + prior_mean);
      }
    }
    current_statement__ = 966;
    return aux;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T2__, typename T3__, typename T4__,
          typename T5__, typename T6__, typename T7__, typename T8__,
          typename T9__, typename T10__, typename T12__, typename T13__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_col_vector<T4__>,
                              stan::is_vt_not_complex<T4__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_stan_scalar<T7__>,
                              stan::is_stan_scalar<T8__>,
                              stan::is_stan_scalar<T9__>,
                              stan::is_stan_scalar<T10__>,
                              stan::is_stan_scalar<T12__>,
                              stan::is_stan_scalar<T13__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T2__>, stan::base_type_t<T3__>,
                stan::base_type_t<T4__>, T5__,
                stan::promote_args_t<T6__, T7__, T8__, T9__, T10__,
                  stan::promote_args_t<T12__, T13__>>>,-1,1>
make_beta(const T0__& z_beta_arg__, const int& prior_dist, const T2__&
          prior_mean_arg__, const T3__& prior_scale_arg__, const T4__&
          prior_df_arg__, const T5__& global_prior_scale,
          const std::vector<T6__>& global,
          const std::vector<Eigen::Matrix<T7__,-1,1>>& local,
          const std::vector<T8__>& ool,
          const std::vector<Eigen::Matrix<T9__,-1,1>>& mix,
          const std::vector<T10__>& aux, const int& family, const T12__&
          slab_scale, const std::vector<T13__>& caux, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T2__>,
                             stan::base_type_t<T3__>,
                             stan::base_type_t<T4__>, T5__,
                             stan::promote_args_t<T6__, T7__, T8__, T9__,
                               T10__, stan::promote_args_t<T12__, T13__>>>;
  int current_statement__ = 0;
  const auto& z_beta = stan::math::to_ref(z_beta_arg__);
  const auto& prior_mean = stan::math::to_ref(prior_mean_arg__);
  const auto& prior_scale = stan::math::to_ref(prior_scale_arg__);
  const auto& prior_df = stan::math::to_ref(prior_df_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 968;
    stan::math::validate_non_negative_index("beta", "rows(z_beta)",
      stan::math::rows(z_beta));
    Eigen::Matrix<local_scalar_t__,-1,1> beta =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(z_beta),
        DUMMY_VAR__);
    current_statement__ = 993;
    if (stan::math::logical_eq(prior_dist, 0)) {
      current_statement__ = 992;
      stan::model::assign(beta, z_beta, "assigning variable beta");
    } else {
      current_statement__ = 991;
      if (stan::math::logical_eq(prior_dist, 1)) {
        current_statement__ = 990;
        stan::model::assign(beta,
          stan::math::add(stan::math::elt_multiply(z_beta, prior_scale),
            prior_mean), "assigning variable beta");
      } else {
        current_statement__ = 989;
        if (stan::math::logical_eq(prior_dist, 2)) {
          current_statement__ = 988;
          for (int k = 1; k <= stan::math::rows(prior_mean); ++k) {
            current_statement__ = 986;
            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__ = 985;
          if (stan::math::logical_eq(prior_dist, 3)) {
            local_scalar_t__ c2 = DUMMY_VAR__;
            current_statement__ = 980;
            c2 = (stan::math::square(slab_scale) *
              stan::model::rvalue(caux, "caux", stan::model::index_uni(1)));
            current_statement__ = 983;
            if (stan::math::logical_eq(family, 1)) {
              current_statement__ = 982;
              stan::model::assign(beta,
                hs_prior(z_beta, global, local, global_prior_scale,
                  stan::model::rvalue(aux, "aux", stan::model::index_uni(1)),
                  c2, pstream__), "assigning variable beta");
            } else {
              current_statement__ = 981;
              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__ = 979;
            if (stan::math::logical_eq(prior_dist, 4)) {
              local_scalar_t__ c2 = DUMMY_VAR__;
              current_statement__ = 974;
              c2 = (stan::math::square(slab_scale) *
                stan::model::rvalue(caux, "caux", stan::model::index_uni(1)));
              current_statement__ = 977;
              if (stan::math::logical_eq(family, 1)) {
                current_statement__ = 976;
                stan::model::assign(beta,
                  hsplus_prior(z_beta, global, local, global_prior_scale,
                    stan::model::rvalue(aux, "aux", stan::model::index_uni(1)),
                    c2, pstream__), "assigning variable beta");
              } else {
                current_statement__ = 975;
                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__ = 973;
              if (stan::math::logical_eq(prior_dist, 5)) {
                current_statement__ = 972;
                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__ = 971;
                if (stan::math::logical_eq(prior_dist, 6)) {
                  current_statement__ = 970;
                  stan::model::assign(beta,
                    stan::math::add(prior_mean,
                      stan::math::elt_multiply(
                        stan::math::elt_multiply(
                          stan::math::multiply(
                            stan::model::rvalue(ool, "ool",
                              stan::model::index_uni(1)), prior_scale),
                          stan::math::sqrt(
                            stan::math::multiply(2,
                              stan::model::rvalue(mix, "mix",
                                stan::model::index_uni(1))))), z_beta)),
                    "assigning variable beta");
                }
              }
            }
          }
        }
      }
    }
    current_statement__ = 994;
    return beta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T1__>,
                              stan::is_vt_not_complex<T1__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>,
                stan::base_type_t<T1__>>,-1,-1>
make_b_matrix(const T0__& z_b_arg__, const T1__& theta_L_arg__,
              const std::vector<int>& p, const std::vector<int>& l,
              const int& i, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T1__>>;
  int current_statement__ = 0;
  const auto& z_b = stan::math::to_ref(z_b_arg__);
  const auto& theta_L = stan::math::to_ref(theta_L_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 996;
    stan::math::validate_non_negative_index("b_matrix", "p[i]",
      stan::model::rvalue(p, "p", stan::model::index_uni(i)));
    current_statement__ = 997;
    stan::math::validate_non_negative_index("b_matrix", "l[i]",
      stan::model::rvalue(l, "l", stan::model::index_uni(i)));
    Eigen::Matrix<local_scalar_t__,-1,-1> b_matrix =
      Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(stan::model::rvalue(p,
                                                        "p",
                                                        stan::model::index_uni(
                                                          i)),
        stan::model::rvalue(l, "l", stan::model::index_uni(i)), DUMMY_VAR__);
    int nc = std::numeric_limits<int>::min();
    current_statement__ = 999;
    nc = stan::model::rvalue(p, "p", stan::model::index_uni(i));
    int b_mark = std::numeric_limits<int>::min();
    current_statement__ = 1000;
    b_mark = 1;
    int theta_L_mark = std::numeric_limits<int>::min();
    current_statement__ = 1001;
    theta_L_mark = 1;
    current_statement__ = 1007;
    if (stan::math::logical_gt(i, 1)) {
      current_statement__ = 1005;
      for (int j = 1; j <= (i - 1); ++j) {
        current_statement__ = 1002;
        theta_L_mark = (theta_L_mark +
          (stan::model::rvalue(p, "p", stan::model::index_uni(j)) +
          stan::math::choose(
            stan::model::rvalue(p, "p", stan::model::index_uni(j)), 2)));
        current_statement__ = 1003;
        b_mark = (b_mark +
          (stan::model::rvalue(p, "p", stan::model::index_uni(j)) *
          stan::model::rvalue(l, "l", stan::model::index_uni(j))));
      }
    }
    current_statement__ = 1030;
    if (stan::math::logical_eq(nc, 1)) {
      local_scalar_t__ theta_L_start = DUMMY_VAR__;
      current_statement__ = 1026;
      theta_L_start = stan::model::rvalue(theta_L, "theta_L",
                        stan::model::index_uni(theta_L_mark));
      current_statement__ = 1028;
      for (int s = b_mark; s <= ((b_mark +
           stan::model::rvalue(l, "l", stan::model::index_uni(i))) - 1); ++s) {
        current_statement__ = 1027;
        stan::model::assign(b_matrix, (theta_L_start *
          stan::model::rvalue(z_b, "z_b", stan::model::index_uni(s))),
          "assigning variable b_matrix", stan::model::index_uni(nc),
          stan::model::index_uni(s));
      }
    } else {
      current_statement__ = 1008;
      stan::math::validate_non_negative_index("T_i", "nc", nc);
      current_statement__ = 1009;
      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__ = 1010;
      stan::model::assign(T_i, stan::math::rep_matrix(0, nc, nc),
        "assigning variable T_i");
      current_statement__ = 1018;
      for (int c = 1; c <= nc; ++c) {
        current_statement__ = 1011;
        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__ = 1012;
        theta_L_mark = (theta_L_mark + 1);
        current_statement__ = 1016;
        for (int r = (c + 1); r <= nc; ++r) {
          current_statement__ = 1013;
          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__ = 1014;
          theta_L_mark = (theta_L_mark + 1);
        }
      }
      current_statement__ = 1024;
      for (int j = 1; j <=
           stan::model::rvalue(l, "l", stan::model::index_uni(i)); ++j) {
        current_statement__ = 1019;
        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__ = 1020;
        stan::model::assign(temp,
          stan::math::multiply(T_i, stan::math::segment(z_b, b_mark, nc)),
          "assigning variable temp");
        current_statement__ = 1021;
        stan::model::assign(b_matrix, temp, "assigning variable b_matrix",
          stan::model::index_omni(), stan::model::index_uni(j));
        current_statement__ = 1022;
        b_mark = (b_mark + nc);
      }
    }
    current_statement__ = 1031;
    return stan::math::transpose(b_matrix);
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename T2__, typename T5__,
          typename T6__, typename T7__, typename T8__, typename T12__,
          stan::require_all_t<stan::is_eigen_matrix_dynamic<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_col_vector<T6__>,
                              stan::is_vt_not_complex<T6__>,
                              stan::is_eigen_matrix_dynamic<T7__>,
                              stan::is_vt_not_complex<T7__>,
                              stan::is_eigen_matrix_dynamic<T8__>,
                              stan::is_vt_not_complex<T8__>,
                              stan::is_col_vector<T12__>,
                              stan::is_vt_not_complex<T12__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>, T1__, T2__, T5__,
                stan::base_type_t<T6__>,
                stan::promote_args_t<stan::base_type_t<T7__>,
                  stan::base_type_t<T8__>, stan::base_type_t<T12__>>>,-1,1>
evaluate_eta(const T0__& X_arg__,
             const std::vector<Eigen::Matrix<T1__,-1,1>>& Z1,
             const std::vector<Eigen::Matrix<T2__,-1,1>>& Z2,
             const std::vector<int>& Z1_id, const std::vector<int>& Z2_id,
             const std::vector<T5__>& gamma, const T6__& beta_arg__,
             const T7__& b1Mat_arg__, const T8__& b2Mat_arg__, const int&
             b1Mat_colshift, const int& b2Mat_colshift, const int&
             intercept_type, const T12__& Ti_arg__, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             T1__, T2__, T5__, stan::base_type_t<T6__>,
                             stan::promote_args_t<stan::base_type_t<T7__>,
                               stan::base_type_t<T8__>,
                               stan::base_type_t<T12__>>>;
  int current_statement__ = 0;
  const auto& X = stan::math::to_ref(X_arg__);
  const auto& beta = stan::math::to_ref(beta_arg__);
  const auto& b1Mat = stan::math::to_ref(b1Mat_arg__);
  const auto& b2Mat = stan::math::to_ref(b2Mat_arg__);
  const auto& Ti = stan::math::to_ref(Ti_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 1033;
    N = stan::math::rows(X);
    int K = std::numeric_limits<int>::min();
    current_statement__ = 1034;
    K = stan::math::rows(beta);
    int p1 = std::numeric_limits<int>::min();
    current_statement__ = 1035;
    p1 = stan::math::size(Z1);
    int p2 = std::numeric_limits<int>::min();
    current_statement__ = 1036;
    p2 = stan::math::size(Z2);
    current_statement__ = 1037;
    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__ = 1041;
    if (stan::math::logical_gt(K, 0)) {
      current_statement__ = 1040;
      stan::model::assign(eta, stan::math::multiply(X, beta),
        "assigning variable eta");
    } else {
      current_statement__ = 1039;
      stan::model::assign(eta, stan::math::rep_vector(0.0, N),
        "assigning variable eta");
    }
    current_statement__ = 1049;
    if (stan::math::logical_gt(intercept_type, 0)) {
      current_statement__ = 1047;
      if (stan::math::logical_eq(intercept_type, 1)) {
        current_statement__ = 1046;
        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__ = 1045;
        if (stan::math::logical_eq(intercept_type, 2)) {
          current_statement__ = 1044;
          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__ = 1043;
          if (stan::math::logical_eq(intercept_type, 3)) {
            current_statement__ = 1042;
            stan::model::assign(eta,
              stan::math::add(stan::model::deep_copy(eta),
                (stan::model::rvalue(gamma, "gamma",
                   stan::model::index_uni(1)) - stan::math::min(eta))),
              "assigning variable eta");
          }
        }
      }
    }
    current_statement__ = 1054;
    if (stan::math::logical_gt(p1, 0)) {
      current_statement__ = 1052;
      for (int k = 1; k <= p1; ++k) {
        current_statement__ = 1051;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 1050;
          stan::model::assign(eta,
            (stan::model::rvalue(eta, "eta", stan::model::index_uni(n)) +
            (stan::model::rvalue(b1Mat, "b1Mat",
               stan::model::index_uni(
                 stan::model::rvalue(Z1_id, "Z1_id",
                   stan::model::index_uni(n))),
               stan::model::index_uni((k + b1Mat_colshift))) *
            stan::model::rvalue(Z1, "Z1", stan::model::index_uni(k),
              stan::model::index_uni(n)))), "assigning variable eta",
            stan::model::index_uni(n));
        }
      }
    }
    current_statement__ = 1059;
    if (stan::math::logical_gt(p2, 0)) {
      current_statement__ = 1057;
      for (int k = 1; k <= p2; ++k) {
        current_statement__ = 1056;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 1055;
          stan::model::assign(eta,
            (stan::model::rvalue(eta, "eta", stan::model::index_uni(n)) +
            (stan::model::rvalue(b2Mat, "b2Mat",
               stan::model::index_uni(
                 stan::model::rvalue(Z2_id, "Z2_id",
                   stan::model::index_uni(n))),
               stan::model::index_uni((k + b2Mat_colshift))) *
            stan::model::rvalue(Z2, "Z2", stan::model::index_uni(k),
              stan::model::index_uni(n)))), "assigning variable eta",
            stan::model::index_uni(n));
        }
      }
    }
    current_statement__ = 1061;
    if (stan::math::logical_gt(stan::math::rows(Ti), 0)) {
      current_statement__ = 1060;
      stan::model::assign(eta,
        stan::math::add(stan::model::deep_copy(eta), Ti),
        "assigning variable eta");
    }
    current_statement__ = 1062;
    return eta;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>>*>
Eigen::Matrix<stan::promote_args_t<stan::base_type_t<T0__>>,-1,1>
evaluate_mu(const T0__& eta_arg__, const int& family, const int& link,
            std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>>;
  int current_statement__ = 0;
  const auto& eta = stan::math::to_ref(eta_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    current_statement__ = 1064;
    stan::math::validate_non_negative_index("mu", "rows(eta)",
      stan::math::rows(eta));
    Eigen::Matrix<local_scalar_t__,-1,1> mu =
      Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::math::rows(eta),
        DUMMY_VAR__);
    current_statement__ = 1077;
    if (stan::math::logical_eq(family, 1)) {
      current_statement__ = 1076;
      stan::model::assign(mu, linkinv_gauss(eta, link, pstream__),
        "assigning variable mu");
    } else {
      current_statement__ = 1075;
      if (stan::math::logical_eq(family, 2)) {
        current_statement__ = 1074;
        stan::model::assign(mu, linkinv_gamma(eta, link, pstream__),
          "assigning variable mu");
      } else {
        current_statement__ = 1073;
        if (stan::math::logical_eq(family, 3)) {
          current_statement__ = 1072;
          stan::model::assign(mu, linkinv_inv_gaussian(eta, link, pstream__),
            "assigning variable mu");
        } else {
          current_statement__ = 1071;
          if (stan::math::logical_eq(family, 4)) {
            current_statement__ = 1070;
            stan::model::assign(mu, linkinv_bern(eta, link, pstream__),
              "assigning variable mu");
          } else {
            current_statement__ = 1069;
            if (stan::math::logical_eq(family, 5)) {
              current_statement__ = 1068;
              stan::model::assign(mu, linkinv_binom(eta, link, pstream__),
                "assigning variable mu");
            } else {
              current_statement__ = 1067;
              if ((stan::math::primitive_value(
                     (stan::math::primitive_value(
                        stan::math::logical_eq(family, 6)) ||
                     stan::math::primitive_value(
                       stan::math::logical_eq(family, 7))))
                  ||
                  stan::math::primitive_value(
                    stan::math::logical_eq(family, 8)))) {
                current_statement__ = 1066;
                stan::model::assign(mu, linkinv_count(eta, link, pstream__),
                  "assigning variable mu");
              }
            }
          }
        }
      }
    }
    current_statement__ = 1078;
    return mu;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T2__, typename T3__,
          typename T6__, typename T7__, typename T8__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_col_vector<T7__>,
                              stan::is_vt_not_complex<T7__>,
                              stan::is_col_vector<T8__>,
                              stan::is_vt_not_complex<T8__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T2__>, T3__,
  T6__, stan::base_type_t<T7__>,
  stan::promote_args_t<stan::base_type_t<T8__>>>
glm_lpdf(const T0__& y_real_arg__, const std::vector<int>& y_integer,
         const T2__& eta_arg__, const std::vector<T3__>& aux, const int&
         family, const int& link, const T6__& sum_log_y, const T7__&
         sqrt_y_arg__, const T8__& log_y_arg__, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T2__>, T3__, T6__,
                             stan::base_type_t<T7__>,
                             stan::promote_args_t<stan::base_type_t<T8__>>>;
  int current_statement__ = 0;
  const auto& y_real = stan::math::to_ref(y_real_arg__);
  const auto& eta = stan::math::to_ref(eta_arg__);
  const auto& sqrt_y = stan::math::to_ref(sqrt_y_arg__);
  const auto& log_y = stan::math::to_ref(log_y_arg__);
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 1080;
    lp = 0;
    current_statement__ = 1112;
    if (stan::math::logical_eq(family, 1)) {
      current_statement__ = 1110;
      if (stan::math::logical_eq(link, 1)) {
        current_statement__ = 1109;
        lp = (lp +
          stan::math::normal_lpdf<false>(y_real, eta,
            stan::model::rvalue(aux, "aux", stan::model::index_uni(1))));
      } else {
        current_statement__ = 1108;
        if (stan::math::logical_eq(link, 2)) {
          current_statement__ = 1107;
          lp = (lp +
            stan::math::lognormal_lpdf<false>(y_real, eta,
              stan::model::rvalue(aux, "aux", stan::model::index_uni(1))));
        } else {
          current_statement__ = 1106;
          lp = (lp +
            stan::math::normal_lpdf<false>(y_real, stan::math::inv(eta),
              stan::model::rvalue(aux, "aux", stan::model::index_uni(1))));
        }
      }
    } else {
      current_statement__ = 1105;
      if (stan::math::logical_eq(family, 2)) {
        current_statement__ = 1103;
        lp = (lp +
          GammaReg(y_real, eta,
            stan::model::rvalue(aux, "aux", stan::model::index_uni(1)), link,
            sum_log_y, pstream__));
      } else {
        current_statement__ = 1102;
        if (stan::math::logical_eq(family, 3)) {
          current_statement__ = 1100;
          lp = (lp +
            inv_gaussian(y_real, linkinv_inv_gaussian(eta, link, pstream__),
              stan::model::rvalue(aux, "aux", stan::model::index_uni(1)),
              sum_log_y, sqrt_y, pstream__));
        } else {
          current_statement__ = 1099;
          if (stan::math::logical_eq(family, 4)) {
            current_statement__ = 1097;
            if (stan::math::logical_eq(link, 1)) {
              current_statement__ = 1096;
              lp = (lp +
                stan::math::bernoulli_logit_lpmf<false>(y_integer, eta));
            } else {
              current_statement__ = 1095;
              lp = (lp +
                stan::math::bernoulli_lpmf<false>(y_integer,
                  linkinv_bern(eta, link, pstream__)));
            }
          } else {
            current_statement__ = 1094;
            if (stan::math::logical_eq(family, 5)) {
              current_statement__ = 1092;
              std::stringstream errmsg_stream__;
              stan::math::stan_print(&errmsg_stream__,
                "Binomial with >1 trials not allowed.");
              throw std::domain_error(errmsg_stream__.str());
            } else {
              current_statement__ = 1091;
              if ((stan::math::primitive_value(
                     stan::math::logical_eq(family, 6))
                  ||
                  stan::math::primitive_value(
                    stan::math::logical_eq(family, 8)))) {
                current_statement__ = 1089;
                if (stan::math::logical_eq(link, 1)) {
                  current_statement__ = 1088;
                  lp = (lp +
                    stan::math::poisson_log_lpmf<false>(y_integer, eta));
                } else {
                  current_statement__ = 1087;
                  lp = (lp +
                    stan::math::poisson_lpmf<false>(y_integer,
                      linkinv_count(eta, link, pstream__)));
                }
              } else {
                current_statement__ = 1086;
                if (stan::math::logical_eq(family, 7)) {
                  current_statement__ = 1084;
                  if (stan::math::logical_eq(link, 1)) {
                    current_statement__ = 1083;
                    lp = (lp +
                      stan::math::neg_binomial_2_log_lpmf<false>(y_integer,
                        eta,
                        stan::model::rvalue(aux, "aux",
                          stan::model::index_uni(1))));
                  } else {
                    current_statement__ = 1082;
                    lp = (lp +
                      stan::math::neg_binomial_2_lpmf<false>(y_integer,
                        linkinv_count(eta, link, pstream__),
                        stan::model::rvalue(aux, "aux",
                          stan::model::index_uni(1))));
                  }
                } else {
                  current_statement__ = 1081;
                  std::stringstream errmsg_stream__;
                  stan::math::stan_print(&errmsg_stream__, "Invalid family.");
                  throw std::domain_error(errmsg_stream__.str());
                }
              }
            }
          }
        }
      }
    }
    current_statement__ = 1113;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T2__, typename T3__,
          typename T4__, typename T5__, typename T6__, typename T7__,
          typename T8__, typename T9__, typename T10__,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_col_vector<T2__>,
                              stan::is_vt_not_complex<T2__>,
                              stan::is_col_vector<T3__>,
                              stan::is_vt_not_complex<T3__>,
                              stan::is_stan_scalar<T4__>,
                              stan::is_stan_scalar<T5__>,
                              stan::is_stan_scalar<T6__>,
                              stan::is_stan_scalar<T7__>,
                              stan::is_stan_scalar<T8__>,
                              stan::is_stan_scalar<T9__>,
                              stan::is_stan_scalar<T10__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, stan::base_type_t<T2__>,
  stan::base_type_t<T3__>, T4__, T5__,
  stan::promote_args_t<T6__, T7__, T8__, T9__, T10__>>
beta_custom_lpdf(const T0__& z_beta_arg__, const int& prior_dist, const T2__&
                 prior_scale_arg__, const T3__& prior_df_arg__, const T4__&
                 global_prior_df,
                 const std::vector<Eigen::Matrix<T5__,-1,1>>& local,
                 const std::vector<T6__>& global,
                 const std::vector<Eigen::Matrix<T7__,-1,1>>& mix,
                 const std::vector<T8__>& one_over_lambda, const T9__&
                 slab_df, const std::vector<T10__>& caux, std::ostream*
                 pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             stan::base_type_t<T2__>,
                             stan::base_type_t<T3__>, T4__, T5__,
                             stan::promote_args_t<T6__, T7__, T8__, T9__,
                               T10__>>;
  int current_statement__ = 0;
  const auto& z_beta = stan::math::to_ref(z_beta_arg__);
  const auto& prior_scale = stan::math::to_ref(prior_scale_arg__);
  const auto& prior_df = stan::math::to_ref(prior_df_arg__);
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 1115;
    lp = 0;
    current_statement__ = 1149;
    if (stan::math::logical_eq(prior_dist, 1)) {
      current_statement__ = 1148;
      lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
    } else {
      current_statement__ = 1147;
      if (stan::math::logical_eq(prior_dist, 2)) {
        current_statement__ = 1146;
        lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
      } else {
        current_statement__ = 1145;
        if (stan::math::logical_eq(prior_dist, 3)) {
          current_statement__ = 1138;
          lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
          current_statement__ = 1139;
          lp = (lp +
            stan::math::normal_lpdf<false>(
              stan::model::rvalue(local, "local", stan::model::index_uni(1)),
              0, 1));
          current_statement__ = 1140;
          lp = (lp +
            stan::math::inv_gamma_lpdf<false>(
              stan::model::rvalue(local, "local", stan::model::index_uni(2)),
              stan::math::multiply(0.5, prior_df),
              stan::math::multiply(0.5, prior_df)));
          current_statement__ = 1141;
          lp = (lp +
            stan::math::normal_lpdf<false>(
              stan::model::rvalue(global, "global", stan::model::index_uni(1)),
              0, 1));
          current_statement__ = 1142;
          lp = (lp +
            stan::math::inv_gamma_lpdf<false>(
              stan::model::rvalue(global, "global", stan::model::index_uni(2)),
              (0.5 * global_prior_df), (0.5 * global_prior_df)));
          current_statement__ = 1143;
          lp = (lp +
            stan::math::inv_gamma_lpdf<false>(caux, (0.5 * slab_df), (0.5 *
              slab_df)));
        } else {
          current_statement__ = 1137;
          if (stan::math::logical_eq(prior_dist, 4)) {
            current_statement__ = 1128;
            lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
            current_statement__ = 1129;
            lp = (lp +
              stan::math::normal_lpdf<false>(
                stan::model::rvalue(local, "local", stan::model::index_uni(1)),
                0, 1));
            current_statement__ = 1130;
            lp = (lp +
              stan::math::inv_gamma_lpdf<false>(
                stan::model::rvalue(local, "local", stan::model::index_uni(2)),
                stan::math::multiply(0.5, prior_df),
                stan::math::multiply(0.5, prior_df)));
            current_statement__ = 1131;
            lp = (lp +
              stan::math::normal_lpdf<false>(
                stan::model::rvalue(local, "local", stan::model::index_uni(3)),
                0, 1));
            current_statement__ = 1132;
            lp = (lp +
              stan::math::inv_gamma_lpdf<false>(
                stan::model::rvalue(local, "local", stan::model::index_uni(4)),
                stan::math::multiply(0.5, prior_scale),
                stan::math::multiply(0.5, prior_scale)));
            current_statement__ = 1133;
            lp = (lp +
              stan::math::normal_lpdf<false>(
                stan::model::rvalue(global, "global",
                  stan::model::index_uni(1)), 0, 1));
            current_statement__ = 1134;
            lp = (lp +
              stan::math::inv_gamma_lpdf<false>(
                stan::model::rvalue(global, "global",
                  stan::model::index_uni(2)), (0.5 * global_prior_df), (0.5 *
                global_prior_df)));
            current_statement__ = 1135;
            lp = (lp +
              stan::math::inv_gamma_lpdf<false>(caux, (0.5 * slab_df), (0.5 *
                slab_df)));
          } else {
            current_statement__ = 1127;
            if (stan::math::logical_eq(prior_dist, 5)) {
              current_statement__ = 1124;
              lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
              current_statement__ = 1125;
              lp = (lp +
                stan::math::exponential_lpdf<false>(
                  stan::model::rvalue(mix, "mix", stan::model::index_uni(1)),
                  1));
            } else {
              current_statement__ = 1123;
              if (stan::math::logical_eq(prior_dist, 6)) {
                current_statement__ = 1119;
                lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
                current_statement__ = 1120;
                lp = (lp +
                  stan::math::exponential_lpdf<false>(
                    stan::model::rvalue(mix, "mix", stan::model::index_uni(1)),
                    1));
                current_statement__ = 1121;
                lp = (lp +
                  stan::math::chi_square_lpdf<false>(
                    stan::model::rvalue(one_over_lambda, "one_over_lambda",
                      stan::model::index_uni(1)),
                    stan::model::rvalue(prior_df, "prior_df",
                      stan::model::index_uni(1))));
              } else {
                current_statement__ = 1118;
                if (stan::math::logical_eq(prior_dist, 7)) {
                  current_statement__ = 1116;
                  lp = (lp + stan::math::normal_lpdf<false>(z_beta, 0, 1));
                }
              }
            }
          }
        }
      }
    }
    current_statement__ = 1150;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T2__, typename T3__,
          typename T4__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>,
                              stan::is_stan_scalar<T4__>>*>
stan::promote_args_t<T0__, T2__, T3__, T4__>
gamma_custom_lpdf(const T0__& gamma, const int& dist, const T2__& mean_,
                  const T3__& scale, const T4__& df, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<T0__, T2__, T3__, T4__>;
  int current_statement__ = 0;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 1152;
    lp = 0;
    current_statement__ = 1156;
    if (stan::math::logical_eq(dist, 1)) {
      current_statement__ = 1155;
      lp = (lp + stan::math::normal_lpdf<false>(gamma, mean_, scale));
    } else {
      current_statement__ = 1154;
      if (stan::math::logical_eq(dist, 2)) {
        current_statement__ = 1153;
        lp = (lp +
          stan::math::student_t_lpdf<false>(gamma, df, mean_, scale));
      }
    }
    current_statement__ = 1157;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <bool propto__, typename T0__, typename T2__, typename T3__,
          stan::require_all_t<stan::is_stan_scalar<T0__>,
                              stan::is_stan_scalar<T2__>,
                              stan::is_stan_scalar<T3__>>*>
stan::promote_args_t<T0__, T2__, T3__>
aux_lpdf(const T0__& aux_unscaled, const int& dist, const T2__& scale,
         const T3__& df, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<T0__, T2__, T3__>;
  int current_statement__ = 0;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    local_scalar_t__ lp = DUMMY_VAR__;
    current_statement__ = 1159;
    lp = 0;
    current_statement__ = 1166;
    if ((stan::math::primitive_value(stan::math::logical_gt(dist, 0)) &&
        stan::math::primitive_value(stan::math::logical_gt(scale, 0)))) {
      current_statement__ = 1164;
      if (stan::math::logical_eq(dist, 1)) {
        current_statement__ = 1163;
        lp = (lp + stan::math::normal_lpdf<false>(aux_unscaled, 0, 1));
      } else {
        current_statement__ = 1162;
        if (stan::math::logical_eq(dist, 2)) {
          current_statement__ = 1161;
          lp = (lp +
            stan::math::student_t_lpdf<false>(aux_unscaled, df, 0, 1));
        } else {
          current_statement__ = 1160;
          lp = (lp + stan::math::exponential_lpdf<false>(aux_unscaled, 1));
        }
      }
    }
    current_statement__ = 1167;
    return lp;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
template <typename T0__, typename T1__, typename RNG,
          stan::require_all_t<stan::is_col_vector<T0__>,
                              stan::is_vt_not_complex<T0__>,
                              stan::is_stan_scalar<T1__>>*>
stan::promote_args_t<stan::base_type_t<T0__>, T1__>
mean_PPD_rng(const T0__& mu_arg__, const std::vector<T1__>& aux, const int&
             family, RNG& base_rng__, std::ostream* pstream__) {
  using local_scalar_t__ = stan::promote_args_t<stan::base_type_t<T0__>,
                             T1__>;
  int current_statement__ = 0;
  const auto& mu = stan::math::to_ref(mu_arg__);
  static constexpr bool propto__ = true;
  // suppress unused var warning
  (void) propto__;
  local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
  // suppress unused var warning
  (void) DUMMY_VAR__;
  try {
    int N = std::numeric_limits<int>::min();
    current_statement__ = 1169;
    N = stan::math::rows(mu);
    local_scalar_t__ mean_PPD = DUMMY_VAR__;
    current_statement__ = 1170;
    mean_PPD = 0;
    current_statement__ = 1209;
    if (stan::math::logical_eq(family, 1)) {
      current_statement__ = 1207;
      for (int n = 1; n <= N; ++n) {
        current_statement__ = 1206;
        mean_PPD = (mean_PPD +
          stan::math::normal_rng(
            stan::model::rvalue(mu, "mu", stan::model::index_uni(n)),
            stan::model::rvalue(aux, "aux", stan::model::index_uni(1)),
            base_rng__));
      }
    } else {
      current_statement__ = 1205;
      if (stan::math::logical_eq(family, 2)) {
        current_statement__ = 1203;
        for (int n = 1; n <= N; ++n) {
          current_statement__ = 1202;
          mean_PPD = (mean_PPD +
            stan::math::gamma_rng(
              stan::model::rvalue(aux, "aux", stan::model::index_uni(1)),
              (stan::model::rvalue(aux, "aux", stan::model::index_uni(1)) /
              stan::model::rvalue(mu, "mu", stan::model::index_uni(n))),
              base_rng__));
        }
      } else {
        current_statement__ = 1201;
        if (stan::math::logical_eq(family, 3)) {
          current_statement__ = 1199;
          for (int n = 1; n <= N; ++n) {
            current_statement__ = 1198;
            mean_PPD = (mean_PPD +
              inv_gaussian_rng(
                stan::model::rvalue(mu, "mu", stan::model::index_uni(n)),
                stan::model::rvalue(aux, "aux", stan::model::index_uni(1)),
                base_rng__, pstream__));
          }
        } else {
          current_statement__ = 1197;
          if (stan::math::logical_eq(family, 4)) {
            current_statement__ = 1195;
            for (int n = 1; n <= N; ++n) {
              current_statement__ = 1194;
              mean_PPD = (mean_PPD +
                stan::math::bernoulli_rng(
                  stan::model::rvalue(mu, "mu", stan::model::index_uni(n)),
                  base_rng__));
            }
          } else {
            current_statement__ = 1193;
            if (stan::math::logical_eq(family, 5)) {
              current_statement__ = 1191;
              std::stringstream errmsg_stream__;
              stan::math::stan_print(&errmsg_stream__,
                "Binomial with >1 trials not allowed.");
              throw std::domain_error(errmsg_stream__.str());
            } else {
              current_statement__ = 1190;
              if ((stan::math::primitive_value(
                     stan::math::logical_eq(family, 6))
                  ||
                  stan::math::primitive_value(
                    stan::math::logical_eq(family, 8)))) {
                local_scalar_t__ poisson_max = DUMMY_VAR__;
                current_statement__ = 1183;
                poisson_max = stan::math::pow(2.0, 30.0);
                current_statement__ = 1188;
                for (int n = 1; n <= N; ++n) {
                  current_statement__ = 1186;
                  if (stan::math::logical_lt(
                        stan::model::rvalue(mu, "mu",
                          stan::model::index_uni(n)), poisson_max)) {
                    current_statement__ = 1185;
                    mean_PPD = (mean_PPD +
                      stan::math::poisson_rng(
                        stan::model::rvalue(mu, "mu",
                          stan::model::index_uni(n)), base_rng__));
                  } else {
                    current_statement__ = 1184;
                    mean_PPD = (mean_PPD +
                      stan::math::normal_rng(
                        stan::model::rvalue(mu, "mu",
                          stan::model::index_uni(n)),
                        stan::math::sqrt(
                          stan::model::rvalue(mu, "mu",
                            stan::model::index_uni(n))), base_rng__));
                  }
                }
              } else {
                current_statement__ = 1182;
                if (stan::math::logical_eq(family, 7)) {
                  local_scalar_t__ poisson_max = DUMMY_VAR__;
                  current_statement__ = 1171;
                  poisson_max = stan::math::pow(2.0, 30.0);
                  current_statement__ = 1180;
                  for (int n = 1; n <= N; ++n) {
                    local_scalar_t__ gamma_temp = DUMMY_VAR__;
                    current_statement__ = 1175;
                    if (stan::math::is_inf(
                          stan::model::rvalue(aux, "aux",
                            stan::model::index_uni(1)))) {
                      current_statement__ = 1174;
                      gamma_temp = stan::model::rvalue(mu, "mu",
                                     stan::model::index_uni(n));
                    } else {
                      current_statement__ = 1173;
                      gamma_temp = stan::math::gamma_rng(
                                     stan::model::rvalue(aux, "aux",
                                       stan::model::index_uni(1)),
                                     (stan::model::rvalue(aux, "aux",
                                        stan::model::index_uni(1)) /
                                     stan::model::rvalue(mu, "mu",
                                       stan::model::index_uni(n))),
                                     base_rng__);
                    }
                    current_statement__ = 1178;
                    if (stan::math::logical_lt(gamma_temp, poisson_max)) {
                      current_statement__ = 1177;
                      mean_PPD = (mean_PPD +
                        stan::math::poisson_rng(gamma_temp, base_rng__));
                    } else {
                      current_statement__ = 1176;
                      mean_PPD = (mean_PPD +
                        stan::math::normal_rng(gamma_temp,
                          stan::math::sqrt(gamma_temp), base_rng__));
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    current_statement__ = 1210;
    mean_PPD = (mean_PPD / N);
    current_statement__ = 1211;
    return mean_PPD;
  } catch (const std::exception& e) {
    stan::lang::rethrow_located(e, locations_array__[current_statement__]);
  }
}
#include <stan_meta_header.hpp>
class model_mvmer final : public model_base_crtp<model_mvmer> {
private:
  int M;
  std::vector<int> has_aux;
  int has_weights;
  std::vector<int> resp_type;
  std::vector<int> intercept_type;
  std::vector<int> yNobs;
  std::vector<int> yNeta;
  std::vector<int> yK;
  int t;
  std::vector<int> p;
  std::vector<int> l;
  int q;
  int len_theta_L;
  int bN1;
  int bK1;
  std::vector<int> bK1_len;
  std::vector<std::vector<int>> bK1_idx;
  int bN2;
  int bK2;
  std::vector<int> bK2_len;
  std::vector<std::vector<int>> bK2_idx;
  std::vector<int> yInt1;
  std::vector<int> yInt2;
  std::vector<int> yInt3;
  Eigen::Matrix<double,-1,1> yReal1_data__;
  Eigen::Matrix<double,-1,1> yReal2_data__;
  Eigen::Matrix<double,-1,1> yReal3_data__;
  Eigen::Matrix<double,-1,-1> yX1_data__;
  Eigen::Matrix<double,-1,-1> yX2_data__;
  Eigen::Matrix<double,-1,-1> yX3_data__;
  Eigen::Matrix<double,-1,1> yXbar1_data__;
  Eigen::Matrix<double,-1,1> yXbar2_data__;
  Eigen::Matrix<double,-1,1> yXbar3_data__;
  std::vector<int> family;
  std::vector<int> link;
  std::vector<Eigen::Matrix<double,-1,1>> y1_Z1;
  std::vector<Eigen::Matrix<double,-1,1>> y2_Z1;
  std::vector<Eigen::Matrix<double,-1,1>> y3_Z1;
  std::vector<int> y1_Z1_id;
  std::vector<int> y2_Z1_id;
  std::vector<int> y3_Z1_id;
  std::vector<Eigen::Matrix<double,-1,1>> y1_Z2;
  std::vector<Eigen::Matrix<double,-1,1>> y2_Z2;
  std::vector<Eigen::Matrix<double,-1,1>> y3_Z2;
  std::vector<int> y1_Z2_id;
  std::vector<int> y2_Z2_id;
  std::vector<int> y3_Z2_id;
  std::vector<int> y_prior_dist;
  std::vector<int> y_prior_dist_for_intercept;
  std::vector<int> y_prior_dist_for_aux;
  int prior_dist_for_cov;
  int prior_PD;
  std::vector<int> has_offset;
  Eigen::Matrix<double,-1,1> y1_offset_data__;
  Eigen::Matrix<double,-1,1> y2_offset_data__;
  Eigen::Matrix<double,-1,1> y3_offset_data__;
  Eigen::Matrix<double,-1,1> y_prior_mean1_data__;
  Eigen::Matrix<double,-1,1> y_prior_mean2_data__;
  Eigen::Matrix<double,-1,1> y_prior_mean3_data__;
  Eigen::Matrix<double,-1,1> y_prior_scale1_data__;
  Eigen::Matrix<double,-1,1> y_prior_scale2_data__;
  Eigen::Matrix<double,-1,1> y_prior_scale3_data__;
  Eigen::Matrix<double,-1,1> y_prior_df1_data__;
  Eigen::Matrix<double,-1,1> y_prior_df2_data__;
  Eigen::Matrix<double,-1,1> y_prior_df3_data__;
  Eigen::Matrix<double,-1,1> y_global_prior_df_data__;
  Eigen::Matrix<double,-1,1> y_global_prior_scale_data__;
  Eigen::Matrix<double,-1,1> y_slab_df_data__;
  Eigen::Matrix<double,-1,1> y_slab_scale_data__;
  Eigen::Matrix<double,-1,1> y_prior_mean_for_intercept_data__;
  Eigen::Matrix<double,-1,1> y_prior_scale_for_intercept_data__;
  Eigen::Matrix<double,-1,1> y_prior_df_for_intercept_data__;
  Eigen::Matrix<double,-1,1> y_prior_mean_for_aux_data__;
  Eigen::Matrix<double,-1,1> y_prior_scale_for_aux_data__;
  Eigen::Matrix<double,-1,1> y_prior_df_for_aux_data__;
  int len_concentration;
  int len_regularization;
  Eigen::Matrix<double,-1,1> b_prior_shape_data__;
  Eigen::Matrix<double,-1,1> b_prior_scale_data__;
  std::vector<double> b_prior_concentration;
  std::vector<double> b_prior_regularization;
  Eigen::Matrix<double,-1,1> b1_prior_scale_data__;
  Eigen::Matrix<double,-1,1> b2_prior_scale_data__;
  Eigen::Matrix<double,-1,1> b1_prior_df_data__;
  Eigen::Matrix<double,-1,1> b2_prior_df_data__;
  double b1_prior_regularization;
  double b2_prior_regularization;
  int yHs1;
  int yHs2;
  int yHs3;
  int len_z_T;
  int len_var_group;
  int len_rho;
  int pos;
  std::vector<double> delta;
  std::vector<int> bCov1_idx;
  std::vector<int> bCov2_idx;
  double sum_log_y1;
  double sum_log_y2;
  double sum_log_y3;
  Eigen::Matrix<double,-1,1> sqrt_y1_data__;
  Eigen::Matrix<double,-1,1> sqrt_y2_data__;
  Eigen::Matrix<double,-1,1> sqrt_y3_data__;
  Eigen::Matrix<double,-1,1> log_y1_data__;
  Eigen::Matrix<double,-1,1> log_y2_data__;
  Eigen::Matrix<double,-1,1> log_y3_data__;
  int yGamma1_1dim__;
  int yGamma2_1dim__;
  int yGamma3_1dim__;
  int z_yBeta1_1dim__;
  int z_yBeta2_1dim__;
  int z_yBeta3_1dim__;
  int z_b_1dim__;
  int z_T_1dim__;
  int rho_1dim__;
  int zeta_1dim__;
  int tau_1dim__;
  int bSd1_1dim__;
  int z_bMat1_1dim__;
  int z_bMat1_2dim__;
  int bCholesky1_1dim__;
  int bCholesky1_2dim__;
  int bSd2_1dim__;
  int z_bMat2_1dim__;
  int z_bMat2_2dim__;
  int bCholesky2_1dim__;
  int bCholesky2_2dim__;
  int yAux1_unscaled_1dim__;
  int yAux2_unscaled_1dim__;
  int yAux3_unscaled_1dim__;
  int yLocal1_2dim__;
  int yLocal2_2dim__;
  int yLocal3_2dim__;
  int y_caux1_1dim__;
  int y_caux2_1dim__;
  int y_caux3_1dim__;
  int yOol1_1dim__;
  int yOol2_1dim__;
  int yOol3_1dim__;
  int yMix1_1dim__;
  int yMix1_2dim__;
  int yMix2_1dim__;
  int yMix2_2dim__;
  int yMix3_1dim__;
  int yMix3_2dim__;
  int yBeta1_1dim__;
  int yBeta2_1dim__;
  int yBeta3_1dim__;
  int yAux1_1dim__;
  int yAux2_1dim__;
  int yAux3_1dim__;
  int bMat1_1dim__;
  int bMat2_1dim__;
  int yAlpha1_1dim__;
  int yAlpha2_1dim__;
  int yAlpha3_1dim__;
  int bCov1_1dim__;
  int bCov2_1dim__;
  int b1_1dim__;
  int b2_1dim__;
  Eigen::Map<Eigen::Matrix<double,-1,1>> yReal1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> yReal2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> yReal3{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> yX1{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> yX2{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,-1>> yX3{nullptr, 0, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> yXbar1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> yXbar2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> yXbar3{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y1_offset{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y2_offset{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y3_offset{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_mean1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_mean2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_mean3{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_scale1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_scale2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_scale3{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_df1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_df2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_df3{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_global_prior_df{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_global_prior_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_slab_df{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_slab_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>>
    y_prior_mean_for_intercept{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>>
    y_prior_scale_for_intercept{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_df_for_intercept{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_mean_for_aux{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_scale_for_aux{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> y_prior_df_for_aux{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> b_prior_shape{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> b_prior_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> b1_prior_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> b2_prior_scale{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> b1_prior_df{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> b2_prior_df{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> sqrt_y1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> sqrt_y2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> sqrt_y3{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> log_y1{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> log_y2{nullptr, 0};
  Eigen::Map<Eigen::Matrix<double,-1,1>> log_y3{nullptr, 0};
public:
  ~model_mvmer() {}
  model_mvmer(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_mvmer_namespace::model_mvmer";
    // 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__ = 202;
      context__.validate_dims("data initialization", "M", "int",
        std::vector<size_t>{});
      M = std::numeric_limits<int>::min();
      current_statement__ = 202;
      M = context__.vals_i("M")[(1 - 1)];
      current_statement__ = 202;
      stan::math::check_greater_or_equal(function__, "M", M, 1);
      current_statement__ = 202;
      stan::math::check_less_or_equal(function__, "M", M, 3);
      current_statement__ = 203;
      context__.validate_dims("data initialization", "has_aux", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      has_aux = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 203;
      has_aux = context__.vals_i("has_aux");
      current_statement__ = 203;
      stan::math::check_greater_or_equal(function__, "has_aux", has_aux, 0);
      current_statement__ = 203;
      stan::math::check_less_or_equal(function__, "has_aux", has_aux, 1);
      current_statement__ = 204;
      context__.validate_dims("data initialization", "has_weights", "int",
        std::vector<size_t>{});
      has_weights = std::numeric_limits<int>::min();
      current_statement__ = 204;
      has_weights = context__.vals_i("has_weights")[(1 - 1)];
      current_statement__ = 204;
      stan::math::check_greater_or_equal(function__, "has_weights",
        has_weights, 0);
      current_statement__ = 204;
      stan::math::check_less_or_equal(function__, "has_weights", has_weights,
        1);
      current_statement__ = 205;
      context__.validate_dims("data initialization", "resp_type", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      resp_type = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 205;
      resp_type = context__.vals_i("resp_type");
      current_statement__ = 205;
      stan::math::check_greater_or_equal(function__, "resp_type", resp_type,
        0);
      current_statement__ = 205;
      stan::math::check_less_or_equal(function__, "resp_type", resp_type, 2);
      current_statement__ = 206;
      context__.validate_dims("data initialization", "intercept_type", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      intercept_type = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 206;
      intercept_type = context__.vals_i("intercept_type");
      current_statement__ = 206;
      stan::math::check_greater_or_equal(function__, "intercept_type",
        intercept_type, 0);
      current_statement__ = 206;
      stan::math::check_less_or_equal(function__, "intercept_type",
        intercept_type, 3);
      current_statement__ = 207;
      context__.validate_dims("data initialization", "yNobs", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      yNobs = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 207;
      yNobs = context__.vals_i("yNobs");
      current_statement__ = 207;
      stan::math::check_greater_or_equal(function__, "yNobs", yNobs, 0);
      current_statement__ = 208;
      context__.validate_dims("data initialization", "yNeta", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      yNeta = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 208;
      yNeta = context__.vals_i("yNeta");
      current_statement__ = 208;
      stan::math::check_greater_or_equal(function__, "yNeta", yNeta, 0);
      current_statement__ = 209;
      context__.validate_dims("data initialization", "yK", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      yK = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 209;
      yK = context__.vals_i("yK");
      current_statement__ = 209;
      stan::math::check_greater_or_equal(function__, "yK", yK, 0);
      current_statement__ = 210;
      context__.validate_dims("data initialization", "t", "int",
        std::vector<size_t>{});
      t = std::numeric_limits<int>::min();
      current_statement__ = 210;
      t = context__.vals_i("t")[(1 - 1)];
      current_statement__ = 210;
      stan::math::check_greater_or_equal(function__, "t", t, 0);
      current_statement__ = 211;
      stan::math::validate_non_negative_index("p", "t", t);
      current_statement__ = 212;
      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__ = 212;
      p = context__.vals_i("p");
      current_statement__ = 212;
      stan::math::check_greater_or_equal(function__, "p", p, 1);
      current_statement__ = 213;
      stan::math::validate_non_negative_index("l", "t", t);
      current_statement__ = 214;
      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__ = 214;
      l = context__.vals_i("l");
      current_statement__ = 214;
      stan::math::check_greater_or_equal(function__, "l", l, 1);
      current_statement__ = 215;
      context__.validate_dims("data initialization", "q", "int",
        std::vector<size_t>{});
      q = std::numeric_limits<int>::min();
      current_statement__ = 215;
      q = context__.vals_i("q")[(1 - 1)];
      current_statement__ = 215;
      stan::math::check_greater_or_equal(function__, "q", q, 0);
      current_statement__ = 216;
      context__.validate_dims("data initialization", "len_theta_L", "int",
        std::vector<size_t>{});
      len_theta_L = std::numeric_limits<int>::min();
      current_statement__ = 216;
      len_theta_L = context__.vals_i("len_theta_L")[(1 - 1)];
      current_statement__ = 216;
      stan::math::check_greater_or_equal(function__, "len_theta_L",
        len_theta_L, 0);
      current_statement__ = 217;
      context__.validate_dims("data initialization", "bN1", "int",
        std::vector<size_t>{});
      bN1 = std::numeric_limits<int>::min();
      current_statement__ = 217;
      bN1 = context__.vals_i("bN1")[(1 - 1)];
      current_statement__ = 217;
      stan::math::check_greater_or_equal(function__, "bN1", bN1, 0);
      current_statement__ = 218;
      context__.validate_dims("data initialization", "bK1", "int",
        std::vector<size_t>{});
      bK1 = std::numeric_limits<int>::min();
      current_statement__ = 218;
      bK1 = context__.vals_i("bK1")[(1 - 1)];
      current_statement__ = 218;
      stan::math::check_greater_or_equal(function__, "bK1", bK1, 0);
      current_statement__ = 219;
      context__.validate_dims("data initialization", "bK1_len", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      bK1_len = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 219;
      bK1_len = context__.vals_i("bK1_len");
      current_statement__ = 219;
      stan::math::check_greater_or_equal(function__, "bK1_len", bK1_len, 0);
      current_statement__ = 220;
      context__.validate_dims("data initialization", "bK1_idx", "int",
        std::vector<size_t>{static_cast<size_t>(3), static_cast<size_t>(2)});
      bK1_idx = std::vector<std::vector<int>>(3,
                  std::vector<int>(2, std::numeric_limits<int>::min()));
      {
        std::vector<int> bK1_idx_flat__;
        current_statement__ = 220;
        bK1_idx_flat__ = context__.vals_i("bK1_idx");
        current_statement__ = 220;
        pos__ = 1;
        current_statement__ = 220;
        for (int sym1__ = 1; sym1__ <= 2; ++sym1__) {
          current_statement__ = 220;
          for (int sym2__ = 1; sym2__ <= 3; ++sym2__) {
            current_statement__ = 220;
            stan::model::assign(bK1_idx, bK1_idx_flat__[(pos__ - 1)],
              "assigning variable bK1_idx", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 220;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 220;
      stan::math::check_greater_or_equal(function__, "bK1_idx", bK1_idx, 0);
      current_statement__ = 221;
      context__.validate_dims("data initialization", "bN2", "int",
        std::vector<size_t>{});
      bN2 = std::numeric_limits<int>::min();
      current_statement__ = 221;
      bN2 = context__.vals_i("bN2")[(1 - 1)];
      current_statement__ = 221;
      stan::math::check_greater_or_equal(function__, "bN2", bN2, 0);
      current_statement__ = 222;
      context__.validate_dims("data initialization", "bK2", "int",
        std::vector<size_t>{});
      bK2 = std::numeric_limits<int>::min();
      current_statement__ = 222;
      bK2 = context__.vals_i("bK2")[(1 - 1)];
      current_statement__ = 222;
      stan::math::check_greater_or_equal(function__, "bK2", bK2, 0);
      current_statement__ = 223;
      context__.validate_dims("data initialization", "bK2_len", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      bK2_len = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 223;
      bK2_len = context__.vals_i("bK2_len");
      current_statement__ = 223;
      stan::math::check_greater_or_equal(function__, "bK2_len", bK2_len, 0);
      current_statement__ = 224;
      context__.validate_dims("data initialization", "bK2_idx", "int",
        std::vector<size_t>{static_cast<size_t>(3), static_cast<size_t>(2)});
      bK2_idx = std::vector<std::vector<int>>(3,
                  std::vector<int>(2, std::numeric_limits<int>::min()));
      {
        std::vector<int> bK2_idx_flat__;
        current_statement__ = 224;
        bK2_idx_flat__ = context__.vals_i("bK2_idx");
        current_statement__ = 224;
        pos__ = 1;
        current_statement__ = 224;
        for (int sym1__ = 1; sym1__ <= 2; ++sym1__) {
          current_statement__ = 224;
          for (int sym2__ = 1; sym2__ <= 3; ++sym2__) {
            current_statement__ = 224;
            stan::model::assign(bK2_idx, bK2_idx_flat__[(pos__ - 1)],
              "assigning variable bK2_idx", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 224;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 224;
      stan::math::check_greater_or_equal(function__, "bK2_idx", bK2_idx, 0);
      current_statement__ = 225;
      stan::math::validate_non_negative_index("yInt1",
        "resp_type[1] == 2 ? yNobs[1] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(1)), 2) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(1)) : 0));
      current_statement__ = 226;
      context__.validate_dims("data initialization", "yInt1", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(resp_type, "resp_type",
                                   stan::model::index_uni(1)), 2) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    1)) : 0))});
      yInt1 = std::vector<int>((stan::math::logical_eq(
                                  stan::model::rvalue(resp_type, "resp_type",
                                    stan::model::index_uni(1)), 2) ? 
                stan::model::rvalue(yNobs, "yNobs", stan::model::index_uni(1)) : 0),
                std::numeric_limits<int>::min());
      current_statement__ = 226;
      yInt1 = context__.vals_i("yInt1");
      current_statement__ = 226;
      stan::math::check_greater_or_equal(function__, "yInt1", yInt1, 0);
      current_statement__ = 227;
      stan::math::validate_non_negative_index("yInt2",
        "resp_type[2] == 2 ? yNobs[2] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(2)), 2) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(2)) : 0));
      current_statement__ = 228;
      context__.validate_dims("data initialization", "yInt2", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(resp_type, "resp_type",
                                   stan::model::index_uni(2)), 2) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    2)) : 0))});
      yInt2 = std::vector<int>((stan::math::logical_eq(
                                  stan::model::rvalue(resp_type, "resp_type",
                                    stan::model::index_uni(2)), 2) ? 
                stan::model::rvalue(yNobs, "yNobs", stan::model::index_uni(2)) : 0),
                std::numeric_limits<int>::min());
      current_statement__ = 228;
      yInt2 = context__.vals_i("yInt2");
      current_statement__ = 228;
      stan::math::check_greater_or_equal(function__, "yInt2", yInt2, 0);
      current_statement__ = 229;
      stan::math::validate_non_negative_index("yInt3",
        "resp_type[3] == 2 ? yNobs[3] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(3)), 2) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(3)) : 0));
      current_statement__ = 230;
      context__.validate_dims("data initialization", "yInt3", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(resp_type, "resp_type",
                                   stan::model::index_uni(3)), 2) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    3)) : 0))});
      yInt3 = std::vector<int>((stan::math::logical_eq(
                                  stan::model::rvalue(resp_type, "resp_type",
                                    stan::model::index_uni(3)), 2) ? 
                stan::model::rvalue(yNobs, "yNobs", stan::model::index_uni(3)) : 0),
                std::numeric_limits<int>::min());
      current_statement__ = 230;
      yInt3 = context__.vals_i("yInt3");
      current_statement__ = 230;
      stan::math::check_greater_or_equal(function__, "yInt3", yInt3, 0);
      current_statement__ = 231;
      stan::math::validate_non_negative_index("yReal1",
        "resp_type[1] == 1 ? yNobs[1] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(1)), 1) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(1)) : 0));
      current_statement__ = 232;
      context__.validate_dims("data initialization", "yReal1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(resp_type, "resp_type",
                                   stan::model::index_uni(1)), 1) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    1)) : 0))});
      yReal1_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_eq(
                                                              stan::model::rvalue(
                                                                resp_type,
                                                                "resp_type",
                                                                stan::model::index_uni(
                                                                  1)), 1) ? 
                        stan::model::rvalue(yNobs, "yNobs",
                          stan::model::index_uni(1)) : 0),
                        std::numeric_limits<double>::quiet_NaN());
      new (&yReal1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(yReal1_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(1)), 1) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(1)) : 0));
      {
        std::vector<local_scalar_t__> yReal1_flat__;
        current_statement__ = 232;
        yReal1_flat__ = context__.vals_r("yReal1");
        current_statement__ = 232;
        pos__ = 1;
        current_statement__ = 232;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_eq(
                stan::model::rvalue(resp_type, "resp_type",
                  stan::model::index_uni(1)), 1) ? stan::model::rvalue(yNobs,
                                                     "yNobs",
                                                     stan::model::index_uni(1)) : 0); ++sym1__) {
          current_statement__ = 232;
          stan::model::assign(yReal1, yReal1_flat__[(pos__ - 1)],
            "assigning variable yReal1", stan::model::index_uni(sym1__));
          current_statement__ = 232;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 233;
      stan::math::validate_non_negative_index("yReal2",
        "resp_type[2] == 1 ? yNobs[2] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(2)), 1) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(2)) : 0));
      current_statement__ = 234;
      context__.validate_dims("data initialization", "yReal2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(resp_type, "resp_type",
                                   stan::model::index_uni(2)), 1) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    2)) : 0))});
      yReal2_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_eq(
                                                              stan::model::rvalue(
                                                                resp_type,
                                                                "resp_type",
                                                                stan::model::index_uni(
                                                                  2)), 1) ? 
                        stan::model::rvalue(yNobs, "yNobs",
                          stan::model::index_uni(2)) : 0),
                        std::numeric_limits<double>::quiet_NaN());
      new (&yReal2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(yReal2_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(2)), 1) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(2)) : 0));
      {
        std::vector<local_scalar_t__> yReal2_flat__;
        current_statement__ = 234;
        yReal2_flat__ = context__.vals_r("yReal2");
        current_statement__ = 234;
        pos__ = 1;
        current_statement__ = 234;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_eq(
                stan::model::rvalue(resp_type, "resp_type",
                  stan::model::index_uni(2)), 1) ? stan::model::rvalue(yNobs,
                                                     "yNobs",
                                                     stan::model::index_uni(2)) : 0); ++sym1__) {
          current_statement__ = 234;
          stan::model::assign(yReal2, yReal2_flat__[(pos__ - 1)],
            "assigning variable yReal2", stan::model::index_uni(sym1__));
          current_statement__ = 234;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 235;
      stan::math::validate_non_negative_index("yReal3",
        "resp_type[3] == 1 ? yNobs[3] : 0",
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(3)), 1) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(3)) : 0));
      current_statement__ = 236;
      context__.validate_dims("data initialization", "yReal3", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_eq(
                                 stan::model::rvalue(resp_type, "resp_type",
                                   stan::model::index_uni(3)), 1) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    3)) : 0))});
      yReal3_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_eq(
                                                              stan::model::rvalue(
                                                                resp_type,
                                                                "resp_type",
                                                                stan::model::index_uni(
                                                                  3)), 1) ? 
                        stan::model::rvalue(yNobs, "yNobs",
                          stan::model::index_uni(3)) : 0),
                        std::numeric_limits<double>::quiet_NaN());
      new (&yReal3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(yReal3_data__.data(),
        (stan::math::logical_eq(
           stan::model::rvalue(resp_type, "resp_type",
             stan::model::index_uni(3)), 1) ? stan::model::rvalue(yNobs,
                                                "yNobs",
                                                stan::model::index_uni(3)) : 0));
      {
        std::vector<local_scalar_t__> yReal3_flat__;
        current_statement__ = 236;
        yReal3_flat__ = context__.vals_r("yReal3");
        current_statement__ = 236;
        pos__ = 1;
        current_statement__ = 236;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_eq(
                stan::model::rvalue(resp_type, "resp_type",
                  stan::model::index_uni(3)), 1) ? stan::model::rvalue(yNobs,
                                                     "yNobs",
                                                     stan::model::index_uni(3)) : 0); ++sym1__) {
          current_statement__ = 236;
          stan::model::assign(yReal3, yReal3_flat__[(pos__ - 1)],
            "assigning variable yReal3", stan::model::index_uni(sym1__));
          current_statement__ = 236;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 237;
      stan::math::validate_non_negative_index("yX1", "yNeta[1]",
        stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)));
      current_statement__ = 238;
      stan::math::validate_non_negative_index("yX1", "yK[1]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      current_statement__ = 239;
      context__.validate_dims("data initialization", "yX1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yNeta, "yNeta",
                                stan::model::index_uni(1))),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(1)))});
      yX1_data__ = Eigen::Matrix<double,-1,-1>::Constant(stan::model::rvalue(
                                                           yNeta, "yNeta",
                                                           stan::model::index_uni(
                                                             1)),
                     stan::model::rvalue(yK, "yK", stan::model::index_uni(1)),
                     std::numeric_limits<double>::quiet_NaN());
      new (&yX1) Eigen::Map<Eigen::Matrix<double,-1,-1>>(yX1_data__.data(),
        stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      {
        std::vector<local_scalar_t__> yX1_flat__;
        current_statement__ = 239;
        yX1_flat__ = context__.vals_r("yX1");
        current_statement__ = 239;
        pos__ = 1;
        current_statement__ = 239;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(1)); ++sym1__) {
          current_statement__ = 239;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)); ++sym2__) {
            current_statement__ = 239;
            stan::model::assign(yX1, yX1_flat__[(pos__ - 1)],
              "assigning variable yX1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 239;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 240;
      stan::math::validate_non_negative_index("yX2", "yNeta[2]",
        stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)));
      current_statement__ = 241;
      stan::math::validate_non_negative_index("yX2", "yK[2]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      current_statement__ = 242;
      context__.validate_dims("data initialization", "yX2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yNeta, "yNeta",
                                stan::model::index_uni(2))),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(2)))});
      yX2_data__ = Eigen::Matrix<double,-1,-1>::Constant(stan::model::rvalue(
                                                           yNeta, "yNeta",
                                                           stan::model::index_uni(
                                                             2)),
                     stan::model::rvalue(yK, "yK", stan::model::index_uni(2)),
                     std::numeric_limits<double>::quiet_NaN());
      new (&yX2) Eigen::Map<Eigen::Matrix<double,-1,-1>>(yX2_data__.data(),
        stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      {
        std::vector<local_scalar_t__> yX2_flat__;
        current_statement__ = 242;
        yX2_flat__ = context__.vals_r("yX2");
        current_statement__ = 242;
        pos__ = 1;
        current_statement__ = 242;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(2)); ++sym1__) {
          current_statement__ = 242;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)); ++sym2__) {
            current_statement__ = 242;
            stan::model::assign(yX2, yX2_flat__[(pos__ - 1)],
              "assigning variable yX2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 242;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 243;
      stan::math::validate_non_negative_index("yX3", "yNeta[3]",
        stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)));
      current_statement__ = 244;
      stan::math::validate_non_negative_index("yX3", "yK[3]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      current_statement__ = 245;
      context__.validate_dims("data initialization", "yX3", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yNeta, "yNeta",
                                stan::model::index_uni(3))),
          static_cast<size_t>(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(3)))});
      yX3_data__ = Eigen::Matrix<double,-1,-1>::Constant(stan::model::rvalue(
                                                           yNeta, "yNeta",
                                                           stan::model::index_uni(
                                                             3)),
                     stan::model::rvalue(yK, "yK", stan::model::index_uni(3)),
                     std::numeric_limits<double>::quiet_NaN());
      new (&yX3) Eigen::Map<Eigen::Matrix<double,-1,-1>>(yX3_data__.data(),
        stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      {
        std::vector<local_scalar_t__> yX3_flat__;
        current_statement__ = 245;
        yX3_flat__ = context__.vals_r("yX3");
        current_statement__ = 245;
        pos__ = 1;
        current_statement__ = 245;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(3)); ++sym1__) {
          current_statement__ = 245;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)); ++sym2__) {
            current_statement__ = 245;
            stan::model::assign(yX3, yX3_flat__[(pos__ - 1)],
              "assigning variable yX3", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 245;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 246;
      stan::math::validate_non_negative_index("yXbar1", "yK[1]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      current_statement__ = 247;
      context__.validate_dims("data initialization", "yXbar1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(1)))});
      yXbar1_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                             yK, "yK",
                                                             stan::model::index_uni(
                                                               1)),
                        std::numeric_limits<double>::quiet_NaN());
      new (&yXbar1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(yXbar1_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      {
        std::vector<local_scalar_t__> yXbar1_flat__;
        current_statement__ = 247;
        yXbar1_flat__ = context__.vals_r("yXbar1");
        current_statement__ = 247;
        pos__ = 1;
        current_statement__ = 247;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(1)); ++sym1__) {
          current_statement__ = 247;
          stan::model::assign(yXbar1, yXbar1_flat__[(pos__ - 1)],
            "assigning variable yXbar1", stan::model::index_uni(sym1__));
          current_statement__ = 247;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 248;
      stan::math::validate_non_negative_index("yXbar2", "yK[2]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      current_statement__ = 249;
      context__.validate_dims("data initialization", "yXbar2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(2)))});
      yXbar2_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                             yK, "yK",
                                                             stan::model::index_uni(
                                                               2)),
                        std::numeric_limits<double>::quiet_NaN());
      new (&yXbar2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(yXbar2_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      {
        std::vector<local_scalar_t__> yXbar2_flat__;
        current_statement__ = 249;
        yXbar2_flat__ = context__.vals_r("yXbar2");
        current_statement__ = 249;
        pos__ = 1;
        current_statement__ = 249;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(2)); ++sym1__) {
          current_statement__ = 249;
          stan::model::assign(yXbar2, yXbar2_flat__[(pos__ - 1)],
            "assigning variable yXbar2", stan::model::index_uni(sym1__));
          current_statement__ = 249;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 250;
      stan::math::validate_non_negative_index("yXbar3", "yK[3]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      current_statement__ = 251;
      context__.validate_dims("data initialization", "yXbar3", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(3)))});
      yXbar3_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                             yK, "yK",
                                                             stan::model::index_uni(
                                                               3)),
                        std::numeric_limits<double>::quiet_NaN());
      new (&yXbar3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(yXbar3_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      {
        std::vector<local_scalar_t__> yXbar3_flat__;
        current_statement__ = 251;
        yXbar3_flat__ = context__.vals_r("yXbar3");
        current_statement__ = 251;
        pos__ = 1;
        current_statement__ = 251;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(3)); ++sym1__) {
          current_statement__ = 251;
          stan::model::assign(yXbar3, yXbar3_flat__[(pos__ - 1)],
            "assigning variable yXbar3", stan::model::index_uni(sym1__));
          current_statement__ = 251;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 252;
      stan::math::validate_non_negative_index("family", "M", M);
      current_statement__ = 253;
      context__.validate_dims("data initialization", "family", "int",
        std::vector<size_t>{static_cast<size_t>(M)});
      family = std::vector<int>(M, std::numeric_limits<int>::min());
      current_statement__ = 253;
      family = context__.vals_i("family");
      current_statement__ = 253;
      stan::math::check_greater_or_equal(function__, "family", family, 0);
      current_statement__ = 254;
      stan::math::validate_non_negative_index("link", "M", M);
      current_statement__ = 255;
      context__.validate_dims("data initialization", "link", "int",
        std::vector<size_t>{static_cast<size_t>(M)});
      link = std::vector<int>(M, std::numeric_limits<int>::min());
      current_statement__ = 255;
      link = context__.vals_i("link");
      current_statement__ = 255;
      stan::math::check_greater_or_equal(function__, "link", link, 0);
      current_statement__ = 256;
      stan::math::validate_non_negative_index("y1_Z1", "bK1_len[1]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)));
      current_statement__ = 257;
      stan::math::validate_non_negative_index("y1_Z1",
        "bK1_len[1] > 0 ? yNeta[1] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)) : 0));
      current_statement__ = 258;
      context__.validate_dims("data initialization", "y1_Z1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(1))),
          static_cast<size_t>(
            (stan::math::logical_gt(
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(1)), 0) ? stan::model::rvalue(yNeta,
                                                    "yNeta",
                                                    stan::model::index_uni(1)) : 0))});
      y1_Z1 = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                        bK1_len, "bK1_len",
                                                        stan::model::index_uni(
                                                          1)),
                Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                        stan::model::rvalue(
                                                          bK1_len, "bK1_len",
                                                          stan::model::index_uni(
                                                            1)), 0) ? 
                  stan::model::rvalue(yNeta, "yNeta",
                    stan::model::index_uni(1)) : 0),
                  std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y1_Z1_flat__;
        current_statement__ = 258;
        y1_Z1_flat__ = context__.vals_r("y1_Z1");
        current_statement__ = 258;
        pos__ = 1;
        current_statement__ = 258;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(1)), 0) ? stan::model::rvalue(yNeta,
                                                     "yNeta",
                                                     stan::model::index_uni(1)) : 0); ++sym1__) {
          current_statement__ = 258;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(1)); ++sym2__) {
            current_statement__ = 258;
            stan::model::assign(y1_Z1, y1_Z1_flat__[(pos__ - 1)],
              "assigning variable y1_Z1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 258;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 259;
      stan::math::validate_non_negative_index("y2_Z1", "bK1_len[2]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)));
      current_statement__ = 260;
      stan::math::validate_non_negative_index("y2_Z1",
        "bK1_len[2] > 0 ? yNeta[2] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)) : 0));
      current_statement__ = 261;
      context__.validate_dims("data initialization", "y2_Z1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(2))),
          static_cast<size_t>(
            (stan::math::logical_gt(
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(2)), 0) ? stan::model::rvalue(yNeta,
                                                    "yNeta",
                                                    stan::model::index_uni(2)) : 0))});
      y2_Z1 = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                        bK1_len, "bK1_len",
                                                        stan::model::index_uni(
                                                          2)),
                Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                        stan::model::rvalue(
                                                          bK1_len, "bK1_len",
                                                          stan::model::index_uni(
                                                            2)), 0) ? 
                  stan::model::rvalue(yNeta, "yNeta",
                    stan::model::index_uni(2)) : 0),
                  std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y2_Z1_flat__;
        current_statement__ = 261;
        y2_Z1_flat__ = context__.vals_r("y2_Z1");
        current_statement__ = 261;
        pos__ = 1;
        current_statement__ = 261;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(2)), 0) ? stan::model::rvalue(yNeta,
                                                     "yNeta",
                                                     stan::model::index_uni(2)) : 0); ++sym1__) {
          current_statement__ = 261;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(2)); ++sym2__) {
            current_statement__ = 261;
            stan::model::assign(y2_Z1, y2_Z1_flat__[(pos__ - 1)],
              "assigning variable y2_Z1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 261;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 262;
      stan::math::validate_non_negative_index("y3_Z1", "bK1_len[3]",
        stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)));
      current_statement__ = 263;
      stan::math::validate_non_negative_index("y3_Z1",
        "bK1_len[3] > 0 ? yNeta[3] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)) : 0));
      current_statement__ = 264;
      context__.validate_dims("data initialization", "y3_Z1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK1_len, "bK1_len",
                                stan::model::index_uni(3))),
          static_cast<size_t>(
            (stan::math::logical_gt(
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(3)), 0) ? stan::model::rvalue(yNeta,
                                                    "yNeta",
                                                    stan::model::index_uni(3)) : 0))});
      y3_Z1 = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                        bK1_len, "bK1_len",
                                                        stan::model::index_uni(
                                                          3)),
                Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                        stan::model::rvalue(
                                                          bK1_len, "bK1_len",
                                                          stan::model::index_uni(
                                                            3)), 0) ? 
                  stan::model::rvalue(yNeta, "yNeta",
                    stan::model::index_uni(3)) : 0),
                  std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y3_Z1_flat__;
        current_statement__ = 264;
        y3_Z1_flat__ = context__.vals_r("y3_Z1");
        current_statement__ = 264;
        pos__ = 1;
        current_statement__ = 264;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(
                stan::model::rvalue(bK1_len, "bK1_len",
                  stan::model::index_uni(3)), 0) ? stan::model::rvalue(yNeta,
                                                     "yNeta",
                                                     stan::model::index_uni(3)) : 0); ++sym1__) {
          current_statement__ = 264;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK1_len, "bK1_len",
                 stan::model::index_uni(3)); ++sym2__) {
            current_statement__ = 264;
            stan::model::assign(y3_Z1, y3_Z1_flat__[(pos__ - 1)],
              "assigning variable y3_Z1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 264;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 265;
      stan::math::validate_non_negative_index("y1_Z1_id",
        "bK1_len[1] > 0 ? yNeta[1] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)) : 0));
      current_statement__ = 266;
      context__.validate_dims("data initialization", "y1_Z1_id", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(
                                 stan::model::rvalue(bK1_len, "bK1_len",
                                   stan::model::index_uni(1)), 0) ? stan::model::rvalue(
                                                                    yNeta,
                                                                    "yNeta",
                                                                    stan::model::index_uni(
                                                                    1)) : 0))});
      y1_Z1_id = std::vector<int>((stan::math::logical_gt(
                                     stan::model::rvalue(bK1_len, "bK1_len",
                                       stan::model::index_uni(1)), 0) ? 
                   stan::model::rvalue(yNeta, "yNeta",
                     stan::model::index_uni(1)) : 0),
                   std::numeric_limits<int>::min());
      current_statement__ = 266;
      y1_Z1_id = context__.vals_i("y1_Z1_id");
      current_statement__ = 266;
      stan::math::check_greater_or_equal(function__, "y1_Z1_id", y1_Z1_id, 0);
      current_statement__ = 267;
      stan::math::validate_non_negative_index("y2_Z1_id",
        "bK1_len[2] > 0 ? yNeta[2] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)) : 0));
      current_statement__ = 268;
      context__.validate_dims("data initialization", "y2_Z1_id", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(
                                 stan::model::rvalue(bK1_len, "bK1_len",
                                   stan::model::index_uni(2)), 0) ? stan::model::rvalue(
                                                                    yNeta,
                                                                    "yNeta",
                                                                    stan::model::index_uni(
                                                                    2)) : 0))});
      y2_Z1_id = std::vector<int>((stan::math::logical_gt(
                                     stan::model::rvalue(bK1_len, "bK1_len",
                                       stan::model::index_uni(2)), 0) ? 
                   stan::model::rvalue(yNeta, "yNeta",
                     stan::model::index_uni(2)) : 0),
                   std::numeric_limits<int>::min());
      current_statement__ = 268;
      y2_Z1_id = context__.vals_i("y2_Z1_id");
      current_statement__ = 268;
      stan::math::check_greater_or_equal(function__, "y2_Z1_id", y2_Z1_id, 0);
      current_statement__ = 269;
      stan::math::validate_non_negative_index("y3_Z1_id",
        "bK1_len[3] > 0 ? yNeta[3] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(3)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)) : 0));
      current_statement__ = 270;
      context__.validate_dims("data initialization", "y3_Z1_id", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(
                                 stan::model::rvalue(bK1_len, "bK1_len",
                                   stan::model::index_uni(3)), 0) ? stan::model::rvalue(
                                                                    yNeta,
                                                                    "yNeta",
                                                                    stan::model::index_uni(
                                                                    3)) : 0))});
      y3_Z1_id = std::vector<int>((stan::math::logical_gt(
                                     stan::model::rvalue(bK1_len, "bK1_len",
                                       stan::model::index_uni(3)), 0) ? 
                   stan::model::rvalue(yNeta, "yNeta",
                     stan::model::index_uni(3)) : 0),
                   std::numeric_limits<int>::min());
      current_statement__ = 270;
      y3_Z1_id = context__.vals_i("y3_Z1_id");
      current_statement__ = 270;
      stan::math::check_greater_or_equal(function__, "y3_Z1_id", y3_Z1_id, 0);
      current_statement__ = 271;
      stan::math::validate_non_negative_index("y1_Z2", "bK2_len[1]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)));
      current_statement__ = 272;
      stan::math::validate_non_negative_index("y1_Z2",
        "bK2_len[1] > 0 ? yNeta[1] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)) : 0));
      current_statement__ = 273;
      context__.validate_dims("data initialization", "y1_Z2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(1))),
          static_cast<size_t>(
            (stan::math::logical_gt(
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(1)), 0) ? stan::model::rvalue(yNeta,
                                                    "yNeta",
                                                    stan::model::index_uni(1)) : 0))});
      y1_Z2 = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                        bK2_len, "bK2_len",
                                                        stan::model::index_uni(
                                                          1)),
                Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                        stan::model::rvalue(
                                                          bK2_len, "bK2_len",
                                                          stan::model::index_uni(
                                                            1)), 0) ? 
                  stan::model::rvalue(yNeta, "yNeta",
                    stan::model::index_uni(1)) : 0),
                  std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y1_Z2_flat__;
        current_statement__ = 273;
        y1_Z2_flat__ = context__.vals_r("y1_Z2");
        current_statement__ = 273;
        pos__ = 1;
        current_statement__ = 273;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(1)), 0) ? stan::model::rvalue(yNeta,
                                                     "yNeta",
                                                     stan::model::index_uni(1)) : 0); ++sym1__) {
          current_statement__ = 273;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(1)); ++sym2__) {
            current_statement__ = 273;
            stan::model::assign(y1_Z2, y1_Z2_flat__[(pos__ - 1)],
              "assigning variable y1_Z2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 273;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 274;
      stan::math::validate_non_negative_index("y2_Z2", "bK2_len[2]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)));
      current_statement__ = 275;
      stan::math::validate_non_negative_index("y2_Z2",
        "bK2_len[2] > 0 ? yNeta[2] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)) : 0));
      current_statement__ = 276;
      context__.validate_dims("data initialization", "y2_Z2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(2))),
          static_cast<size_t>(
            (stan::math::logical_gt(
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(2)), 0) ? stan::model::rvalue(yNeta,
                                                    "yNeta",
                                                    stan::model::index_uni(2)) : 0))});
      y2_Z2 = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                        bK2_len, "bK2_len",
                                                        stan::model::index_uni(
                                                          2)),
                Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                        stan::model::rvalue(
                                                          bK2_len, "bK2_len",
                                                          stan::model::index_uni(
                                                            2)), 0) ? 
                  stan::model::rvalue(yNeta, "yNeta",
                    stan::model::index_uni(2)) : 0),
                  std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y2_Z2_flat__;
        current_statement__ = 276;
        y2_Z2_flat__ = context__.vals_r("y2_Z2");
        current_statement__ = 276;
        pos__ = 1;
        current_statement__ = 276;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(2)), 0) ? stan::model::rvalue(yNeta,
                                                     "yNeta",
                                                     stan::model::index_uni(2)) : 0); ++sym1__) {
          current_statement__ = 276;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(2)); ++sym2__) {
            current_statement__ = 276;
            stan::model::assign(y2_Z2, y2_Z2_flat__[(pos__ - 1)],
              "assigning variable y2_Z2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 276;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 277;
      stan::math::validate_non_negative_index("y3_Z2", "bK2_len[3]",
        stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)));
      current_statement__ = 278;
      stan::math::validate_non_negative_index("y3_Z2",
        "bK2_len[3] > 0 ? yNeta[3] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)) : 0));
      current_statement__ = 279;
      context__.validate_dims("data initialization", "y3_Z2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(bK2_len, "bK2_len",
                                stan::model::index_uni(3))),
          static_cast<size_t>(
            (stan::math::logical_gt(
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(3)), 0) ? stan::model::rvalue(yNeta,
                                                    "yNeta",
                                                    stan::model::index_uni(3)) : 0))});
      y3_Z2 = std::vector<Eigen::Matrix<double,-1,1>>(stan::model::rvalue(
                                                        bK2_len, "bK2_len",
                                                        stan::model::index_uni(
                                                          3)),
                Eigen::Matrix<double,-1,1>::Constant((stan::math::logical_gt(
                                                        stan::model::rvalue(
                                                          bK2_len, "bK2_len",
                                                          stan::model::index_uni(
                                                            3)), 0) ? 
                  stan::model::rvalue(yNeta, "yNeta",
                    stan::model::index_uni(3)) : 0),
                  std::numeric_limits<double>::quiet_NaN()));
      {
        std::vector<local_scalar_t__> y3_Z2_flat__;
        current_statement__ = 279;
        y3_Z2_flat__ = context__.vals_r("y3_Z2");
        current_statement__ = 279;
        pos__ = 1;
        current_statement__ = 279;
        for (int sym1__ = 1; sym1__ <=
             (stan::math::logical_gt(
                stan::model::rvalue(bK2_len, "bK2_len",
                  stan::model::index_uni(3)), 0) ? stan::model::rvalue(yNeta,
                                                     "yNeta",
                                                     stan::model::index_uni(3)) : 0); ++sym1__) {
          current_statement__ = 279;
          for (int sym2__ = 1; sym2__ <=
               stan::model::rvalue(bK2_len, "bK2_len",
                 stan::model::index_uni(3)); ++sym2__) {
            current_statement__ = 279;
            stan::model::assign(y3_Z2, y3_Z2_flat__[(pos__ - 1)],
              "assigning variable y3_Z2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 279;
            pos__ = (pos__ + 1);
          }
        }
      }
      current_statement__ = 280;
      stan::math::validate_non_negative_index("y1_Z2_id",
        "bK2_len[1] > 0 ? yNeta[1] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)) : 0));
      current_statement__ = 281;
      context__.validate_dims("data initialization", "y1_Z2_id", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(
                                 stan::model::rvalue(bK2_len, "bK2_len",
                                   stan::model::index_uni(1)), 0) ? stan::model::rvalue(
                                                                    yNeta,
                                                                    "yNeta",
                                                                    stan::model::index_uni(
                                                                    1)) : 0))});
      y1_Z2_id = std::vector<int>((stan::math::logical_gt(
                                     stan::model::rvalue(bK2_len, "bK2_len",
                                       stan::model::index_uni(1)), 0) ? 
                   stan::model::rvalue(yNeta, "yNeta",
                     stan::model::index_uni(1)) : 0),
                   std::numeric_limits<int>::min());
      current_statement__ = 281;
      y1_Z2_id = context__.vals_i("y1_Z2_id");
      current_statement__ = 281;
      stan::math::check_greater_or_equal(function__, "y1_Z2_id", y1_Z2_id, 0);
      current_statement__ = 282;
      stan::math::validate_non_negative_index("y2_Z2_id",
        "bK2_len[2] > 0 ? yNeta[2] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)) : 0));
      current_statement__ = 283;
      context__.validate_dims("data initialization", "y2_Z2_id", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(
                                 stan::model::rvalue(bK2_len, "bK2_len",
                                   stan::model::index_uni(2)), 0) ? stan::model::rvalue(
                                                                    yNeta,
                                                                    "yNeta",
                                                                    stan::model::index_uni(
                                                                    2)) : 0))});
      y2_Z2_id = std::vector<int>((stan::math::logical_gt(
                                     stan::model::rvalue(bK2_len, "bK2_len",
                                       stan::model::index_uni(2)), 0) ? 
                   stan::model::rvalue(yNeta, "yNeta",
                     stan::model::index_uni(2)) : 0),
                   std::numeric_limits<int>::min());
      current_statement__ = 283;
      y2_Z2_id = context__.vals_i("y2_Z2_id");
      current_statement__ = 283;
      stan::math::check_greater_or_equal(function__, "y2_Z2_id", y2_Z2_id, 0);
      current_statement__ = 284;
      stan::math::validate_non_negative_index("y3_Z2_id",
        "bK2_len[3] > 0 ? yNeta[3] : 0",
        (stan::math::logical_gt(
           stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(3)),
           0) ? stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)) : 0));
      current_statement__ = 285;
      context__.validate_dims("data initialization", "y3_Z2_id", "int",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::math::logical_gt(
                                 stan::model::rvalue(bK2_len, "bK2_len",
                                   stan::model::index_uni(3)), 0) ? stan::model::rvalue(
                                                                    yNeta,
                                                                    "yNeta",
                                                                    stan::model::index_uni(
                                                                    3)) : 0))});
      y3_Z2_id = std::vector<int>((stan::math::logical_gt(
                                     stan::model::rvalue(bK2_len, "bK2_len",
                                       stan::model::index_uni(3)), 0) ? 
                   stan::model::rvalue(yNeta, "yNeta",
                     stan::model::index_uni(3)) : 0),
                   std::numeric_limits<int>::min());
      current_statement__ = 285;
      y3_Z2_id = context__.vals_i("y3_Z2_id");
      current_statement__ = 285;
      stan::math::check_greater_or_equal(function__, "y3_Z2_id", y3_Z2_id, 0);
      current_statement__ = 286;
      context__.validate_dims("data initialization", "y_prior_dist", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      y_prior_dist = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 286;
      y_prior_dist = context__.vals_i("y_prior_dist");
      current_statement__ = 286;
      stan::math::check_greater_or_equal(function__, "y_prior_dist",
        y_prior_dist, 0);
      current_statement__ = 286;
      stan::math::check_less_or_equal(function__, "y_prior_dist",
        y_prior_dist, 7);
      current_statement__ = 287;
      stan::math::validate_non_negative_index("y_prior_dist_for_intercept",
        "M", M);
      current_statement__ = 288;
      context__.validate_dims("data initialization",
        "y_prior_dist_for_intercept", "int",
        std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_dist_for_intercept = std::vector<int>(M,
                                     std::numeric_limits<int>::min());
      current_statement__ = 288;
      y_prior_dist_for_intercept = context__.vals_i("y_prior_dist_for_intercept");
      current_statement__ = 288;
      stan::math::check_greater_or_equal(function__,
        "y_prior_dist_for_intercept", y_prior_dist_for_intercept, 0);
      current_statement__ = 288;
      stan::math::check_less_or_equal(function__,
        "y_prior_dist_for_intercept", y_prior_dist_for_intercept, 2);
      current_statement__ = 289;
      stan::math::validate_non_negative_index("y_prior_dist_for_aux", "M", M);
      current_statement__ = 290;
      context__.validate_dims("data initialization", "y_prior_dist_for_aux",
        "int", std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_dist_for_aux = std::vector<int>(M,
                               std::numeric_limits<int>::min());
      current_statement__ = 290;
      y_prior_dist_for_aux = context__.vals_i("y_prior_dist_for_aux");
      current_statement__ = 290;
      stan::math::check_greater_or_equal(function__, "y_prior_dist_for_aux",
        y_prior_dist_for_aux, 0);
      current_statement__ = 290;
      stan::math::check_less_or_equal(function__, "y_prior_dist_for_aux",
        y_prior_dist_for_aux, 3);
      current_statement__ = 291;
      context__.validate_dims("data initialization", "prior_dist_for_cov",
        "int", std::vector<size_t>{});
      prior_dist_for_cov = std::numeric_limits<int>::min();
      current_statement__ = 291;
      prior_dist_for_cov = context__.vals_i("prior_dist_for_cov")[(1 - 1)];
      current_statement__ = 291;
      stan::math::check_greater_or_equal(function__, "prior_dist_for_cov",
        prior_dist_for_cov, 1);
      current_statement__ = 291;
      stan::math::check_less_or_equal(function__, "prior_dist_for_cov",
        prior_dist_for_cov, 2);
      current_statement__ = 292;
      context__.validate_dims("data initialization", "prior_PD", "int",
        std::vector<size_t>{});
      prior_PD = std::numeric_limits<int>::min();
      current_statement__ = 292;
      prior_PD = context__.vals_i("prior_PD")[(1 - 1)];
      current_statement__ = 292;
      stan::math::check_greater_or_equal(function__, "prior_PD", prior_PD, 0);
      current_statement__ = 292;
      stan::math::check_less_or_equal(function__, "prior_PD", prior_PD, 1);
      current_statement__ = 293;
      context__.validate_dims("data initialization", "has_offset", "int",
        std::vector<size_t>{static_cast<size_t>(3)});
      has_offset = std::vector<int>(3, std::numeric_limits<int>::min());
      current_statement__ = 293;
      has_offset = context__.vals_i("has_offset");
      current_statement__ = 293;
      stan::math::check_greater_or_equal(function__, "has_offset",
        has_offset, 0);
      current_statement__ = 293;
      stan::math::check_less_or_equal(function__, "has_offset", has_offset, 1);
      current_statement__ = 294;
      stan::math::validate_non_negative_index("y1_offset",
        "has_offset[1] ? yNeta[1] : 0",
        (stan::model::rvalue(has_offset, "has_offset",
           stan::model::index_uni(1)) ? stan::model::rvalue(yNeta, "yNeta",
                                          stan::model::index_uni(1)) : 0));
      current_statement__ = 295;
      context__.validate_dims("data initialization", "y1_offset", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::model::rvalue(has_offset, "has_offset",
                                 stan::model::index_uni(1)) ? stan::model::rvalue(
                                                                yNeta,
                                                                "yNeta",
                                                                stan::model::index_uni(
                                                                  1)) : 0))});
      y1_offset_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::model::rvalue(
                                                                 has_offset,
                                                                 "has_offset",
                                                                 stan::model::index_uni(
                                                                   1)) ? 
                           stan::model::rvalue(yNeta, "yNeta",
                             stan::model::index_uni(1)) : 0),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y1_offset)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y1_offset_data__.data(),
        (stan::model::rvalue(has_offset, "has_offset",
           stan::model::index_uni(1)) ? stan::model::rvalue(yNeta, "yNeta",
                                          stan::model::index_uni(1)) : 0));
      {
        std::vector<local_scalar_t__> y1_offset_flat__;
        current_statement__ = 295;
        y1_offset_flat__ = context__.vals_r("y1_offset");
        current_statement__ = 295;
        pos__ = 1;
        current_statement__ = 295;
        for (int sym1__ = 1; sym1__ <=
             (stan::model::rvalue(has_offset, "has_offset",
                stan::model::index_uni(1)) ? stan::model::rvalue(yNeta,
                                               "yNeta",
                                               stan::model::index_uni(1)) : 0); ++sym1__) {
          current_statement__ = 295;
          stan::model::assign(y1_offset, y1_offset_flat__[(pos__ - 1)],
            "assigning variable y1_offset", stan::model::index_uni(sym1__));
          current_statement__ = 295;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 296;
      stan::math::validate_non_negative_index("y2_offset",
        "has_offset[2] ? yNeta[2] : 0",
        (stan::model::rvalue(has_offset, "has_offset",
           stan::model::index_uni(2)) ? stan::model::rvalue(yNeta, "yNeta",
                                          stan::model::index_uni(2)) : 0));
      current_statement__ = 297;
      context__.validate_dims("data initialization", "y2_offset", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::model::rvalue(has_offset, "has_offset",
                                 stan::model::index_uni(2)) ? stan::model::rvalue(
                                                                yNeta,
                                                                "yNeta",
                                                                stan::model::index_uni(
                                                                  2)) : 0))});
      y2_offset_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::model::rvalue(
                                                                 has_offset,
                                                                 "has_offset",
                                                                 stan::model::index_uni(
                                                                   2)) ? 
                           stan::model::rvalue(yNeta, "yNeta",
                             stan::model::index_uni(2)) : 0),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y2_offset)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y2_offset_data__.data(),
        (stan::model::rvalue(has_offset, "has_offset",
           stan::model::index_uni(2)) ? stan::model::rvalue(yNeta, "yNeta",
                                          stan::model::index_uni(2)) : 0));
      {
        std::vector<local_scalar_t__> y2_offset_flat__;
        current_statement__ = 297;
        y2_offset_flat__ = context__.vals_r("y2_offset");
        current_statement__ = 297;
        pos__ = 1;
        current_statement__ = 297;
        for (int sym1__ = 1; sym1__ <=
             (stan::model::rvalue(has_offset, "has_offset",
                stan::model::index_uni(2)) ? stan::model::rvalue(yNeta,
                                               "yNeta",
                                               stan::model::index_uni(2)) : 0); ++sym1__) {
          current_statement__ = 297;
          stan::model::assign(y2_offset, y2_offset_flat__[(pos__ - 1)],
            "assigning variable y2_offset", stan::model::index_uni(sym1__));
          current_statement__ = 297;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 298;
      stan::math::validate_non_negative_index("y3_offset",
        "has_offset[3] ? yNeta[3] : 0",
        (stan::model::rvalue(has_offset, "has_offset",
           stan::model::index_uni(3)) ? stan::model::rvalue(yNeta, "yNeta",
                                          stan::model::index_uni(3)) : 0));
      current_statement__ = 299;
      context__.validate_dims("data initialization", "y3_offset", "double",
        std::vector<size_t>{static_cast<size_t>(
                              (stan::model::rvalue(has_offset, "has_offset",
                                 stan::model::index_uni(3)) ? stan::model::rvalue(
                                                                yNeta,
                                                                "yNeta",
                                                                stan::model::index_uni(
                                                                  3)) : 0))});
      y3_offset_data__ = Eigen::Matrix<double,-1,1>::Constant((stan::model::rvalue(
                                                                 has_offset,
                                                                 "has_offset",
                                                                 stan::model::index_uni(
                                                                   3)) ? 
                           stan::model::rvalue(yNeta, "yNeta",
                             stan::model::index_uni(3)) : 0),
                           std::numeric_limits<double>::quiet_NaN());
      new (&y3_offset)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y3_offset_data__.data(),
        (stan::model::rvalue(has_offset, "has_offset",
           stan::model::index_uni(3)) ? stan::model::rvalue(yNeta, "yNeta",
                                          stan::model::index_uni(3)) : 0));
      {
        std::vector<local_scalar_t__> y3_offset_flat__;
        current_statement__ = 299;
        y3_offset_flat__ = context__.vals_r("y3_offset");
        current_statement__ = 299;
        pos__ = 1;
        current_statement__ = 299;
        for (int sym1__ = 1; sym1__ <=
             (stan::model::rvalue(has_offset, "has_offset",
                stan::model::index_uni(3)) ? stan::model::rvalue(yNeta,
                                               "yNeta",
                                               stan::model::index_uni(3)) : 0); ++sym1__) {
          current_statement__ = 299;
          stan::model::assign(y3_offset, y3_offset_flat__[(pos__ - 1)],
            "assigning variable y3_offset", stan::model::index_uni(sym1__));
          current_statement__ = 299;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 300;
      stan::math::validate_non_negative_index("y_prior_mean1", "yK[1]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      current_statement__ = 301;
      context__.validate_dims("data initialization", "y_prior_mean1",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(1)))});
      y_prior_mean1_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                    yK, "yK",
                                                                    stan::model::index_uni(
                                                                    1)),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_mean1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_mean1_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      {
        std::vector<local_scalar_t__> y_prior_mean1_flat__;
        current_statement__ = 301;
        y_prior_mean1_flat__ = context__.vals_r("y_prior_mean1");
        current_statement__ = 301;
        pos__ = 1;
        current_statement__ = 301;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(1)); ++sym1__) {
          current_statement__ = 301;
          stan::model::assign(y_prior_mean1, y_prior_mean1_flat__[(pos__ -
            1)], "assigning variable y_prior_mean1",
            stan::model::index_uni(sym1__));
          current_statement__ = 301;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 302;
      stan::math::validate_non_negative_index("y_prior_mean2", "yK[2]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      current_statement__ = 303;
      context__.validate_dims("data initialization", "y_prior_mean2",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(2)))});
      y_prior_mean2_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                    yK, "yK",
                                                                    stan::model::index_uni(
                                                                    2)),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_mean2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_mean2_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      {
        std::vector<local_scalar_t__> y_prior_mean2_flat__;
        current_statement__ = 303;
        y_prior_mean2_flat__ = context__.vals_r("y_prior_mean2");
        current_statement__ = 303;
        pos__ = 1;
        current_statement__ = 303;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(2)); ++sym1__) {
          current_statement__ = 303;
          stan::model::assign(y_prior_mean2, y_prior_mean2_flat__[(pos__ -
            1)], "assigning variable y_prior_mean2",
            stan::model::index_uni(sym1__));
          current_statement__ = 303;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 304;
      stan::math::validate_non_negative_index("y_prior_mean3", "yK[3]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      current_statement__ = 305;
      context__.validate_dims("data initialization", "y_prior_mean3",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(3)))});
      y_prior_mean3_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                    yK, "yK",
                                                                    stan::model::index_uni(
                                                                    3)),
                               std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_mean3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_mean3_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      {
        std::vector<local_scalar_t__> y_prior_mean3_flat__;
        current_statement__ = 305;
        y_prior_mean3_flat__ = context__.vals_r("y_prior_mean3");
        current_statement__ = 305;
        pos__ = 1;
        current_statement__ = 305;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(3)); ++sym1__) {
          current_statement__ = 305;
          stan::model::assign(y_prior_mean3, y_prior_mean3_flat__[(pos__ -
            1)], "assigning variable y_prior_mean3",
            stan::model::index_uni(sym1__));
          current_statement__ = 305;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 306;
      stan::math::validate_non_negative_index("y_prior_scale1", "yK[1]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      current_statement__ = 307;
      context__.validate_dims("data initialization", "y_prior_scale1",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(1)))});
      y_prior_scale1_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                    yK, "yK",
                                                                    stan::model::index_uni(
                                                                    1)),
                                std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_scale1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_scale1_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      {
        std::vector<local_scalar_t__> y_prior_scale1_flat__;
        current_statement__ = 307;
        y_prior_scale1_flat__ = context__.vals_r("y_prior_scale1");
        current_statement__ = 307;
        pos__ = 1;
        current_statement__ = 307;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(1)); ++sym1__) {
          current_statement__ = 307;
          stan::model::assign(y_prior_scale1, y_prior_scale1_flat__[(pos__ -
            1)], "assigning variable y_prior_scale1",
            stan::model::index_uni(sym1__));
          current_statement__ = 307;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 307;
      stan::math::check_greater_or_equal(function__, "y_prior_scale1",
        y_prior_scale1, 0);
      current_statement__ = 308;
      stan::math::validate_non_negative_index("y_prior_scale2", "yK[2]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      current_statement__ = 309;
      context__.validate_dims("data initialization", "y_prior_scale2",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(2)))});
      y_prior_scale2_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                    yK, "yK",
                                                                    stan::model::index_uni(
                                                                    2)),
                                std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_scale2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_scale2_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      {
        std::vector<local_scalar_t__> y_prior_scale2_flat__;
        current_statement__ = 309;
        y_prior_scale2_flat__ = context__.vals_r("y_prior_scale2");
        current_statement__ = 309;
        pos__ = 1;
        current_statement__ = 309;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(2)); ++sym1__) {
          current_statement__ = 309;
          stan::model::assign(y_prior_scale2, y_prior_scale2_flat__[(pos__ -
            1)], "assigning variable y_prior_scale2",
            stan::model::index_uni(sym1__));
          current_statement__ = 309;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 309;
      stan::math::check_greater_or_equal(function__, "y_prior_scale2",
        y_prior_scale2, 0);
      current_statement__ = 310;
      stan::math::validate_non_negative_index("y_prior_scale3", "yK[3]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      current_statement__ = 311;
      context__.validate_dims("data initialization", "y_prior_scale3",
        "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(3)))});
      y_prior_scale3_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                    yK, "yK",
                                                                    stan::model::index_uni(
                                                                    3)),
                                std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_scale3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_scale3_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      {
        std::vector<local_scalar_t__> y_prior_scale3_flat__;
        current_statement__ = 311;
        y_prior_scale3_flat__ = context__.vals_r("y_prior_scale3");
        current_statement__ = 311;
        pos__ = 1;
        current_statement__ = 311;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(3)); ++sym1__) {
          current_statement__ = 311;
          stan::model::assign(y_prior_scale3, y_prior_scale3_flat__[(pos__ -
            1)], "assigning variable y_prior_scale3",
            stan::model::index_uni(sym1__));
          current_statement__ = 311;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 311;
      stan::math::check_greater_or_equal(function__, "y_prior_scale3",
        y_prior_scale3, 0);
      current_statement__ = 312;
      stan::math::validate_non_negative_index("y_prior_df1", "yK[1]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      current_statement__ = 313;
      context__.validate_dims("data initialization", "y_prior_df1", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(1)))});
      y_prior_df1_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                  yK, "yK",
                                                                  stan::model::index_uni(
                                                                    1)),
                             std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_df1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_df1_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(1)));
      {
        std::vector<local_scalar_t__> y_prior_df1_flat__;
        current_statement__ = 313;
        y_prior_df1_flat__ = context__.vals_r("y_prior_df1");
        current_statement__ = 313;
        pos__ = 1;
        current_statement__ = 313;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(1)); ++sym1__) {
          current_statement__ = 313;
          stan::model::assign(y_prior_df1, y_prior_df1_flat__[(pos__ - 1)],
            "assigning variable y_prior_df1", stan::model::index_uni(sym1__));
          current_statement__ = 313;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 313;
      stan::math::check_greater_or_equal(function__, "y_prior_df1",
        y_prior_df1, 0);
      current_statement__ = 314;
      stan::math::validate_non_negative_index("y_prior_df2", "yK[2]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      current_statement__ = 315;
      context__.validate_dims("data initialization", "y_prior_df2", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(2)))});
      y_prior_df2_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                  yK, "yK",
                                                                  stan::model::index_uni(
                                                                    2)),
                             std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_df2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_df2_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(2)));
      {
        std::vector<local_scalar_t__> y_prior_df2_flat__;
        current_statement__ = 315;
        y_prior_df2_flat__ = context__.vals_r("y_prior_df2");
        current_statement__ = 315;
        pos__ = 1;
        current_statement__ = 315;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(2)); ++sym1__) {
          current_statement__ = 315;
          stan::model::assign(y_prior_df2, y_prior_df2_flat__[(pos__ - 1)],
            "assigning variable y_prior_df2", stan::model::index_uni(sym1__));
          current_statement__ = 315;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 315;
      stan::math::check_greater_or_equal(function__, "y_prior_df2",
        y_prior_df2, 0);
      current_statement__ = 316;
      stan::math::validate_non_negative_index("y_prior_df3", "yK[3]",
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      current_statement__ = 317;
      context__.validate_dims("data initialization", "y_prior_df3", "double",
        std::vector<size_t>{static_cast<size_t>(
                              stan::model::rvalue(yK, "yK",
                                stan::model::index_uni(3)))});
      y_prior_df3_data__ = Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(
                                                                  yK, "yK",
                                                                  stan::model::index_uni(
                                                                    3)),
                             std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_df3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_df3_data__.data(),
        stan::model::rvalue(yK, "yK", stan::model::index_uni(3)));
      {
        std::vector<local_scalar_t__> y_prior_df3_flat__;
        current_statement__ = 317;
        y_prior_df3_flat__ = context__.vals_r("y_prior_df3");
        current_statement__ = 317;
        pos__ = 1;
        current_statement__ = 317;
        for (int sym1__ = 1; sym1__ <=
             stan::model::rvalue(yK, "yK", stan::model::index_uni(3)); ++sym1__) {
          current_statement__ = 317;
          stan::model::assign(y_prior_df3, y_prior_df3_flat__[(pos__ - 1)],
            "assigning variable y_prior_df3", stan::model::index_uni(sym1__));
          current_statement__ = 317;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 317;
      stan::math::check_greater_or_equal(function__, "y_prior_df3",
        y_prior_df3, 0);
      current_statement__ = 318;
      stan::math::validate_non_negative_index("y_global_prior_df", "M", M);
      current_statement__ = 319;
      context__.validate_dims("data initialization", "y_global_prior_df",
        "double", std::vector<size_t>{static_cast<size_t>(M)});
      y_global_prior_df_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                   std::numeric_limits<double>::quiet_NaN());
      new (&y_global_prior_df)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_global_prior_df_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_global_prior_df_flat__;
        current_statement__ = 319;
        y_global_prior_df_flat__ = context__.vals_r("y_global_prior_df");
        current_statement__ = 319;
        pos__ = 1;
        current_statement__ = 319;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 319;
          stan::model::assign(y_global_prior_df,
            y_global_prior_df_flat__[(pos__ - 1)],
            "assigning variable y_global_prior_df",
            stan::model::index_uni(sym1__));
          current_statement__ = 319;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 319;
      stan::math::check_greater_or_equal(function__, "y_global_prior_df",
        y_global_prior_df, 0);
      current_statement__ = 320;
      stan::math::validate_non_negative_index("y_global_prior_scale", "M", M);
      current_statement__ = 321;
      context__.validate_dims("data initialization", "y_global_prior_scale",
        "double", std::vector<size_t>{static_cast<size_t>(M)});
      y_global_prior_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                      std::numeric_limits<double>::quiet_NaN());
      new (&y_global_prior_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_global_prior_scale_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_global_prior_scale_flat__;
        current_statement__ = 321;
        y_global_prior_scale_flat__ = context__.vals_r("y_global_prior_scale");
        current_statement__ = 321;
        pos__ = 1;
        current_statement__ = 321;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 321;
          stan::model::assign(y_global_prior_scale,
            y_global_prior_scale_flat__[(pos__ - 1)],
            "assigning variable y_global_prior_scale",
            stan::model::index_uni(sym1__));
          current_statement__ = 321;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 321;
      stan::math::check_greater_or_equal(function__, "y_global_prior_scale",
        y_global_prior_scale, 0);
      current_statement__ = 322;
      stan::math::validate_non_negative_index("y_slab_df", "M", M);
      current_statement__ = 323;
      context__.validate_dims("data initialization", "y_slab_df", "double",
        std::vector<size_t>{static_cast<size_t>(M)});
      y_slab_df_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                           std::numeric_limits<double>::quiet_NaN());
      new (&y_slab_df)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_slab_df_data__.data(), M);
      {
        std::vector<local_scalar_t__> y_slab_df_flat__;
        current_statement__ = 323;
        y_slab_df_flat__ = context__.vals_r("y_slab_df");
        current_statement__ = 323;
        pos__ = 1;
        current_statement__ = 323;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 323;
          stan::model::assign(y_slab_df, y_slab_df_flat__[(pos__ - 1)],
            "assigning variable y_slab_df", stan::model::index_uni(sym1__));
          current_statement__ = 323;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 323;
      stan::math::check_greater_or_equal(function__, "y_slab_df", y_slab_df,
        0);
      current_statement__ = 324;
      stan::math::validate_non_negative_index("y_slab_scale", "M", M);
      current_statement__ = 325;
      context__.validate_dims("data initialization", "y_slab_scale",
        "double", std::vector<size_t>{static_cast<size_t>(M)});
      y_slab_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                              std::numeric_limits<double>::quiet_NaN());
      new (&y_slab_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_slab_scale_data__.data(), M);
      {
        std::vector<local_scalar_t__> y_slab_scale_flat__;
        current_statement__ = 325;
        y_slab_scale_flat__ = context__.vals_r("y_slab_scale");
        current_statement__ = 325;
        pos__ = 1;
        current_statement__ = 325;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 325;
          stan::model::assign(y_slab_scale, y_slab_scale_flat__[(pos__ - 1)],
            "assigning variable y_slab_scale", stan::model::index_uni(sym1__));
          current_statement__ = 325;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 325;
      stan::math::check_greater_or_equal(function__, "y_slab_scale",
        y_slab_scale, 0);
      current_statement__ = 326;
      stan::math::validate_non_negative_index("y_prior_mean_for_intercept",
        "M", M);
      current_statement__ = 327;
      context__.validate_dims("data initialization",
        "y_prior_mean_for_intercept", "double",
        std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_mean_for_intercept_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                            std::numeric_limits<double>::quiet_NaN(
                                              ));
      new (&y_prior_mean_for_intercept)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_mean_for_intercept_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_prior_mean_for_intercept_flat__;
        current_statement__ = 327;
        y_prior_mean_for_intercept_flat__ = context__.vals_r("y_prior_mean_for_intercept");
        current_statement__ = 327;
        pos__ = 1;
        current_statement__ = 327;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 327;
          stan::model::assign(y_prior_mean_for_intercept,
            y_prior_mean_for_intercept_flat__[(pos__ - 1)],
            "assigning variable y_prior_mean_for_intercept",
            stan::model::index_uni(sym1__));
          current_statement__ = 327;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 328;
      stan::math::validate_non_negative_index("y_prior_scale_for_intercept",
        "M", M);
      current_statement__ = 329;
      context__.validate_dims("data initialization",
        "y_prior_scale_for_intercept", "double",
        std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_scale_for_intercept_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                             std::numeric_limits<double>::quiet_NaN(
                                               ));
      new (&y_prior_scale_for_intercept)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_scale_for_intercept_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_prior_scale_for_intercept_flat__;
        current_statement__ = 329;
        y_prior_scale_for_intercept_flat__ = context__.vals_r("y_prior_scale_for_intercept");
        current_statement__ = 329;
        pos__ = 1;
        current_statement__ = 329;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 329;
          stan::model::assign(y_prior_scale_for_intercept,
            y_prior_scale_for_intercept_flat__[(pos__ - 1)],
            "assigning variable y_prior_scale_for_intercept",
            stan::model::index_uni(sym1__));
          current_statement__ = 329;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 329;
      stan::math::check_greater_or_equal(function__,
        "y_prior_scale_for_intercept", y_prior_scale_for_intercept, 0);
      current_statement__ = 330;
      stan::math::validate_non_negative_index("y_prior_df_for_intercept",
        "M", M);
      current_statement__ = 331;
      context__.validate_dims("data initialization",
        "y_prior_df_for_intercept", "double",
        std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_df_for_intercept_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                          std::numeric_limits<double>::quiet_NaN(
                                            ));
      new (&y_prior_df_for_intercept)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_df_for_intercept_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_prior_df_for_intercept_flat__;
        current_statement__ = 331;
        y_prior_df_for_intercept_flat__ = context__.vals_r("y_prior_df_for_intercept");
        current_statement__ = 331;
        pos__ = 1;
        current_statement__ = 331;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 331;
          stan::model::assign(y_prior_df_for_intercept,
            y_prior_df_for_intercept_flat__[(pos__ - 1)],
            "assigning variable y_prior_df_for_intercept",
            stan::model::index_uni(sym1__));
          current_statement__ = 331;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 331;
      stan::math::check_greater_or_equal(function__,
        "y_prior_df_for_intercept", y_prior_df_for_intercept, 0);
      current_statement__ = 332;
      stan::math::validate_non_negative_index("y_prior_mean_for_aux", "M", M);
      current_statement__ = 333;
      context__.validate_dims("data initialization", "y_prior_mean_for_aux",
        "double", std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_mean_for_aux_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                      std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_mean_for_aux)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_mean_for_aux_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_prior_mean_for_aux_flat__;
        current_statement__ = 333;
        y_prior_mean_for_aux_flat__ = context__.vals_r("y_prior_mean_for_aux");
        current_statement__ = 333;
        pos__ = 1;
        current_statement__ = 333;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 333;
          stan::model::assign(y_prior_mean_for_aux,
            y_prior_mean_for_aux_flat__[(pos__ - 1)],
            "assigning variable y_prior_mean_for_aux",
            stan::model::index_uni(sym1__));
          current_statement__ = 333;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 333;
      stan::math::check_greater_or_equal(function__, "y_prior_mean_for_aux",
        y_prior_mean_for_aux, 0);
      current_statement__ = 334;
      stan::math::validate_non_negative_index("y_prior_scale_for_aux", "M", M);
      current_statement__ = 335;
      context__.validate_dims("data initialization", "y_prior_scale_for_aux",
        "double", std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_scale_for_aux_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                       std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_scale_for_aux)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_scale_for_aux_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_prior_scale_for_aux_flat__;
        current_statement__ = 335;
        y_prior_scale_for_aux_flat__ = context__.vals_r("y_prior_scale_for_aux");
        current_statement__ = 335;
        pos__ = 1;
        current_statement__ = 335;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 335;
          stan::model::assign(y_prior_scale_for_aux,
            y_prior_scale_for_aux_flat__[(pos__ - 1)],
            "assigning variable y_prior_scale_for_aux",
            stan::model::index_uni(sym1__));
          current_statement__ = 335;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 335;
      stan::math::check_greater_or_equal(function__, "y_prior_scale_for_aux",
        y_prior_scale_for_aux, 0);
      current_statement__ = 336;
      stan::math::validate_non_negative_index("y_prior_df_for_aux", "M", M);
      current_statement__ = 337;
      context__.validate_dims("data initialization", "y_prior_df_for_aux",
        "double", std::vector<size_t>{static_cast<size_t>(M)});
      y_prior_df_for_aux_data__ = Eigen::Matrix<double,-1,1>::Constant(M,
                                    std::numeric_limits<double>::quiet_NaN());
      new (&y_prior_df_for_aux)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(y_prior_df_for_aux_data__.data(),
        M);
      {
        std::vector<local_scalar_t__> y_prior_df_for_aux_flat__;
        current_statement__ = 337;
        y_prior_df_for_aux_flat__ = context__.vals_r("y_prior_df_for_aux");
        current_statement__ = 337;
        pos__ = 1;
        current_statement__ = 337;
        for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
          current_statement__ = 337;
          stan::model::assign(y_prior_df_for_aux,
            y_prior_df_for_aux_flat__[(pos__ - 1)],
            "assigning variable y_prior_df_for_aux",
            stan::model::index_uni(sym1__));
          current_statement__ = 337;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 337;
      stan::math::check_greater_or_equal(function__, "y_prior_df_for_aux",
        y_prior_df_for_aux, 0);
      current_statement__ = 338;
      context__.validate_dims("data initialization", "len_concentration",
        "int", std::vector<size_t>{});
      len_concentration = std::numeric_limits<int>::min();
      current_statement__ = 338;
      len_concentration = context__.vals_i("len_concentration")[(1 - 1)];
      current_statement__ = 338;
      stan::math::check_greater_or_equal(function__, "len_concentration",
        len_concentration, 0);
      current_statement__ = 339;
      context__.validate_dims("data initialization", "len_regularization",
        "int", std::vector<size_t>{});
      len_regularization = std::numeric_limits<int>::min();
      current_statement__ = 339;
      len_regularization = context__.vals_i("len_regularization")[(1 - 1)];
      current_statement__ = 339;
      stan::math::check_greater_or_equal(function__, "len_regularization",
        len_regularization, 0);
      current_statement__ = 340;
      stan::math::validate_non_negative_index("b_prior_shape", "t", t);
      current_statement__ = 341;
      context__.validate_dims("data initialization", "b_prior_shape",
        "double", std::vector<size_t>{static_cast<size_t>(t)});
      b_prior_shape_data__ = Eigen::Matrix<double,-1,1>::Constant(t,
                               std::numeric_limits<double>::quiet_NaN());
      new (&b_prior_shape)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(b_prior_shape_data__.data(),
        t);
      {
        std::vector<local_scalar_t__> b_prior_shape_flat__;
        current_statement__ = 341;
        b_prior_shape_flat__ = context__.vals_r("b_prior_shape");
        current_statement__ = 341;
        pos__ = 1;
        current_statement__ = 341;
        for (int sym1__ = 1; sym1__ <= t; ++sym1__) {
          current_statement__ = 341;
          stan::model::assign(b_prior_shape, b_prior_shape_flat__[(pos__ -
            1)], "assigning variable b_prior_shape",
            stan::model::index_uni(sym1__));
          current_statement__ = 341;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 341;
      stan::math::check_greater_or_equal(function__, "b_prior_shape",
        b_prior_shape, 0);
      current_statement__ = 342;
      stan::math::validate_non_negative_index("b_prior_scale", "t", t);
      current_statement__ = 343;
      context__.validate_dims("data initialization", "b_prior_scale",
        "double", std::vector<size_t>{static_cast<size_t>(t)});
      b_prior_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(t,
                               std::numeric_limits<double>::quiet_NaN());
      new (&b_prior_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(b_prior_scale_data__.data(),
        t);
      {
        std::vector<local_scalar_t__> b_prior_scale_flat__;
        current_statement__ = 343;
        b_prior_scale_flat__ = context__.vals_r("b_prior_scale");
        current_statement__ = 343;
        pos__ = 1;
        current_statement__ = 343;
        for (int sym1__ = 1; sym1__ <= t; ++sym1__) {
          current_statement__ = 343;
          stan::model::assign(b_prior_scale, b_prior_scale_flat__[(pos__ -
            1)], "assigning variable b_prior_scale",
            stan::model::index_uni(sym1__));
          current_statement__ = 343;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 343;
      stan::math::check_greater_or_equal(function__, "b_prior_scale",
        b_prior_scale, 0);
      current_statement__ = 344;
      stan::math::validate_non_negative_index("b_prior_concentration",
        "len_concentration", len_concentration);
      current_statement__ = 345;
      context__.validate_dims("data initialization", "b_prior_concentration",
        "double",
        std::vector<size_t>{static_cast<size_t>(len_concentration)});
      b_prior_concentration = std::vector<double>(len_concentration,
                                std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 345;
      b_prior_concentration = context__.vals_r("b_prior_concentration");
      current_statement__ = 345;
      stan::math::check_greater_or_equal(function__, "b_prior_concentration",
        b_prior_concentration, 0);
      current_statement__ = 346;
      stan::math::validate_non_negative_index("b_prior_regularization",
        "len_regularization", len_regularization);
      current_statement__ = 347;
      context__.validate_dims("data initialization",
        "b_prior_regularization", "double",
        std::vector<size_t>{static_cast<size_t>(len_regularization)});
      b_prior_regularization = std::vector<double>(len_regularization,
                                 std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 347;
      b_prior_regularization = context__.vals_r("b_prior_regularization");
      current_statement__ = 347;
      stan::math::check_greater_or_equal(function__,
        "b_prior_regularization", b_prior_regularization, 0);
      current_statement__ = 348;
      stan::math::validate_non_negative_index("b1_prior_scale", "bK1", bK1);
      current_statement__ = 349;
      context__.validate_dims("data initialization", "b1_prior_scale",
        "double", std::vector<size_t>{static_cast<size_t>(bK1)});
      b1_prior_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(bK1,
                                std::numeric_limits<double>::quiet_NaN());
      new (&b1_prior_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(b1_prior_scale_data__.data(),
        bK1);
      {
        std::vector<local_scalar_t__> b1_prior_scale_flat__;
        current_statement__ = 349;
        b1_prior_scale_flat__ = context__.vals_r("b1_prior_scale");
        current_statement__ = 349;
        pos__ = 1;
        current_statement__ = 349;
        for (int sym1__ = 1; sym1__ <= bK1; ++sym1__) {
          current_statement__ = 349;
          stan::model::assign(b1_prior_scale, b1_prior_scale_flat__[(pos__ -
            1)], "assigning variable b1_prior_scale",
            stan::model::index_uni(sym1__));
          current_statement__ = 349;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 349;
      stan::math::check_greater_or_equal(function__, "b1_prior_scale",
        b1_prior_scale, 0);
      current_statement__ = 350;
      stan::math::validate_non_negative_index("b2_prior_scale", "bK2", bK2);
      current_statement__ = 351;
      context__.validate_dims("data initialization", "b2_prior_scale",
        "double", std::vector<size_t>{static_cast<size_t>(bK2)});
      b2_prior_scale_data__ = Eigen::Matrix<double,-1,1>::Constant(bK2,
                                std::numeric_limits<double>::quiet_NaN());
      new (&b2_prior_scale)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(b2_prior_scale_data__.data(),
        bK2);
      {
        std::vector<local_scalar_t__> b2_prior_scale_flat__;
        current_statement__ = 351;
        b2_prior_scale_flat__ = context__.vals_r("b2_prior_scale");
        current_statement__ = 351;
        pos__ = 1;
        current_statement__ = 351;
        for (int sym1__ = 1; sym1__ <= bK2; ++sym1__) {
          current_statement__ = 351;
          stan::model::assign(b2_prior_scale, b2_prior_scale_flat__[(pos__ -
            1)], "assigning variable b2_prior_scale",
            stan::model::index_uni(sym1__));
          current_statement__ = 351;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 351;
      stan::math::check_greater_or_equal(function__, "b2_prior_scale",
        b2_prior_scale, 0);
      current_statement__ = 352;
      stan::math::validate_non_negative_index("b1_prior_df", "bK1", bK1);
      current_statement__ = 353;
      context__.validate_dims("data initialization", "b1_prior_df", "double",
        std::vector<size_t>{static_cast<size_t>(bK1)});
      b1_prior_df_data__ = Eigen::Matrix<double,-1,1>::Constant(bK1,
                             std::numeric_limits<double>::quiet_NaN());
      new (&b1_prior_df)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(b1_prior_df_data__.data(),
        bK1);
      {
        std::vector<local_scalar_t__> b1_prior_df_flat__;
        current_statement__ = 353;
        b1_prior_df_flat__ = context__.vals_r("b1_prior_df");
        current_statement__ = 353;
        pos__ = 1;
        current_statement__ = 353;
        for (int sym1__ = 1; sym1__ <= bK1; ++sym1__) {
          current_statement__ = 353;
          stan::model::assign(b1_prior_df, b1_prior_df_flat__[(pos__ - 1)],
            "assigning variable b1_prior_df", stan::model::index_uni(sym1__));
          current_statement__ = 353;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 353;
      stan::math::check_greater_or_equal(function__, "b1_prior_df",
        b1_prior_df, 0);
      current_statement__ = 354;
      stan::math::validate_non_negative_index("b2_prior_df", "bK2", bK2);
      current_statement__ = 355;
      context__.validate_dims("data initialization", "b2_prior_df", "double",
        std::vector<size_t>{static_cast<size_t>(bK2)});
      b2_prior_df_data__ = Eigen::Matrix<double,-1,1>::Constant(bK2,
                             std::numeric_limits<double>::quiet_NaN());
      new (&b2_prior_df)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(b2_prior_df_data__.data(),
        bK2);
      {
        std::vector<local_scalar_t__> b2_prior_df_flat__;
        current_statement__ = 355;
        b2_prior_df_flat__ = context__.vals_r("b2_prior_df");
        current_statement__ = 355;
        pos__ = 1;
        current_statement__ = 355;
        for (int sym1__ = 1; sym1__ <= bK2; ++sym1__) {
          current_statement__ = 355;
          stan::model::assign(b2_prior_df, b2_prior_df_flat__[(pos__ - 1)],
            "assigning variable b2_prior_df", stan::model::index_uni(sym1__));
          current_statement__ = 355;
          pos__ = (pos__ + 1);
        }
      }
      current_statement__ = 355;
      stan::math::check_greater_or_equal(function__, "b2_prior_df",
        b2_prior_df, 0);
      current_statement__ = 356;
      context__.validate_dims("data initialization",
        "b1_prior_regularization", "double", std::vector<size_t>{});
      b1_prior_regularization = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 356;
      b1_prior_regularization = context__.vals_r("b1_prior_regularization")[(1
        - 1)];
      current_statement__ = 356;
      stan::math::check_greater_or_equal(function__,
        "b1_prior_regularization", b1_prior_regularization, 0);
      current_statement__ = 357;
      context__.validate_dims("data initialization",
        "b2_prior_regularization", "double", std::vector<size_t>{});
      b2_prior_regularization = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 357;
      b2_prior_regularization = context__.vals_r("b2_prior_regularization")[(1
        - 1)];
      current_statement__ = 357;
      stan::math::check_greater_or_equal(function__,
        "b2_prior_regularization", b2_prior_regularization, 0);
      current_statement__ = 358;
      yHs1 = std::numeric_limits<int>::min();
      current_statement__ = 358;
      yHs1 = get_nvars_for_hs(
               (stan::math::logical_gt(M, 0) ? stan::model::rvalue(
                                                 y_prior_dist,
                                                 "y_prior_dist",
                                                 stan::model::index_uni(1)) : 0),
               pstream__);
      current_statement__ = 359;
      yHs2 = std::numeric_limits<int>::min();
      current_statement__ = 359;
      yHs2 = get_nvars_for_hs(
               (stan::math::logical_gt(M, 1) ? stan::model::rvalue(
                                                 y_prior_dist,
                                                 "y_prior_dist",
                                                 stan::model::index_uni(2)) : 0),
               pstream__);
      current_statement__ = 360;
      yHs3 = std::numeric_limits<int>::min();
      current_statement__ = 360;
      yHs3 = get_nvars_for_hs(
               (stan::math::logical_gt(M, 2) ? stan::model::rvalue(
                                                 y_prior_dist,
                                                 "y_prior_dist",
                                                 stan::model::index_uni(3)) : 0),
               pstream__);
      current_statement__ = 361;
      len_z_T = std::numeric_limits<int>::min();
      current_statement__ = 361;
      len_z_T = 0;
      current_statement__ = 362;
      len_var_group = std::numeric_limits<int>::min();
      current_statement__ = 362;
      len_var_group = (stan::math::sum(p) * stan::math::logical_gt(t, 0));
      current_statement__ = 363;
      len_rho = std::numeric_limits<int>::min();
      current_statement__ = 363;
      len_rho = (stan::math::sum(p) - t);
      current_statement__ = 364;
      pos = std::numeric_limits<int>::min();
      current_statement__ = 364;
      pos = 1;
      current_statement__ = 365;
      stan::math::validate_non_negative_index("delta", "len_concentration",
        len_concentration);
      current_statement__ = 366;
      delta = std::vector<double>(len_concentration,
                std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 367;
      stan::math::validate_non_negative_index("bCov1_idx",
        "prior_dist_for_cov == 2 ? (bK1 + choose(bK1, 2)) : 0",
        (stan::math::logical_eq(prior_dist_for_cov, 2) ? (bK1 +
        stan::math::choose(bK1, 2)) : 0));
      current_statement__ = 368;
      bCov1_idx = std::vector<int>((stan::math::logical_eq(
                                      prior_dist_for_cov, 2) ? (bK1 +
                    stan::math::choose(bK1, 2)) : 0),
                    std::numeric_limits<int>::min());
      current_statement__ = 369;
      stan::math::validate_non_negative_index("bCov2_idx",
        "prior_dist_for_cov == 2 ? (bK2 + choose(bK2, 2)) : 0",
        (stan::math::logical_eq(prior_dist_for_cov, 2) ? (bK2 +
        stan::math::choose(bK2, 2)) : 0));
      current_statement__ = 370;
      bCov2_idx = std::vector<int>((stan::math::logical_eq(
                                      prior_dist_for_cov, 2) ? (bK2 +
                    stan::math::choose(bK2, 2)) : 0),
                    std::numeric_limits<int>::min());
      current_statement__ = 371;
      sum_log_y1 = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 371;
      sum_log_y1 = ((stan::math::primitive_value(stan::math::logical_gt(M, 0))
        &&
        stan::math::primitive_value(
          (stan::math::primitive_value(
             stan::math::logical_eq(
               stan::model::rvalue(family, "family",
                 stan::model::index_uni(1)), 2)) ||
          stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(family, "family", stan::model::index_uni(1)),
              3))))) ? stan::math::sum(stan::math::log(yReal1)) : stan::math::not_a_number(
                                                                    ));
      current_statement__ = 372;
      sum_log_y2 = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 372;
      sum_log_y2 = ((stan::math::primitive_value(stan::math::logical_gt(M, 1))
        &&
        stan::math::primitive_value(
          (stan::math::primitive_value(
             stan::math::logical_eq(
               stan::model::rvalue(family, "family",
                 stan::model::index_uni(2)), 2)) ||
          stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(family, "family", stan::model::index_uni(2)),
              3))))) ? stan::math::sum(stan::math::log(yReal2)) : stan::math::not_a_number(
                                                                    ));
      current_statement__ = 373;
      sum_log_y3 = std::numeric_limits<double>::quiet_NaN();
      current_statement__ = 373;
      sum_log_y3 = ((stan::math::primitive_value(stan::math::logical_gt(M, 2))
        &&
        stan::math::primitive_value(
          (stan::math::primitive_value(
             stan::math::logical_eq(
               stan::model::rvalue(family, "family",
                 stan::model::index_uni(3)), 2)) ||
          stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(family, "family", stan::model::index_uni(3)),
              3))))) ? stan::math::sum(stan::math::log(yReal3)) : stan::math::not_a_number(
                                                                    ));
      current_statement__ = 374;
      stan::math::validate_non_negative_index("sqrt_y1",
        "M > 0 && family[1] == 3 ? yNobs[1] : 0",
        ((stan::math::primitive_value(stan::math::logical_gt(M, 0)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(1)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 375;
      sqrt_y1_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                stan::math::logical_gt(
                                                                  M, 0)) &&
                         stan::math::primitive_value(
                           stan::math::logical_eq(
                             stan::model::rvalue(family, "family",
                               stan::model::index_uni(1)), 3))) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    1)) : 0),
                         std::numeric_limits<double>::quiet_NaN());
      new (&sqrt_y1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(sqrt_y1_data__.data(),
        ((stan::math::primitive_value(stan::math::logical_gt(M, 0)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(1)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 376;
      stan::math::validate_non_negative_index("sqrt_y2",
        "M > 1 && family[2] == 3 ? yNobs[2] : 0",
        ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(2)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 377;
      sqrt_y2_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                stan::math::logical_gt(
                                                                  M, 1)) &&
                         stan::math::primitive_value(
                           stan::math::logical_eq(
                             stan::model::rvalue(family, "family",
                               stan::model::index_uni(2)), 3))) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    2)) : 0),
                         std::numeric_limits<double>::quiet_NaN());
      new (&sqrt_y2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(sqrt_y2_data__.data(),
        ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(2)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 378;
      stan::math::validate_non_negative_index("sqrt_y3",
        "M > 2 && family[3] == 3 ? yNobs[3] : 0",
        ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(3)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 379;
      sqrt_y3_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                                stan::math::logical_gt(
                                                                  M, 2)) &&
                         stan::math::primitive_value(
                           stan::math::logical_eq(
                             stan::model::rvalue(family, "family",
                               stan::model::index_uni(3)), 3))) ? stan::model::rvalue(
                                                                    yNobs,
                                                                    "yNobs",
                                                                    stan::model::index_uni(
                                                                    3)) : 0),
                         std::numeric_limits<double>::quiet_NaN());
      new (&sqrt_y3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(sqrt_y3_data__.data(),
        ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(3)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 380;
      stan::math::validate_non_negative_index("log_y1",
        "M > 0 && family[1] == 3 ? yNobs[1] : 0",
        ((stan::math::primitive_value(stan::math::logical_gt(M, 0)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(1)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 381;
      log_y1_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                               stan::math::logical_gt(
                                                                 M, 0)) &&
                        stan::math::primitive_value(
                          stan::math::logical_eq(
                            stan::model::rvalue(family, "family",
                              stan::model::index_uni(1)), 3))) ? stan::model::rvalue(
                                                                   yNobs,
                                                                   "yNobs",
                                                                   stan::model::index_uni(
                                                                    1)) : 0),
                        std::numeric_limits<double>::quiet_NaN());
      new (&log_y1)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(log_y1_data__.data(),
        ((stan::math::primitive_value(stan::math::logical_gt(M, 0)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(1)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(1)) : 0));
      current_statement__ = 382;
      stan::math::validate_non_negative_index("log_y2",
        "M > 1 && family[2] == 3 ? yNobs[2] : 0",
        ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(2)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 383;
      log_y2_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                               stan::math::logical_gt(
                                                                 M, 1)) &&
                        stan::math::primitive_value(
                          stan::math::logical_eq(
                            stan::model::rvalue(family, "family",
                              stan::model::index_uni(2)), 3))) ? stan::model::rvalue(
                                                                   yNobs,
                                                                   "yNobs",
                                                                   stan::model::index_uni(
                                                                    2)) : 0),
                        std::numeric_limits<double>::quiet_NaN());
      new (&log_y2)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(log_y2_data__.data(),
        ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(2)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(2)) : 0));
      current_statement__ = 384;
      stan::math::validate_non_negative_index("log_y3",
        "M > 2 && family[3] == 3 ? yNobs[3] : 0",
        ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(3)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 385;
      log_y3_data__ = Eigen::Matrix<double,-1,1>::Constant(((stan::math::primitive_value(
                                                               stan::math::logical_gt(
                                                                 M, 2)) &&
                        stan::math::primitive_value(
                          stan::math::logical_eq(
                            stan::model::rvalue(family, "family",
                              stan::model::index_uni(3)), 3))) ? stan::model::rvalue(
                                                                   yNobs,
                                                                   "yNobs",
                                                                   stan::model::index_uni(
                                                                    3)) : 0),
                        std::numeric_limits<double>::quiet_NaN());
      new (&log_y3)
        Eigen::Map<Eigen::Matrix<double,-1,1>>(log_y3_data__.data(),
        ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(family, "family", stan::model::index_uni(3)),
            3))) ? stan::model::rvalue(yNobs, "yNobs",
                     stan::model::index_uni(3)) : 0));
      current_statement__ = 389;
      if ((stan::math::primitive_value(stan::math::logical_gt(M, 0)) &&
          stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(family, "family", stan::model::index_uni(1)),
              3)))) {
        current_statement__ = 386;
        stan::model::assign(sqrt_y1, stan::math::sqrt(yReal1),
          "assigning variable sqrt_y1");
        current_statement__ = 387;
        stan::model::assign(log_y1, stan::math::log(yReal1),
          "assigning variable log_y1");
      }
      current_statement__ = 393;
      if ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
          stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(family, "family", stan::model::index_uni(2)),
              3)))) {
        current_statement__ = 390;
        stan::model::assign(sqrt_y2, stan::math::sqrt(yReal2),
          "assigning variable sqrt_y2");
        current_statement__ = 391;
        stan::model::assign(log_y2, stan::math::log(yReal2),
          "assigning variable log_y2");
      }
      current_statement__ = 397;
      if ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
          stan::math::primitive_value(
            stan::math::logical_eq(
              stan::model::rvalue(family, "family", stan::model::index_uni(3)),
              3)))) {
        current_statement__ = 394;
        stan::model::assign(sqrt_y3, stan::math::sqrt(yReal3),
          "assigning variable sqrt_y3");
        current_statement__ = 395;
        stan::model::assign(log_y3, stan::math::log(yReal3),
          "assigning variable log_y3");
      }
      current_statement__ = 409;
      if (stan::math::logical_eq(prior_dist_for_cov, 1)) {
        current_statement__ = 407;
        for (int i = 1; i <= t; ++i) {
          current_statement__ = 403;
          if (stan::math::logical_gt(
                stan::model::rvalue(p, "p", stan::model::index_uni(i)), 1)) {
            current_statement__ = 401;
            for (int j = 1; j <=
                 stan::model::rvalue(p, "p", stan::model::index_uni(i)); ++j) {
              current_statement__ = 398;
              stan::model::assign(delta,
                stan::model::rvalue(b_prior_concentration,
                  "b_prior_concentration", stan::model::index_uni(j)),
                "assigning variable delta", stan::model::index_uni(pos));
              current_statement__ = 399;
              pos = (pos + 1);
            }
          }
          current_statement__ = 405;
          for (int j = 3; j <=
               stan::model::rvalue(p, "p", stan::model::index_uni(i)); ++j) {
            current_statement__ = 404;
            len_z_T = (len_z_T +
              (stan::model::rvalue(p, "p", stan::model::index_uni(i)) - 1));
          }
        }
      }
      current_statement__ = 415;
      if (stan::math::logical_eq(prior_dist_for_cov, 2)) {
        current_statement__ = 411;
        if (stan::math::logical_gt(bK1, 0)) {
          current_statement__ = 410;
          stan::model::assign(bCov1_idx, lower_tri_indices(bK1, pstream__),
            "assigning variable bCov1_idx");
        }
        current_statement__ = 413;
        if (stan::math::logical_gt(bK2, 0)) {
          current_statement__ = 412;
          stan::model::assign(bCov2_idx, lower_tri_indices(bK2, pstream__),
            "assigning variable bCov2_idx");
        }
      }
      current_statement__ = 358;
      stan::math::check_greater_or_equal(function__, "yHs1", yHs1, 0);
      current_statement__ = 359;
      stan::math::check_greater_or_equal(function__, "yHs2", yHs2, 0);
      current_statement__ = 360;
      stan::math::check_greater_or_equal(function__, "yHs3", yHs3, 0);
      current_statement__ = 361;
      stan::math::check_greater_or_equal(function__, "len_z_T", len_z_T, 0);
      current_statement__ = 362;
      stan::math::check_greater_or_equal(function__, "len_var_group",
        len_var_group, 0);
      current_statement__ = 363;
      stan::math::check_greater_or_equal(function__, "len_rho", len_rho, 0);
      current_statement__ = 364;
      stan::math::check_greater_or_equal(function__, "pos", pos, 1);
      current_statement__ = 366;
      stan::math::check_greater_or_equal(function__, "delta", delta, 0);
      current_statement__ = 416;
      yGamma1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 416;
      yGamma1_1dim__ = stan::math::logical_gt(
                         stan::model::rvalue(intercept_type,
                           "intercept_type", stan::model::index_uni(1)), 0);
      current_statement__ = 416;
      stan::math::validate_non_negative_index("yGamma1",
        "intercept_type[1] > 0", yGamma1_1dim__);
      current_statement__ = 417;
      yGamma2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 417;
      yGamma2_1dim__ = stan::math::logical_gt(
                         stan::model::rvalue(intercept_type,
                           "intercept_type", stan::model::index_uni(2)), 0);
      current_statement__ = 417;
      stan::math::validate_non_negative_index("yGamma2",
        "intercept_type[2] > 0", yGamma2_1dim__);
      current_statement__ = 418;
      yGamma3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 418;
      yGamma3_1dim__ = stan::math::logical_gt(
                         stan::model::rvalue(intercept_type,
                           "intercept_type", stan::model::index_uni(3)), 0);
      current_statement__ = 418;
      stan::math::validate_non_negative_index("yGamma3",
        "intercept_type[3] > 0", yGamma3_1dim__);
      current_statement__ = 419;
      z_yBeta1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 419;
      z_yBeta1_1dim__ = stan::model::rvalue(yK, "yK",
                          stan::model::index_uni(1));
      current_statement__ = 419;
      stan::math::validate_non_negative_index("z_yBeta1", "yK[1]",
        z_yBeta1_1dim__);
      current_statement__ = 420;
      z_yBeta2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 420;
      z_yBeta2_1dim__ = stan::model::rvalue(yK, "yK",
                          stan::model::index_uni(2));
      current_statement__ = 420;
      stan::math::validate_non_negative_index("z_yBeta2", "yK[2]",
        z_yBeta2_1dim__);
      current_statement__ = 421;
      z_yBeta3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 421;
      z_yBeta3_1dim__ = stan::model::rvalue(yK, "yK",
                          stan::model::index_uni(3));
      current_statement__ = 421;
      stan::math::validate_non_negative_index("z_yBeta3", "yK[3]",
        z_yBeta3_1dim__);
      current_statement__ = 422;
      z_b_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 422;
      z_b_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 1) ? q : 0);
      current_statement__ = 422;
      stan::math::validate_non_negative_index("z_b",
        "prior_dist_for_cov == 1 ? q : 0", z_b_1dim__);
      current_statement__ = 423;
      z_T_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 423;
      z_T_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 1) ? len_z_T : 0);
      current_statement__ = 423;
      stan::math::validate_non_negative_index("z_T",
        "prior_dist_for_cov == 1 ? len_z_T : 0", z_T_1dim__);
      current_statement__ = 424;
      rho_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 424;
      rho_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 1) ? len_rho : 0);
      current_statement__ = 424;
      stan::math::validate_non_negative_index("rho",
        "prior_dist_for_cov == 1 ? len_rho : 0", rho_1dim__);
      current_statement__ = 425;
      zeta_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 425;
      zeta_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 1) ? len_concentration : 0);
      current_statement__ = 425;
      stan::math::validate_non_negative_index("zeta",
        "prior_dist_for_cov == 1 ? len_concentration : 0", zeta_1dim__);
      current_statement__ = 426;
      tau_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 426;
      tau_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 1) ? t : 0);
      current_statement__ = 426;
      stan::math::validate_non_negative_index("tau",
        "prior_dist_for_cov == 1 ? t : 0", tau_1dim__);
      current_statement__ = 427;
      bSd1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 427;
      bSd1_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 2) ? bK1 : 0);
      current_statement__ = 427;
      stan::math::validate_non_negative_index("bSd1",
        "prior_dist_for_cov == 2 ? bK1 : 0", bSd1_1dim__);
      current_statement__ = 428;
      z_bMat1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 428;
      z_bMat1_1dim__ = ((stan::math::primitive_value(
                           stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK1, 0))) ? bK1 : 0);
      current_statement__ = 428;
      stan::math::validate_non_negative_index("z_bMat1",
        "prior_dist_for_cov == 2 && bK1 > 0 ? bK1 : 0", z_bMat1_1dim__);
      current_statement__ = 429;
      z_bMat1_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 429;
      z_bMat1_2dim__ = (stan::math::logical_gt(bK1, 0) ? bN1 : 0);
      current_statement__ = 429;
      stan::math::validate_non_negative_index("z_bMat1", "bK1 > 0 ? bN1 : 0",
        z_bMat1_2dim__);
      current_statement__ = 430;
      bCholesky1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 430;
      bCholesky1_1dim__ = ((stan::math::primitive_value(
                              stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK1, 1))) ? bK1 : 0);
      current_statement__ = 430;
      stan::math::validate_non_negative_index("bCholesky1",
        "prior_dist_for_cov == 2 && bK1 > 1 ? bK1 : 0", bCholesky1_1dim__);
      current_statement__ = 430;
      bCholesky1_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 430;
      bCholesky1_2dim__ = ((stan::math::primitive_value(
                              stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK1, 1))) ? bK1 : 0);
      current_statement__ = 430;
      stan::math::validate_non_negative_index("bCholesky1",
        "prior_dist_for_cov == 2 && bK1 > 1 ? bK1 : 0", bCholesky1_2dim__);
      current_statement__ = 431;
      bSd2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 431;
      bSd2_1dim__ = (stan::math::logical_eq(prior_dist_for_cov, 2) ? bK2 : 0);
      current_statement__ = 431;
      stan::math::validate_non_negative_index("bSd2",
        "prior_dist_for_cov == 2 ? bK2 : 0", bSd2_1dim__);
      current_statement__ = 432;
      z_bMat2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 432;
      z_bMat2_1dim__ = ((stan::math::primitive_value(
                           stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK2, 0))) ? bK2 : 0);
      current_statement__ = 432;
      stan::math::validate_non_negative_index("z_bMat2",
        "prior_dist_for_cov == 2 && bK2 > 0 ? bK2 : 0", z_bMat2_1dim__);
      current_statement__ = 433;
      z_bMat2_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 433;
      z_bMat2_2dim__ = (stan::math::logical_gt(bK2, 0) ? bN2 : 0);
      current_statement__ = 433;
      stan::math::validate_non_negative_index("z_bMat2", "bK2 > 0 ? bN2 : 0",
        z_bMat2_2dim__);
      current_statement__ = 434;
      bCholesky2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 434;
      bCholesky2_1dim__ = ((stan::math::primitive_value(
                              stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK2, 1))) ? bK2 : 0);
      current_statement__ = 434;
      stan::math::validate_non_negative_index("bCholesky2",
        "prior_dist_for_cov == 2 && bK2 > 1 ? bK2 : 0", bCholesky2_1dim__);
      current_statement__ = 434;
      bCholesky2_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 434;
      bCholesky2_2dim__ = ((stan::math::primitive_value(
                              stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK2, 1))) ? bK2 : 0);
      current_statement__ = 434;
      stan::math::validate_non_negative_index("bCholesky2",
        "prior_dist_for_cov == 2 && bK2 > 1 ? bK2 : 0", bCholesky2_2dim__);
      current_statement__ = 435;
      yAux1_unscaled_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 435;
      yAux1_unscaled_1dim__ = stan::model::rvalue(has_aux, "has_aux",
                                stan::model::index_uni(1));
      current_statement__ = 435;
      stan::math::validate_non_negative_index("yAux1_unscaled", "has_aux[1]",
        yAux1_unscaled_1dim__);
      current_statement__ = 436;
      yAux2_unscaled_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 436;
      yAux2_unscaled_1dim__ = stan::model::rvalue(has_aux, "has_aux",
                                stan::model::index_uni(2));
      current_statement__ = 436;
      stan::math::validate_non_negative_index("yAux2_unscaled", "has_aux[2]",
        yAux2_unscaled_1dim__);
      current_statement__ = 437;
      yAux3_unscaled_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 437;
      yAux3_unscaled_1dim__ = stan::model::rvalue(has_aux, "has_aux",
                                stan::model::index_uni(3));
      current_statement__ = 437;
      stan::math::validate_non_negative_index("yAux3_unscaled", "has_aux[3]",
        yAux3_unscaled_1dim__);
      current_statement__ = 438;
      stan::math::validate_non_negative_index("yGlobal1", "yHs1", yHs1);
      current_statement__ = 439;
      stan::math::validate_non_negative_index("yGlobal2", "yHs2", yHs2);
      current_statement__ = 440;
      stan::math::validate_non_negative_index("yGlobal3", "yHs3", yHs3);
      current_statement__ = 441;
      stan::math::validate_non_negative_index("yLocal1", "yHs1", yHs1);
      current_statement__ = 442;
      yLocal1_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 442;
      yLocal1_2dim__ = stan::model::rvalue(yK, "yK",
                         stan::model::index_uni(1));
      current_statement__ = 442;
      stan::math::validate_non_negative_index("yLocal1", "yK[1]",
        yLocal1_2dim__);
      current_statement__ = 443;
      stan::math::validate_non_negative_index("yLocal2", "yHs2", yHs2);
      current_statement__ = 444;
      yLocal2_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 444;
      yLocal2_2dim__ = stan::model::rvalue(yK, "yK",
                         stan::model::index_uni(2));
      current_statement__ = 444;
      stan::math::validate_non_negative_index("yLocal2", "yK[2]",
        yLocal2_2dim__);
      current_statement__ = 445;
      stan::math::validate_non_negative_index("yLocal3", "yHs3", yHs3);
      current_statement__ = 446;
      yLocal3_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 446;
      yLocal3_2dim__ = stan::model::rvalue(yK, "yK",
                         stan::model::index_uni(3));
      current_statement__ = 446;
      stan::math::validate_non_negative_index("yLocal3", "yK[3]",
        yLocal3_2dim__);
      current_statement__ = 447;
      y_caux1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 447;
      y_caux1_1dim__ = stan::math::logical_gt(yHs1, 0);
      current_statement__ = 447;
      stan::math::validate_non_negative_index("y_caux1", "yHs1 > 0",
        y_caux1_1dim__);
      current_statement__ = 448;
      y_caux2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 448;
      y_caux2_1dim__ = stan::math::logical_gt(yHs2, 0);
      current_statement__ = 448;
      stan::math::validate_non_negative_index("y_caux2", "yHs2 > 0",
        y_caux2_1dim__);
      current_statement__ = 449;
      y_caux3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 449;
      y_caux3_1dim__ = stan::math::logical_gt(yHs3, 0);
      current_statement__ = 449;
      stan::math::validate_non_negative_index("y_caux3", "yHs3 > 0",
        y_caux3_1dim__);
      current_statement__ = 450;
      yOol1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 450;
      yOol1_1dim__ = stan::math::logical_eq(
                       stan::model::rvalue(y_prior_dist, "y_prior_dist",
                         stan::model::index_uni(1)), 6);
      current_statement__ = 450;
      stan::math::validate_non_negative_index("yOol1",
        "y_prior_dist[1] == 6", yOol1_1dim__);
      current_statement__ = 451;
      yOol2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 451;
      yOol2_1dim__ = stan::math::logical_eq(
                       stan::model::rvalue(y_prior_dist, "y_prior_dist",
                         stan::model::index_uni(2)), 6);
      current_statement__ = 451;
      stan::math::validate_non_negative_index("yOol2",
        "y_prior_dist[2] == 6", yOol2_1dim__);
      current_statement__ = 452;
      yOol3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 452;
      yOol3_1dim__ = stan::math::logical_eq(
                       stan::model::rvalue(y_prior_dist, "y_prior_dist",
                         stan::model::index_uni(3)), 6);
      current_statement__ = 452;
      stan::math::validate_non_negative_index("yOol3",
        "y_prior_dist[3] == 6", yOol3_1dim__);
      current_statement__ = 453;
      yMix1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 453;
      yMix1_1dim__ = (stan::math::primitive_value(
                        stan::math::logical_eq(
                          stan::model::rvalue(y_prior_dist, "y_prior_dist",
                            stan::model::index_uni(1)), 5))
        ||
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(y_prior_dist, "y_prior_dist",
              stan::model::index_uni(1)), 6)));
      current_statement__ = 453;
      stan::math::validate_non_negative_index("yMix1",
        "y_prior_dist[1] == 5 || y_prior_dist[1] == 6", yMix1_1dim__);
      current_statement__ = 454;
      yMix1_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 454;
      yMix1_2dim__ = stan::model::rvalue(yK, "yK", stan::model::index_uni(1));
      current_statement__ = 454;
      stan::math::validate_non_negative_index("yMix1", "yK[1]", yMix1_2dim__);
      current_statement__ = 455;
      yMix2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 455;
      yMix2_1dim__ = (stan::math::primitive_value(
                        stan::math::logical_eq(
                          stan::model::rvalue(y_prior_dist, "y_prior_dist",
                            stan::model::index_uni(2)), 5))
        ||
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(y_prior_dist, "y_prior_dist",
              stan::model::index_uni(2)), 6)));
      current_statement__ = 455;
      stan::math::validate_non_negative_index("yMix2",
        "y_prior_dist[2] == 5 || y_prior_dist[2] == 6", yMix2_1dim__);
      current_statement__ = 456;
      yMix2_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 456;
      yMix2_2dim__ = stan::model::rvalue(yK, "yK", stan::model::index_uni(2));
      current_statement__ = 456;
      stan::math::validate_non_negative_index("yMix2", "yK[2]", yMix2_2dim__);
      current_statement__ = 457;
      yMix3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 457;
      yMix3_1dim__ = (stan::math::primitive_value(
                        stan::math::logical_eq(
                          stan::model::rvalue(y_prior_dist, "y_prior_dist",
                            stan::model::index_uni(3)), 5))
        ||
        stan::math::primitive_value(
          stan::math::logical_eq(
            stan::model::rvalue(y_prior_dist, "y_prior_dist",
              stan::model::index_uni(3)), 6)));
      current_statement__ = 457;
      stan::math::validate_non_negative_index("yMix3",
        "y_prior_dist[3] == 5 || y_prior_dist[3] == 6", yMix3_1dim__);
      current_statement__ = 458;
      yMix3_2dim__ = std::numeric_limits<int>::min();
      current_statement__ = 458;
      yMix3_2dim__ = stan::model::rvalue(yK, "yK", stan::model::index_uni(3));
      current_statement__ = 458;
      stan::math::validate_non_negative_index("yMix3", "yK[3]", yMix3_2dim__);
      current_statement__ = 459;
      yBeta1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 459;
      yBeta1_1dim__ = stan::model::rvalue(yK, "yK", stan::model::index_uni(1));
      current_statement__ = 459;
      stan::math::validate_non_negative_index("yBeta1", "yK[1]",
        yBeta1_1dim__);
      current_statement__ = 460;
      yBeta2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 460;
      yBeta2_1dim__ = stan::model::rvalue(yK, "yK", stan::model::index_uni(2));
      current_statement__ = 460;
      stan::math::validate_non_negative_index("yBeta2", "yK[2]",
        yBeta2_1dim__);
      current_statement__ = 461;
      yBeta3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 461;
      yBeta3_1dim__ = stan::model::rvalue(yK, "yK", stan::model::index_uni(3));
      current_statement__ = 461;
      stan::math::validate_non_negative_index("yBeta3", "yK[3]",
        yBeta3_1dim__);
      current_statement__ = 462;
      yAux1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 462;
      yAux1_1dim__ = stan::model::rvalue(has_aux, "has_aux",
                       stan::model::index_uni(1));
      current_statement__ = 462;
      stan::math::validate_non_negative_index("yAux1", "has_aux[1]",
        yAux1_1dim__);
      current_statement__ = 463;
      yAux2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 463;
      yAux2_1dim__ = stan::model::rvalue(has_aux, "has_aux",
                       stan::model::index_uni(2));
      current_statement__ = 463;
      stan::math::validate_non_negative_index("yAux2", "has_aux[2]",
        yAux2_1dim__);
      current_statement__ = 464;
      yAux3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 464;
      yAux3_1dim__ = stan::model::rvalue(has_aux, "has_aux",
                       stan::model::index_uni(3));
      current_statement__ = 464;
      stan::math::validate_non_negative_index("yAux3", "has_aux[3]",
        yAux3_1dim__);
      current_statement__ = 465;
      stan::math::validate_non_negative_index("theta_L", "len_theta_L",
        len_theta_L);
      current_statement__ = 466;
      bMat1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 466;
      bMat1_1dim__ = (stan::math::logical_gt(bK1, 0) ? bN1 : 0);
      current_statement__ = 466;
      stan::math::validate_non_negative_index("bMat1", "bK1 > 0 ? bN1 : 0",
        bMat1_1dim__);
      current_statement__ = 467;
      stan::math::validate_non_negative_index("bMat1", "bK1", bK1);
      current_statement__ = 468;
      bMat2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 468;
      bMat2_1dim__ = (stan::math::logical_gt(bK2, 0) ? bN2 : 0);
      current_statement__ = 468;
      stan::math::validate_non_negative_index("bMat2", "bK2 > 0 ? bN2 : 0",
        bMat2_1dim__);
      current_statement__ = 469;
      stan::math::validate_non_negative_index("bMat2", "bK2", bK2);
      current_statement__ = 470;
      stan::math::validate_non_negative_index("mean_PPD", "M", M);
      current_statement__ = 471;
      yAlpha1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 471;
      yAlpha1_1dim__ = stan::math::logical_gt(
                         stan::model::rvalue(intercept_type,
                           "intercept_type", stan::model::index_uni(1)), 0);
      current_statement__ = 471;
      stan::math::validate_non_negative_index("yAlpha1",
        "intercept_type[1] > 0", yAlpha1_1dim__);
      current_statement__ = 472;
      yAlpha2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 472;
      yAlpha2_1dim__ = stan::math::logical_gt(
                         stan::model::rvalue(intercept_type,
                           "intercept_type", stan::model::index_uni(2)), 0);
      current_statement__ = 472;
      stan::math::validate_non_negative_index("yAlpha2",
        "intercept_type[2] > 0", yAlpha2_1dim__);
      current_statement__ = 473;
      yAlpha3_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 473;
      yAlpha3_1dim__ = stan::math::logical_gt(
                         stan::model::rvalue(intercept_type,
                           "intercept_type", stan::model::index_uni(3)), 0);
      current_statement__ = 473;
      stan::math::validate_non_negative_index("yAlpha3",
        "intercept_type[3] > 0", yAlpha3_1dim__);
      current_statement__ = 474;
      bCov1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 474;
      bCov1_1dim__ = ((stan::math::primitive_value(
                         stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK1, 0))) ? 
        stan::math::size(bCov1_idx) : 0);
      current_statement__ = 474;
      stan::math::validate_non_negative_index("bCov1",
        "prior_dist_for_cov == 2 && bK1 > 0 ? size(bCov1_idx) : 0",
        bCov1_1dim__);
      current_statement__ = 475;
      bCov2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 475;
      bCov2_1dim__ = ((stan::math::primitive_value(
                         stan::math::logical_eq(prior_dist_for_cov, 2))
        &&
        stan::math::primitive_value(stan::math::logical_gt(bK2, 0))) ? 
        stan::math::size(bCov2_idx) : 0);
      current_statement__ = 475;
      stan::math::validate_non_negative_index("bCov2",
        "prior_dist_for_cov == 2 && bK2 > 0 ? size(bCov2_idx) : 0",
        bCov2_1dim__);
      current_statement__ = 476;
      b1_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 476;
      b1_1dim__ = (bN1 * bK1);
      current_statement__ = 476;
      stan::math::validate_non_negative_index("b1", "bN1 * bK1", b1_1dim__);
      current_statement__ = 477;
      b2_1dim__ = std::numeric_limits<int>::min();
      current_statement__ = 477;
      b2_1dim__ = (bN2 * bK2);
      current_statement__ = 477;
      stan::math::validate_non_negative_index("b2", "bN2 * bK2", b2_1dim__);
    } catch (const std::exception& e) {
      stan::lang::rethrow_located(e, locations_array__[current_statement__]);
    }
    num_params_r__ = yGamma1_1dim__ + yGamma2_1dim__ + yGamma3_1dim__ +
      z_yBeta1_1dim__ + z_yBeta2_1dim__ + z_yBeta3_1dim__ + z_b_1dim__ +
      z_T_1dim__ + rho_1dim__ + zeta_1dim__ + tau_1dim__ + bSd1_1dim__ +
      (z_bMat1_1dim__ * z_bMat1_2dim__) + ((bCholesky1_1dim__ *
      (bCholesky1_1dim__ - 1)) / 2) + bSd2_1dim__ + (z_bMat2_1dim__ *
      z_bMat2_2dim__) + ((bCholesky2_1dim__ * (bCholesky2_1dim__ - 1)) / 2) +
      yAux1_unscaled_1dim__ + yAux2_unscaled_1dim__ + yAux3_unscaled_1dim__ +
      yHs1 + yHs2 + yHs3 + (yHs1 * yLocal1_2dim__) + (yHs2 * yLocal2_2dim__)
      + (yHs3 * yLocal3_2dim__) + y_caux1_1dim__ + y_caux2_1dim__ +
      y_caux3_1dim__ + yOol1_1dim__ + yOol2_1dim__ + yOol3_1dim__ +
      (yMix1_1dim__ * yMix1_2dim__) + (yMix2_1dim__ * yMix2_2dim__) +
      (yMix3_1dim__ * yMix3_2dim__);
  }
  inline std::string model_name() const final {
    return "model_mvmer";
  }
  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_mvmer_namespace::log_prob";
    // suppress unused var warning
    (void) function__;
    try {
      std::vector<local_scalar_t__> yGamma1 =
        std::vector<local_scalar_t__>(yGamma1_1dim__, DUMMY_VAR__);
      current_statement__ = 1;
      yGamma1 = in__.template read_constrain_lub<
                  std::vector<local_scalar_t__>,
                  jacobian__>(lb(
                                stan::model::rvalue(intercept_type,
                                  "intercept_type", stan::model::index_uni(1)),
                                pstream__),
                  ub(
                    stan::model::rvalue(intercept_type, "intercept_type",
                      stan::model::index_uni(1)), pstream__), lp__,
                  yGamma1_1dim__);
      std::vector<local_scalar_t__> yGamma2 =
        std::vector<local_scalar_t__>(yGamma2_1dim__, DUMMY_VAR__);
      current_statement__ = 2;
      yGamma2 = in__.template read_constrain_lub<
                  std::vector<local_scalar_t__>,
                  jacobian__>(lb(
                                stan::model::rvalue(intercept_type,
                                  "intercept_type", stan::model::index_uni(2)),
                                pstream__),
                  ub(
                    stan::model::rvalue(intercept_type, "intercept_type",
                      stan::model::index_uni(2)), pstream__), lp__,
                  yGamma2_1dim__);
      std::vector<local_scalar_t__> yGamma3 =
        std::vector<local_scalar_t__>(yGamma3_1dim__, DUMMY_VAR__);
      current_statement__ = 3;
      yGamma3 = in__.template read_constrain_lub<
                  std::vector<local_scalar_t__>,
                  jacobian__>(lb(
                                stan::model::rvalue(intercept_type,
                                  "intercept_type", stan::model::index_uni(3)),
                                pstream__),
                  ub(
                    stan::model::rvalue(intercept_type, "intercept_type",
                      stan::model::index_uni(3)), pstream__), lp__,
                  yGamma3_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta1_1dim__,
          DUMMY_VAR__);
      current_statement__ = 4;
      z_yBeta1 = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta1_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta2_1dim__,
          DUMMY_VAR__);
      current_statement__ = 5;
      z_yBeta2 = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta2_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta3_1dim__,
          DUMMY_VAR__);
      current_statement__ = 6;
      z_yBeta3 = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta3_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> z_b =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_b_1dim__,
          DUMMY_VAR__);
      current_statement__ = 7;
      z_b = in__.template read<
              Eigen::Matrix<local_scalar_t__,-1,1>>(z_b_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> z_T =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_T_1dim__,
          DUMMY_VAR__);
      current_statement__ = 8;
      z_T = in__.template read<
              Eigen::Matrix<local_scalar_t__,-1,1>>(z_T_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> rho =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(rho_1dim__,
          DUMMY_VAR__);
      current_statement__ = 9;
      rho = in__.template read_constrain_lub<
              Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, 1, lp__,
              rho_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> zeta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(zeta_1dim__,
          DUMMY_VAR__);
      current_statement__ = 10;
      zeta = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               zeta_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> tau =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(tau_1dim__,
          DUMMY_VAR__);
      current_statement__ = 11;
      tau = in__.template read_constrain_lb<
              Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
              tau_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> bSd1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(bSd1_1dim__,
          DUMMY_VAR__);
      current_statement__ = 12;
      bSd1 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               bSd1_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,-1> z_bMat1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(z_bMat1_1dim__,
          z_bMat1_2dim__, DUMMY_VAR__);
      current_statement__ = 13;
      z_bMat1 = in__.template read<
                  Eigen::Matrix<local_scalar_t__,-1,-1>>(z_bMat1_1dim__,
                  z_bMat1_2dim__);
      Eigen::Matrix<local_scalar_t__,-1,-1> bCholesky1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bCholesky1_1dim__,
          bCholesky1_2dim__, DUMMY_VAR__);
      current_statement__ = 14;
      bCholesky1 = in__.template read_constrain_cholesky_factor_corr<
                     Eigen::Matrix<local_scalar_t__,-1,-1>, jacobian__>(lp__,
                     bCholesky1_2dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> bSd2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(bSd2_1dim__,
          DUMMY_VAR__);
      current_statement__ = 15;
      bSd2 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               bSd2_1dim__);
      Eigen::Matrix<local_scalar_t__,-1,-1> z_bMat2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(z_bMat2_1dim__,
          z_bMat2_2dim__, DUMMY_VAR__);
      current_statement__ = 16;
      z_bMat2 = in__.template read<
                  Eigen::Matrix<local_scalar_t__,-1,-1>>(z_bMat2_1dim__,
                  z_bMat2_2dim__);
      Eigen::Matrix<local_scalar_t__,-1,-1> bCholesky2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bCholesky2_1dim__,
          bCholesky2_2dim__, DUMMY_VAR__);
      current_statement__ = 17;
      bCholesky2 = in__.template read_constrain_cholesky_factor_corr<
                     Eigen::Matrix<local_scalar_t__,-1,-1>, jacobian__>(lp__,
                     bCholesky2_2dim__);
      std::vector<local_scalar_t__> yAux1_unscaled =
        std::vector<local_scalar_t__>(yAux1_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 18;
      yAux1_unscaled = in__.template read_constrain_lb<
                         std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                         yAux1_unscaled_1dim__);
      std::vector<local_scalar_t__> yAux2_unscaled =
        std::vector<local_scalar_t__>(yAux2_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 19;
      yAux2_unscaled = in__.template read_constrain_lb<
                         std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                         yAux2_unscaled_1dim__);
      std::vector<local_scalar_t__> yAux3_unscaled =
        std::vector<local_scalar_t__>(yAux3_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 20;
      yAux3_unscaled = in__.template read_constrain_lb<
                         std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                         yAux3_unscaled_1dim__);
      std::vector<local_scalar_t__> yGlobal1 =
        std::vector<local_scalar_t__>(yHs1, DUMMY_VAR__);
      current_statement__ = 21;
      yGlobal1 = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, yHs1);
      std::vector<local_scalar_t__> yGlobal2 =
        std::vector<local_scalar_t__>(yHs2, DUMMY_VAR__);
      current_statement__ = 22;
      yGlobal2 = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, yHs2);
      std::vector<local_scalar_t__> yGlobal3 =
        std::vector<local_scalar_t__>(yHs3, DUMMY_VAR__);
      current_statement__ = 23;
      yGlobal3 = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, yHs3);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs1,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal1_2dim__,
            DUMMY_VAR__));
      current_statement__ = 24;
      yLocal1 = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, yHs1, yLocal1_2dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs2,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal2_2dim__,
            DUMMY_VAR__));
      current_statement__ = 25;
      yLocal2 = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, yHs2, yLocal2_2dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs3,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal3_2dim__,
            DUMMY_VAR__));
      current_statement__ = 26;
      yLocal3 = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, yHs3, yLocal3_2dim__);
      std::vector<local_scalar_t__> y_caux1 =
        std::vector<local_scalar_t__>(y_caux1_1dim__, DUMMY_VAR__);
      current_statement__ = 27;
      y_caux1 = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                  y_caux1_1dim__);
      std::vector<local_scalar_t__> y_caux2 =
        std::vector<local_scalar_t__>(y_caux2_1dim__, DUMMY_VAR__);
      current_statement__ = 28;
      y_caux2 = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                  y_caux2_1dim__);
      std::vector<local_scalar_t__> y_caux3 =
        std::vector<local_scalar_t__>(y_caux3_1dim__, DUMMY_VAR__);
      current_statement__ = 29;
      y_caux3 = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                  y_caux3_1dim__);
      std::vector<local_scalar_t__> yOol1 =
        std::vector<local_scalar_t__>(yOol1_1dim__, DUMMY_VAR__);
      current_statement__ = 30;
      yOol1 = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, yOol1_1dim__);
      std::vector<local_scalar_t__> yOol2 =
        std::vector<local_scalar_t__>(yOol2_1dim__, DUMMY_VAR__);
      current_statement__ = 31;
      yOol2 = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, yOol2_1dim__);
      std::vector<local_scalar_t__> yOol3 =
        std::vector<local_scalar_t__>(yOol3_1dim__, DUMMY_VAR__);
      current_statement__ = 32;
      yOol3 = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, yOol3_1dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix1_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix1_2dim__,
            DUMMY_VAR__));
      current_statement__ = 33;
      yMix1 = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, yMix1_1dim__, yMix1_2dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix2_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix2_2dim__,
            DUMMY_VAR__));
      current_statement__ = 34;
      yMix2 = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, yMix2_1dim__, yMix2_2dim__);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix3_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix3_2dim__,
            DUMMY_VAR__));
      current_statement__ = 35;
      yMix3 = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, yMix3_1dim__, yMix3_2dim__);
      Eigen::Matrix<local_scalar_t__,-1,1> yBeta1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yBeta1_1dim__,
          DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> yBeta2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yBeta2_1dim__,
          DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> yBeta3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yBeta3_1dim__,
          DUMMY_VAR__);
      std::vector<local_scalar_t__> yAux1 =
        std::vector<local_scalar_t__>(yAux1_1dim__, DUMMY_VAR__);
      std::vector<local_scalar_t__> yAux2 =
        std::vector<local_scalar_t__>(yAux2_1dim__, DUMMY_VAR__);
      std::vector<local_scalar_t__> yAux3 =
        std::vector<local_scalar_t__>(yAux3_1dim__, DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,1> theta_L =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(len_theta_L,
          DUMMY_VAR__);
      local_scalar_t__ yAuxMaximum = DUMMY_VAR__;
      current_statement__ = 43;
      yAuxMaximum = 1.0;
      Eigen::Matrix<local_scalar_t__,-1,-1> bMat1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bMat1_1dim__, bK1,
          DUMMY_VAR__);
      Eigen::Matrix<local_scalar_t__,-1,-1> bMat2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bMat2_1dim__, bK2,
          DUMMY_VAR__);
      current_statement__ = 58;
      if (stan::math::logical_eq(
            stan::model::rvalue(has_aux, "has_aux", stan::model::index_uni(1)),
            1)) {
        current_statement__ = 54;
        stan::model::assign(yAux1,
          make_aux(
            stan::model::rvalue(yAux1_unscaled, "yAux1_unscaled",
              stan::model::index_uni(1)),
            stan::model::rvalue(y_prior_dist_for_aux, "y_prior_dist_for_aux",
              stan::model::index_uni(1)),
            stan::model::rvalue(y_prior_mean_for_aux, "y_prior_mean_for_aux",
              stan::model::index_uni(1)),
            stan::model::rvalue(y_prior_scale_for_aux,
              "y_prior_scale_for_aux", stan::model::index_uni(1)), pstream__),
          "assigning variable yAux1", stan::model::index_uni(1));
        current_statement__ = 56;
        if (stan::math::logical_gt(
              stan::model::rvalue(yAux1, "yAux1", stan::model::index_uni(1)),
              yAuxMaximum)) {
          current_statement__ = 55;
          yAuxMaximum = stan::model::rvalue(yAux1, "yAux1",
                          stan::model::index_uni(1));
        }
      }
      current_statement__ = 60;
      if (stan::math::logical_gt(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(1)), 0)) {
        current_statement__ = 59;
        stan::model::assign(yBeta1,
          make_beta(z_yBeta1,
            stan::model::rvalue(y_prior_dist, "y_prior_dist",
              stan::model::index_uni(1)), y_prior_mean1, y_prior_scale1,
            y_prior_df1,
            stan::model::rvalue(y_global_prior_scale, "y_global_prior_scale",
              stan::model::index_uni(1)), yGlobal1, yLocal1, yOol1, yMix1,
            yAux1,
            stan::model::rvalue(family, "family", stan::model::index_uni(1)),
            stan::model::rvalue(y_slab_scale, "y_slab_scale",
              stan::model::index_uni(1)), y_caux1, pstream__),
          "assigning variable yBeta1");
      }
      current_statement__ = 69;
      if (stan::math::logical_gt(M, 1)) {
        current_statement__ = 65;
        if (stan::math::logical_eq(
              stan::model::rvalue(has_aux, "has_aux",
                stan::model::index_uni(2)), 1)) {
          current_statement__ = 61;
          stan::model::assign(yAux2,
            make_aux(
              stan::model::rvalue(yAux2_unscaled, "yAux2_unscaled",
                stan::model::index_uni(1)),
              stan::model::rvalue(y_prior_dist_for_aux,
                "y_prior_dist_for_aux", stan::model::index_uni(2)),
              stan::model::rvalue(y_prior_mean_for_aux,
                "y_prior_mean_for_aux", stan::model::index_uni(2)),
              stan::model::rvalue(y_prior_scale_for_aux,
                "y_prior_scale_for_aux", stan::model::index_uni(2)),
              pstream__), "assigning variable yAux2",
            stan::model::index_uni(1));
          current_statement__ = 63;
          if (stan::math::logical_gt(
                stan::model::rvalue(yAux2, "yAux2", stan::model::index_uni(1)),
                yAuxMaximum)) {
            current_statement__ = 62;
            yAuxMaximum = stan::model::rvalue(yAux2, "yAux2",
                            stan::model::index_uni(1));
          }
        }
        current_statement__ = 67;
        if (stan::math::logical_gt(
              stan::model::rvalue(yK, "yK", stan::model::index_uni(2)), 0)) {
          current_statement__ = 66;
          stan::model::assign(yBeta2,
            make_beta(z_yBeta2,
              stan::model::rvalue(y_prior_dist, "y_prior_dist",
                stan::model::index_uni(2)), y_prior_mean2, y_prior_scale2,
              y_prior_df2,
              stan::model::rvalue(y_global_prior_scale,
                "y_global_prior_scale", stan::model::index_uni(2)), yGlobal2,
              yLocal2, yOol2, yMix2, yAux2,
              stan::model::rvalue(family, "family", stan::model::index_uni(2)),
              stan::model::rvalue(y_slab_scale, "y_slab_scale",
                stan::model::index_uni(2)), y_caux2, pstream__),
            "assigning variable yBeta2");
        }
      }
      current_statement__ = 78;
      if (stan::math::logical_gt(M, 2)) {
        current_statement__ = 74;
        if (stan::math::logical_eq(
              stan::model::rvalue(has_aux, "has_aux",
                stan::model::index_uni(3)), 1)) {
          current_statement__ = 70;
          stan::model::assign(yAux3,
            make_aux(
              stan::model::rvalue(yAux3_unscaled, "yAux3_unscaled",
                stan::model::index_uni(1)),
              stan::model::rvalue(y_prior_dist_for_aux,
                "y_prior_dist_for_aux", stan::model::index_uni(3)),
              stan::model::rvalue(y_prior_mean_for_aux,
                "y_prior_mean_for_aux", stan::model::index_uni(3)),
              stan::model::rvalue(y_prior_scale_for_aux,
                "y_prior_scale_for_aux", stan::model::index_uni(3)),
              pstream__), "assigning variable yAux3",
            stan::model::index_uni(1));
          current_statement__ = 72;
          if (stan::math::logical_gt(
                stan::model::rvalue(yAux3, "yAux3", stan::model::index_uni(1)),
                yAuxMaximum)) {
            current_statement__ = 71;
            yAuxMaximum = stan::model::rvalue(yAux3, "yAux3",
                            stan::model::index_uni(1));
          }
        }
        current_statement__ = 76;
        if (stan::math::logical_gt(
              stan::model::rvalue(yK, "yK", stan::model::index_uni(3)), 0)) {
          current_statement__ = 75;
          stan::model::assign(yBeta3,
            make_beta(z_yBeta3,
              stan::model::rvalue(y_prior_dist, "y_prior_dist",
                stan::model::index_uni(3)), y_prior_mean3, y_prior_scale3,
              y_prior_df3,
              stan::model::rvalue(y_global_prior_scale,
                "y_global_prior_scale", stan::model::index_uni(3)), yGlobal3,
              yLocal3, yOol3, yMix3, yAux3,
              stan::model::rvalue(family, "family", stan::model::index_uni(3)),
              stan::model::rvalue(y_slab_scale, "y_slab_scale",
                stan::model::index_uni(3)), y_caux3, pstream__),
            "assigning variable yBeta3");
        }
      }
      current_statement__ = 96;
      if (stan::math::logical_eq(prior_dist_for_cov, 1)) {
        int mark = std::numeric_limits<int>::min();
        current_statement__ = 89;
        mark = 1;
        current_statement__ = 90;
        stan::model::assign(theta_L,
          make_theta_L(len_theta_L, p, yAuxMaximum, tau, b_prior_scale, zeta,
            rho, z_T, pstream__), "assigning variable theta_L");
        current_statement__ = 92;
        if (stan::math::logical_gt(bK1, 0)) {
          current_statement__ = 91;
          stan::model::assign(bMat1,
            make_b_matrix(z_b, theta_L, p, l, 1, pstream__),
            "assigning variable bMat1");
        }
        current_statement__ = 94;
        if (stan::math::logical_gt(bK2, 0)) {
          current_statement__ = 93;
          stan::model::assign(bMat2,
            make_b_matrix(z_b, theta_L, p, l, 2, pstream__),
            "assigning variable bMat2");
        }
      } else {
        current_statement__ = 88;
        if (stan::math::logical_eq(prior_dist_for_cov, 2)) {
          current_statement__ = 82;
          if (stan::math::logical_eq(bK1, 1)) {
            current_statement__ = 81;
            stan::model::assign(bMat1,
              stan::math::transpose(
                stan::math::multiply(
                  stan::model::rvalue(bSd1, "bSd1", stan::model::index_uni(1)),
                  z_bMat1)), "assigning variable bMat1");
          } else {
            current_statement__ = 80;
            if (stan::math::logical_gt(bK1, 1)) {
              current_statement__ = 79;
              stan::model::assign(bMat1,
                stan::math::transpose(
                  stan::math::multiply(
                    stan::math::diag_pre_multiply(bSd1, bCholesky1), z_bMat1)),
                "assigning variable bMat1");
            }
          }
          current_statement__ = 86;
          if (stan::math::logical_eq(bK2, 1)) {
            current_statement__ = 85;
            stan::model::assign(bMat2,
              stan::math::transpose(
                stan::math::multiply(
                  stan::model::rvalue(bSd2, "bSd2", stan::model::index_uni(1)),
                  z_bMat2)), "assigning variable bMat2");
          } else {
            current_statement__ = 84;
            if (stan::math::logical_gt(bK2, 1)) {
              current_statement__ = 83;
              stan::model::assign(bMat2,
                stan::math::transpose(
                  stan::math::multiply(
                    stan::math::diag_pre_multiply(bSd2, bCholesky2), z_bMat2)),
                "assigning variable bMat2");
            }
          }
        }
      }
      {
        current_statement__ = 139;
        stan::math::validate_non_negative_index("yEta1", "yNeta[1]",
          stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)));
        Eigen::Matrix<local_scalar_t__,-1,1> yEta1 =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::model::rvalue(
                                                           yNeta, "yNeta",
                                                           stan::model::index_uni(
                                                             1)),
            DUMMY_VAR__);
        current_statement__ = 141;
        stan::math::validate_non_negative_index("yEta2", "yNeta[2]",
          stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)));
        Eigen::Matrix<local_scalar_t__,-1,1> yEta2 =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::model::rvalue(
                                                           yNeta, "yNeta",
                                                           stan::model::index_uni(
                                                             2)),
            DUMMY_VAR__);
        current_statement__ = 143;
        stan::math::validate_non_negative_index("yEta3", "yNeta[3]",
          stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)));
        Eigen::Matrix<local_scalar_t__,-1,1> yEta3 =
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(stan::model::rvalue(
                                                           yNeta, "yNeta",
                                                           stan::model::index_uni(
                                                             3)),
            DUMMY_VAR__);
        current_statement__ = 149;
        if (stan::math::logical_gt(M, 0)) {
          int bMat1_colshift = std::numeric_limits<int>::min();
          current_statement__ = 145;
          bMat1_colshift = 0;
          int bMat2_colshift = std::numeric_limits<int>::min();
          current_statement__ = 146;
          bMat2_colshift = 0;
          current_statement__ = 147;
          stan::model::assign(yEta1,
            evaluate_eta(yX1, y1_Z1, y1_Z2, y1_Z1_id, y1_Z2_id, yGamma1,
              yBeta1, bMat1, bMat2, bMat1_colshift, bMat2_colshift,
              stan::model::rvalue(intercept_type, "intercept_type",
                stan::model::index_uni(1)), y1_offset, pstream__),
            "assigning variable yEta1");
        }
        current_statement__ = 154;
        if (stan::math::logical_gt(M, 1)) {
          int bMat1_colshift = std::numeric_limits<int>::min();
          current_statement__ = 150;
          bMat1_colshift = stan::model::rvalue(bK1_len, "bK1_len",
                             stan::model::index_uni(1));
          int bMat2_colshift = std::numeric_limits<int>::min();
          current_statement__ = 151;
          bMat2_colshift = stan::model::rvalue(bK2_len, "bK2_len",
                             stan::model::index_uni(1));
          current_statement__ = 152;
          stan::model::assign(yEta2,
            evaluate_eta(yX2, y2_Z1, y2_Z2, y2_Z1_id, y2_Z2_id, yGamma2,
              yBeta2, bMat1, bMat2, bMat1_colshift, bMat2_colshift,
              stan::model::rvalue(intercept_type, "intercept_type",
                stan::model::index_uni(2)), y2_offset, pstream__),
            "assigning variable yEta2");
        }
        current_statement__ = 159;
        if (stan::math::logical_gt(M, 2)) {
          int bMat1_colshift = std::numeric_limits<int>::min();
          current_statement__ = 155;
          bMat1_colshift = stan::math::sum(
                             stan::model::rvalue(bK1_len, "bK1_len",
                               stan::model::index_min_max(1, 2)));
          int bMat2_colshift = std::numeric_limits<int>::min();
          current_statement__ = 156;
          bMat2_colshift = stan::math::sum(
                             stan::model::rvalue(bK2_len, "bK2_len",
                               stan::model::index_min_max(1, 2)));
          current_statement__ = 157;
          stan::model::assign(yEta3,
            evaluate_eta(yX3, y3_Z1, y3_Z2, y3_Z1_id, y3_Z2_id, yGamma3,
              yBeta3, bMat1, bMat2, bMat1_colshift, bMat2_colshift,
              stan::model::rvalue(intercept_type, "intercept_type",
                stan::model::index_uni(3)), y3_offset, pstream__),
            "assigning variable yEta3");
        }
        current_statement__ = 166;
        if (stan::math::logical_eq(prior_PD, 0)) {
          current_statement__ = 160;
          lp_accum__.add(glm_lpdf<false>(yReal1, yInt1, yEta1, yAux1,
                           stan::model::rvalue(family, "family",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(link, "link",
                             stan::model::index_uni(1)), sum_log_y1, sqrt_y1,
                           log_y1, pstream__));
          current_statement__ = 162;
          if (stan::math::logical_gt(M, 1)) {
            current_statement__ = 161;
            lp_accum__.add(glm_lpdf<false>(yReal2, yInt2, yEta2, yAux2,
                             stan::model::rvalue(family, "family",
                               stan::model::index_uni(2)),
                             stan::model::rvalue(link, "link",
                               stan::model::index_uni(2)), sum_log_y2,
                             sqrt_y2, log_y2, pstream__));
          }
          current_statement__ = 164;
          if (stan::math::logical_gt(M, 2)) {
            current_statement__ = 163;
            lp_accum__.add(glm_lpdf<false>(yReal3, yInt3, yEta3, yAux3,
                             stan::model::rvalue(family, "family",
                               stan::model::index_uni(3)),
                             stan::model::rvalue(link, "link",
                               stan::model::index_uni(3)), sum_log_y3,
                             sqrt_y3, log_y3, pstream__));
          }
        }
        current_statement__ = 168;
        if (stan::math::logical_eq(
              stan::model::rvalue(has_aux, "has_aux",
                stan::model::index_uni(1)), 1)) {
          current_statement__ = 167;
          lp_accum__.add(aux_lpdf<false>(
                           stan::model::rvalue(yAux1_unscaled,
                             "yAux1_unscaled", stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_dist_for_aux,
                             "y_prior_dist_for_aux",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_scale_for_aux,
                             "y_prior_scale_for_aux",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_df_for_aux,
                             "y_prior_df_for_aux", stan::model::index_uni(1)),
                           pstream__));
        }
        current_statement__ = 170;
        if ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
            stan::math::primitive_value(
              stan::math::logical_eq(
                stan::model::rvalue(has_aux, "has_aux",
                  stan::model::index_uni(2)), 1)))) {
          current_statement__ = 169;
          lp_accum__.add(aux_lpdf<false>(
                           stan::model::rvalue(yAux2_unscaled,
                             "yAux2_unscaled", stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_dist_for_aux,
                             "y_prior_dist_for_aux",
                             stan::model::index_uni(2)),
                           stan::model::rvalue(y_prior_scale_for_aux,
                             "y_prior_scale_for_aux",
                             stan::model::index_uni(2)),
                           stan::model::rvalue(y_prior_df_for_aux,
                             "y_prior_df_for_aux", stan::model::index_uni(2)),
                           pstream__));
        }
        current_statement__ = 172;
        if ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
            stan::math::primitive_value(
              stan::math::logical_eq(
                stan::model::rvalue(has_aux, "has_aux",
                  stan::model::index_uni(3)), 1)))) {
          current_statement__ = 171;
          lp_accum__.add(aux_lpdf<false>(
                           stan::model::rvalue(yAux3_unscaled,
                             "yAux3_unscaled", stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_dist_for_aux,
                             "y_prior_dist_for_aux",
                             stan::model::index_uni(3)),
                           stan::model::rvalue(y_prior_scale_for_aux,
                             "y_prior_scale_for_aux",
                             stan::model::index_uni(3)),
                           stan::model::rvalue(y_prior_df_for_aux,
                             "y_prior_df_for_aux", stan::model::index_uni(3)),
                           pstream__));
        }
        current_statement__ = 174;
        if (stan::math::logical_gt(
              stan::model::rvalue(intercept_type, "intercept_type",
                stan::model::index_uni(1)), 0)) {
          current_statement__ = 173;
          lp_accum__.add(gamma_custom_lpdf<false>(
                           stan::model::rvalue(yGamma1, "yGamma1",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_dist_for_intercept,
                             "y_prior_dist_for_intercept",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_mean_for_intercept,
                             "y_prior_mean_for_intercept",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_scale_for_intercept,
                             "y_prior_scale_for_intercept",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_df_for_intercept,
                             "y_prior_df_for_intercept",
                             stan::model::index_uni(1)), pstream__));
        }
        current_statement__ = 176;
        if ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(intercept_type, "intercept_type",
                  stan::model::index_uni(2)), 0)))) {
          current_statement__ = 175;
          lp_accum__.add(gamma_custom_lpdf<false>(
                           stan::model::rvalue(yGamma2, "yGamma2",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_dist_for_intercept,
                             "y_prior_dist_for_intercept",
                             stan::model::index_uni(2)),
                           stan::model::rvalue(y_prior_mean_for_intercept,
                             "y_prior_mean_for_intercept",
                             stan::model::index_uni(2)),
                           stan::model::rvalue(y_prior_scale_for_intercept,
                             "y_prior_scale_for_intercept",
                             stan::model::index_uni(2)),
                           stan::model::rvalue(y_prior_df_for_intercept,
                             "y_prior_df_for_intercept",
                             stan::model::index_uni(2)), pstream__));
        }
        current_statement__ = 178;
        if ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(intercept_type, "intercept_type",
                  stan::model::index_uni(3)), 0)))) {
          current_statement__ = 177;
          lp_accum__.add(gamma_custom_lpdf<false>(
                           stan::model::rvalue(yGamma3, "yGamma3",
                             stan::model::index_uni(1)),
                           stan::model::rvalue(y_prior_dist_for_intercept,
                             "y_prior_dist_for_intercept",
                             stan::model::index_uni(3)),
                           stan::model::rvalue(y_prior_mean_for_intercept,
                             "y_prior_mean_for_intercept",
                             stan::model::index_uni(3)),
                           stan::model::rvalue(y_prior_scale_for_intercept,
                             "y_prior_scale_for_intercept",
                             stan::model::index_uni(3)),
                           stan::model::rvalue(y_prior_df_for_intercept,
                             "y_prior_df_for_intercept",
                             stan::model::index_uni(3)), pstream__));
        }
        current_statement__ = 180;
        if (stan::math::logical_gt(
              stan::model::rvalue(yK, "yK", stan::model::index_uni(1)), 0)) {
          current_statement__ = 179;
          lp_accum__.add(beta_custom_lpdf<false>(z_yBeta1,
                           stan::model::rvalue(y_prior_dist, "y_prior_dist",
                             stan::model::index_uni(1)), y_prior_scale1,
                           y_prior_df1,
                           stan::model::rvalue(y_global_prior_df,
                             "y_global_prior_df", stan::model::index_uni(1)),
                           yLocal1, yGlobal1, yMix1, yOol1,
                           stan::model::rvalue(y_slab_df, "y_slab_df",
                             stan::model::index_uni(1)), y_caux1, pstream__));
        }
        current_statement__ = 182;
        if ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(yK, "yK", stan::model::index_uni(2)), 0)))) {
          current_statement__ = 181;
          lp_accum__.add(beta_custom_lpdf<false>(z_yBeta2,
                           stan::model::rvalue(y_prior_dist, "y_prior_dist",
                             stan::model::index_uni(2)), y_prior_scale2,
                           y_prior_df2,
                           stan::model::rvalue(y_global_prior_df,
                             "y_global_prior_df", stan::model::index_uni(2)),
                           yLocal2, yGlobal2, yMix2, yOol2,
                           stan::model::rvalue(y_slab_df, "y_slab_df",
                             stan::model::index_uni(2)), y_caux2, pstream__));
        }
        current_statement__ = 184;
        if ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
            stan::math::primitive_value(
              stan::math::logical_gt(
                stan::model::rvalue(yK, "yK", stan::model::index_uni(3)), 0)))) {
          current_statement__ = 183;
          lp_accum__.add(beta_custom_lpdf<false>(z_yBeta3,
                           stan::model::rvalue(y_prior_dist, "y_prior_dist",
                             stan::model::index_uni(3)), y_prior_scale3,
                           y_prior_df3,
                           stan::model::rvalue(y_global_prior_df,
                             "y_global_prior_df", stan::model::index_uni(3)),
                           yLocal3, yGlobal3, yMix3, yOol3,
                           stan::model::rvalue(y_slab_df, "y_slab_df",
                             stan::model::index_uni(3)), y_caux3, pstream__));
        }
        current_statement__ = 201;
        if (stan::math::logical_eq(prior_dist_for_cov, 1)) {
          current_statement__ = 199;
          lp_accum__.add(decov_lpdf<false>(z_b, z_T, rho, zeta, tau,
                           b_prior_regularization, delta, b_prior_shape, t,
                           p, pstream__));
        } else {
          current_statement__ = 198;
          if (stan::math::logical_eq(prior_dist_for_cov, 2)) {
            current_statement__ = 190;
            if (stan::math::logical_gt(bK1, 0)) {
              current_statement__ = 185;
              lp_accum__.add(stan::math::student_t_lpdf<false>(bSd1,
                               b1_prior_df, 0, b1_prior_scale));
              current_statement__ = 186;
              lp_accum__.add(stan::math::normal_lpdf<false>(
                               stan::math::to_vector(z_bMat1), 0, 1));
              current_statement__ = 188;
              if (stan::math::logical_gt(bK1, 1)) {
                current_statement__ = 187;
                lp_accum__.add(stan::math::lkj_corr_cholesky_lpdf<false>(
                                 bCholesky1, b1_prior_regularization));
              }
            }
            current_statement__ = 196;
            if (stan::math::logical_gt(bK2, 0)) {
              current_statement__ = 191;
              lp_accum__.add(stan::math::student_t_lpdf<false>(bSd2,
                               b2_prior_df, 0, b2_prior_scale));
              current_statement__ = 192;
              lp_accum__.add(stan::math::normal_lpdf<false>(
                               stan::math::to_vector(z_bMat2), 0, 1));
              current_statement__ = 194;
              if (stan::math::logical_gt(bK2, 1)) {
                current_statement__ = 193;
                lp_accum__.add(stan::math::lkj_corr_cholesky_lpdf<false>(
                                 bCholesky2, b2_prior_regularization));
              }
            }
          }
        }
      }
    } 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_mvmer_namespace::write_array";
    // suppress unused var warning
    (void) function__;
    try {
      std::vector<double> yGamma1 =
        std::vector<double>(yGamma1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 1;
      yGamma1 = in__.template read_constrain_lub<
                  std::vector<local_scalar_t__>,
                  jacobian__>(lb(
                                stan::model::rvalue(intercept_type,
                                  "intercept_type", stan::model::index_uni(1)),
                                pstream__),
                  ub(
                    stan::model::rvalue(intercept_type, "intercept_type",
                      stan::model::index_uni(1)), pstream__), lp__,
                  yGamma1_1dim__);
      std::vector<double> yGamma2 =
        std::vector<double>(yGamma2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 2;
      yGamma2 = in__.template read_constrain_lub<
                  std::vector<local_scalar_t__>,
                  jacobian__>(lb(
                                stan::model::rvalue(intercept_type,
                                  "intercept_type", stan::model::index_uni(2)),
                                pstream__),
                  ub(
                    stan::model::rvalue(intercept_type, "intercept_type",
                      stan::model::index_uni(2)), pstream__), lp__,
                  yGamma2_1dim__);
      std::vector<double> yGamma3 =
        std::vector<double>(yGamma3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 3;
      yGamma3 = in__.template read_constrain_lub<
                  std::vector<local_scalar_t__>,
                  jacobian__>(lb(
                                stan::model::rvalue(intercept_type,
                                  "intercept_type", stan::model::index_uni(3)),
                                pstream__),
                  ub(
                    stan::model::rvalue(intercept_type, "intercept_type",
                      stan::model::index_uni(3)), pstream__), lp__,
                  yGamma3_1dim__);
      Eigen::Matrix<double,-1,1> z_yBeta1 =
        Eigen::Matrix<double,-1,1>::Constant(z_yBeta1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 4;
      z_yBeta1 = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta1_1dim__);
      Eigen::Matrix<double,-1,1> z_yBeta2 =
        Eigen::Matrix<double,-1,1>::Constant(z_yBeta2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 5;
      z_yBeta2 = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta2_1dim__);
      Eigen::Matrix<double,-1,1> z_yBeta3 =
        Eigen::Matrix<double,-1,1>::Constant(z_yBeta3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 6;
      z_yBeta3 = in__.template read<
                   Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta3_1dim__);
      Eigen::Matrix<double,-1,1> z_b =
        Eigen::Matrix<double,-1,1>::Constant(z_b_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 7;
      z_b = in__.template read<
              Eigen::Matrix<local_scalar_t__,-1,1>>(z_b_1dim__);
      Eigen::Matrix<double,-1,1> z_T =
        Eigen::Matrix<double,-1,1>::Constant(z_T_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 8;
      z_T = in__.template read<
              Eigen::Matrix<local_scalar_t__,-1,1>>(z_T_1dim__);
      Eigen::Matrix<double,-1,1> rho =
        Eigen::Matrix<double,-1,1>::Constant(rho_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 9;
      rho = in__.template read_constrain_lub<
              Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, 1, lp__,
              rho_1dim__);
      Eigen::Matrix<double,-1,1> zeta =
        Eigen::Matrix<double,-1,1>::Constant(zeta_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 10;
      zeta = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               zeta_1dim__);
      Eigen::Matrix<double,-1,1> tau =
        Eigen::Matrix<double,-1,1>::Constant(tau_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 11;
      tau = in__.template read_constrain_lb<
              Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
              tau_1dim__);
      Eigen::Matrix<double,-1,1> bSd1 =
        Eigen::Matrix<double,-1,1>::Constant(bSd1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 12;
      bSd1 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               bSd1_1dim__);
      Eigen::Matrix<double,-1,-1> z_bMat1 =
        Eigen::Matrix<double,-1,-1>::Constant(z_bMat1_1dim__, z_bMat1_2dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 13;
      z_bMat1 = in__.template read<
                  Eigen::Matrix<local_scalar_t__,-1,-1>>(z_bMat1_1dim__,
                  z_bMat1_2dim__);
      Eigen::Matrix<double,-1,-1> bCholesky1 =
        Eigen::Matrix<double,-1,-1>::Constant(bCholesky1_1dim__,
          bCholesky1_2dim__, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 14;
      bCholesky1 = in__.template read_constrain_cholesky_factor_corr<
                     Eigen::Matrix<local_scalar_t__,-1,-1>, jacobian__>(lp__,
                     bCholesky1_2dim__);
      Eigen::Matrix<double,-1,1> bSd2 =
        Eigen::Matrix<double,-1,1>::Constant(bSd2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 15;
      bSd2 = in__.template read_constrain_lb<
               Eigen::Matrix<local_scalar_t__,-1,1>, jacobian__>(0, lp__,
               bSd2_1dim__);
      Eigen::Matrix<double,-1,-1> z_bMat2 =
        Eigen::Matrix<double,-1,-1>::Constant(z_bMat2_1dim__, z_bMat2_2dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 16;
      z_bMat2 = in__.template read<
                  Eigen::Matrix<local_scalar_t__,-1,-1>>(z_bMat2_1dim__,
                  z_bMat2_2dim__);
      Eigen::Matrix<double,-1,-1> bCholesky2 =
        Eigen::Matrix<double,-1,-1>::Constant(bCholesky2_1dim__,
          bCholesky2_2dim__, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 17;
      bCholesky2 = in__.template read_constrain_cholesky_factor_corr<
                     Eigen::Matrix<local_scalar_t__,-1,-1>, jacobian__>(lp__,
                     bCholesky2_2dim__);
      std::vector<double> yAux1_unscaled =
        std::vector<double>(yAux1_unscaled_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 18;
      yAux1_unscaled = in__.template read_constrain_lb<
                         std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                         yAux1_unscaled_1dim__);
      std::vector<double> yAux2_unscaled =
        std::vector<double>(yAux2_unscaled_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 19;
      yAux2_unscaled = in__.template read_constrain_lb<
                         std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                         yAux2_unscaled_1dim__);
      std::vector<double> yAux3_unscaled =
        std::vector<double>(yAux3_unscaled_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 20;
      yAux3_unscaled = in__.template read_constrain_lb<
                         std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                         yAux3_unscaled_1dim__);
      std::vector<double> yGlobal1 =
        std::vector<double>(yHs1, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 21;
      yGlobal1 = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, yHs1);
      std::vector<double> yGlobal2 =
        std::vector<double>(yHs2, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 22;
      yGlobal2 = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, yHs2);
      std::vector<double> yGlobal3 =
        std::vector<double>(yHs3, std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 23;
      yGlobal3 = in__.template read_constrain_lb<
                   std::vector<local_scalar_t__>, jacobian__>(0, lp__, yHs3);
      std::vector<Eigen::Matrix<double,-1,1>> yLocal1 =
        std::vector<Eigen::Matrix<double,-1,1>>(yHs1,
          Eigen::Matrix<double,-1,1>::Constant(yLocal1_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 24;
      yLocal1 = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, yHs1, yLocal1_2dim__);
      std::vector<Eigen::Matrix<double,-1,1>> yLocal2 =
        std::vector<Eigen::Matrix<double,-1,1>>(yHs2,
          Eigen::Matrix<double,-1,1>::Constant(yLocal2_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 25;
      yLocal2 = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, yHs2, yLocal2_2dim__);
      std::vector<Eigen::Matrix<double,-1,1>> yLocal3 =
        std::vector<Eigen::Matrix<double,-1,1>>(yHs3,
          Eigen::Matrix<double,-1,1>::Constant(yLocal3_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 26;
      yLocal3 = in__.template read_constrain_lb<
                  std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                  jacobian__>(0, lp__, yHs3, yLocal3_2dim__);
      std::vector<double> y_caux1 =
        std::vector<double>(y_caux1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 27;
      y_caux1 = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                  y_caux1_1dim__);
      std::vector<double> y_caux2 =
        std::vector<double>(y_caux2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 28;
      y_caux2 = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                  y_caux2_1dim__);
      std::vector<double> y_caux3 =
        std::vector<double>(y_caux3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 29;
      y_caux3 = in__.template read_constrain_lb<
                  std::vector<local_scalar_t__>, jacobian__>(0, lp__,
                  y_caux3_1dim__);
      std::vector<double> yOol1 =
        std::vector<double>(yOol1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 30;
      yOol1 = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, yOol1_1dim__);
      std::vector<double> yOol2 =
        std::vector<double>(yOol2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 31;
      yOol2 = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, yOol2_1dim__);
      std::vector<double> yOol3 =
        std::vector<double>(yOol3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 32;
      yOol3 = in__.template read_constrain_lb<std::vector<local_scalar_t__>,
                jacobian__>(0, lp__, yOol3_1dim__);
      std::vector<Eigen::Matrix<double,-1,1>> yMix1 =
        std::vector<Eigen::Matrix<double,-1,1>>(yMix1_1dim__,
          Eigen::Matrix<double,-1,1>::Constant(yMix1_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 33;
      yMix1 = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, yMix1_1dim__, yMix1_2dim__);
      std::vector<Eigen::Matrix<double,-1,1>> yMix2 =
        std::vector<Eigen::Matrix<double,-1,1>>(yMix2_1dim__,
          Eigen::Matrix<double,-1,1>::Constant(yMix2_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 34;
      yMix2 = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, yMix2_1dim__, yMix2_2dim__);
      std::vector<Eigen::Matrix<double,-1,1>> yMix3 =
        std::vector<Eigen::Matrix<double,-1,1>>(yMix3_1dim__,
          Eigen::Matrix<double,-1,1>::Constant(yMix3_2dim__,
            std::numeric_limits<double>::quiet_NaN()));
      current_statement__ = 35;
      yMix3 = in__.template read_constrain_lb<
                std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>,
                jacobian__>(0, lp__, yMix3_1dim__, yMix3_2dim__);
      Eigen::Matrix<double,-1,1> yBeta1 =
        Eigen::Matrix<double,-1,1>::Constant(yBeta1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> yBeta2 =
        Eigen::Matrix<double,-1,1>::Constant(yBeta2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> yBeta3 =
        Eigen::Matrix<double,-1,1>::Constant(yBeta3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      std::vector<double> yAux1 =
        std::vector<double>(yAux1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      std::vector<double> yAux2 =
        std::vector<double>(yAux2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      std::vector<double> yAux3 =
        std::vector<double>(yAux3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> theta_L =
        Eigen::Matrix<double,-1,1>::Constant(len_theta_L,
          std::numeric_limits<double>::quiet_NaN());
      double yAuxMaximum = std::numeric_limits<double>::quiet_NaN();
      Eigen::Matrix<double,-1,-1> bMat1 =
        Eigen::Matrix<double,-1,-1>::Constant(bMat1_1dim__, bK1,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,-1> bMat2 =
        Eigen::Matrix<double,-1,-1>::Constant(bMat2_1dim__, bK2,
          std::numeric_limits<double>::quiet_NaN());
      out__.write(yGamma1);
      out__.write(yGamma2);
      out__.write(yGamma3);
      out__.write(z_yBeta1);
      out__.write(z_yBeta2);
      out__.write(z_yBeta3);
      out__.write(z_b);
      out__.write(z_T);
      out__.write(rho);
      out__.write(zeta);
      out__.write(tau);
      out__.write(bSd1);
      out__.write(z_bMat1);
      out__.write(bCholesky1);
      out__.write(bSd2);
      out__.write(z_bMat2);
      out__.write(bCholesky2);
      out__.write(yAux1_unscaled);
      out__.write(yAux2_unscaled);
      out__.write(yAux3_unscaled);
      out__.write(yGlobal1);
      out__.write(yGlobal2);
      out__.write(yGlobal3);
      for (int sym1__ = 1; sym1__ <= yLocal1_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= yHs1; ++sym2__) {
          out__.write(yLocal1[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      for (int sym1__ = 1; sym1__ <= yLocal2_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= yHs2; ++sym2__) {
          out__.write(yLocal2[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      for (int sym1__ = 1; sym1__ <= yLocal3_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= yHs3; ++sym2__) {
          out__.write(yLocal3[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      out__.write(y_caux1);
      out__.write(y_caux2);
      out__.write(y_caux3);
      out__.write(yOol1);
      out__.write(yOol2);
      out__.write(yOol3);
      for (int sym1__ = 1; sym1__ <= yMix1_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= yMix1_1dim__; ++sym2__) {
          out__.write(yMix1[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      for (int sym1__ = 1; sym1__ <= yMix2_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= yMix2_1dim__; ++sym2__) {
          out__.write(yMix2[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      for (int sym1__ = 1; sym1__ <= yMix3_2dim__; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= yMix3_1dim__; ++sym2__) {
          out__.write(yMix3[(sym2__ - 1)][(sym1__ - 1)]);
        }
      }
      if (stan::math::logical_negation(
            (stan::math::primitive_value(emit_transformed_parameters__) ||
            stan::math::primitive_value(emit_generated_quantities__)))) {
        return ;
      }
      current_statement__ = 43;
      yAuxMaximum = 1.0;
      current_statement__ = 58;
      if (stan::math::logical_eq(
            stan::model::rvalue(has_aux, "has_aux", stan::model::index_uni(1)),
            1)) {
        current_statement__ = 54;
        stan::model::assign(yAux1,
          make_aux(
            stan::model::rvalue(yAux1_unscaled, "yAux1_unscaled",
              stan::model::index_uni(1)),
            stan::model::rvalue(y_prior_dist_for_aux, "y_prior_dist_for_aux",
              stan::model::index_uni(1)),
            stan::model::rvalue(y_prior_mean_for_aux, "y_prior_mean_for_aux",
              stan::model::index_uni(1)),
            stan::model::rvalue(y_prior_scale_for_aux,
              "y_prior_scale_for_aux", stan::model::index_uni(1)), pstream__),
          "assigning variable yAux1", stan::model::index_uni(1));
        current_statement__ = 56;
        if (stan::math::logical_gt(
              stan::model::rvalue(yAux1, "yAux1", stan::model::index_uni(1)),
              yAuxMaximum)) {
          current_statement__ = 55;
          yAuxMaximum = stan::model::rvalue(yAux1, "yAux1",
                          stan::model::index_uni(1));
        }
      }
      current_statement__ = 60;
      if (stan::math::logical_gt(
            stan::model::rvalue(yK, "yK", stan::model::index_uni(1)), 0)) {
        current_statement__ = 59;
        stan::model::assign(yBeta1,
          make_beta(z_yBeta1,
            stan::model::rvalue(y_prior_dist, "y_prior_dist",
              stan::model::index_uni(1)), y_prior_mean1, y_prior_scale1,
            y_prior_df1,
            stan::model::rvalue(y_global_prior_scale, "y_global_prior_scale",
              stan::model::index_uni(1)), yGlobal1, yLocal1, yOol1, yMix1,
            yAux1,
            stan::model::rvalue(family, "family", stan::model::index_uni(1)),
            stan::model::rvalue(y_slab_scale, "y_slab_scale",
              stan::model::index_uni(1)), y_caux1, pstream__),
          "assigning variable yBeta1");
      }
      current_statement__ = 69;
      if (stan::math::logical_gt(M, 1)) {
        current_statement__ = 65;
        if (stan::math::logical_eq(
              stan::model::rvalue(has_aux, "has_aux",
                stan::model::index_uni(2)), 1)) {
          current_statement__ = 61;
          stan::model::assign(yAux2,
            make_aux(
              stan::model::rvalue(yAux2_unscaled, "yAux2_unscaled",
                stan::model::index_uni(1)),
              stan::model::rvalue(y_prior_dist_for_aux,
                "y_prior_dist_for_aux", stan::model::index_uni(2)),
              stan::model::rvalue(y_prior_mean_for_aux,
                "y_prior_mean_for_aux", stan::model::index_uni(2)),
              stan::model::rvalue(y_prior_scale_for_aux,
                "y_prior_scale_for_aux", stan::model::index_uni(2)),
              pstream__), "assigning variable yAux2",
            stan::model::index_uni(1));
          current_statement__ = 63;
          if (stan::math::logical_gt(
                stan::model::rvalue(yAux2, "yAux2", stan::model::index_uni(1)),
                yAuxMaximum)) {
            current_statement__ = 62;
            yAuxMaximum = stan::model::rvalue(yAux2, "yAux2",
                            stan::model::index_uni(1));
          }
        }
        current_statement__ = 67;
        if (stan::math::logical_gt(
              stan::model::rvalue(yK, "yK", stan::model::index_uni(2)), 0)) {
          current_statement__ = 66;
          stan::model::assign(yBeta2,
            make_beta(z_yBeta2,
              stan::model::rvalue(y_prior_dist, "y_prior_dist",
                stan::model::index_uni(2)), y_prior_mean2, y_prior_scale2,
              y_prior_df2,
              stan::model::rvalue(y_global_prior_scale,
                "y_global_prior_scale", stan::model::index_uni(2)), yGlobal2,
              yLocal2, yOol2, yMix2, yAux2,
              stan::model::rvalue(family, "family", stan::model::index_uni(2)),
              stan::model::rvalue(y_slab_scale, "y_slab_scale",
                stan::model::index_uni(2)), y_caux2, pstream__),
            "assigning variable yBeta2");
        }
      }
      current_statement__ = 78;
      if (stan::math::logical_gt(M, 2)) {
        current_statement__ = 74;
        if (stan::math::logical_eq(
              stan::model::rvalue(has_aux, "has_aux",
                stan::model::index_uni(3)), 1)) {
          current_statement__ = 70;
          stan::model::assign(yAux3,
            make_aux(
              stan::model::rvalue(yAux3_unscaled, "yAux3_unscaled",
                stan::model::index_uni(1)),
              stan::model::rvalue(y_prior_dist_for_aux,
                "y_prior_dist_for_aux", stan::model::index_uni(3)),
              stan::model::rvalue(y_prior_mean_for_aux,
                "y_prior_mean_for_aux", stan::model::index_uni(3)),
              stan::model::rvalue(y_prior_scale_for_aux,
                "y_prior_scale_for_aux", stan::model::index_uni(3)),
              pstream__), "assigning variable yAux3",
            stan::model::index_uni(1));
          current_statement__ = 72;
          if (stan::math::logical_gt(
                stan::model::rvalue(yAux3, "yAux3", stan::model::index_uni(1)),
                yAuxMaximum)) {
            current_statement__ = 71;
            yAuxMaximum = stan::model::rvalue(yAux3, "yAux3",
                            stan::model::index_uni(1));
          }
        }
        current_statement__ = 76;
        if (stan::math::logical_gt(
              stan::model::rvalue(yK, "yK", stan::model::index_uni(3)), 0)) {
          current_statement__ = 75;
          stan::model::assign(yBeta3,
            make_beta(z_yBeta3,
              stan::model::rvalue(y_prior_dist, "y_prior_dist",
                stan::model::index_uni(3)), y_prior_mean3, y_prior_scale3,
              y_prior_df3,
              stan::model::rvalue(y_global_prior_scale,
                "y_global_prior_scale", stan::model::index_uni(3)), yGlobal3,
              yLocal3, yOol3, yMix3, yAux3,
              stan::model::rvalue(family, "family", stan::model::index_uni(3)),
              stan::model::rvalue(y_slab_scale, "y_slab_scale",
                stan::model::index_uni(3)), y_caux3, pstream__),
            "assigning variable yBeta3");
        }
      }
      current_statement__ = 96;
      if (stan::math::logical_eq(prior_dist_for_cov, 1)) {
        int mark = std::numeric_limits<int>::min();
        current_statement__ = 89;
        mark = 1;
        current_statement__ = 90;
        stan::model::assign(theta_L,
          make_theta_L(len_theta_L, p, yAuxMaximum, tau, b_prior_scale, zeta,
            rho, z_T, pstream__), "assigning variable theta_L");
        current_statement__ = 92;
        if (stan::math::logical_gt(bK1, 0)) {
          current_statement__ = 91;
          stan::model::assign(bMat1,
            make_b_matrix(z_b, theta_L, p, l, 1, pstream__),
            "assigning variable bMat1");
        }
        current_statement__ = 94;
        if (stan::math::logical_gt(bK2, 0)) {
          current_statement__ = 93;
          stan::model::assign(bMat2,
            make_b_matrix(z_b, theta_L, p, l, 2, pstream__),
            "assigning variable bMat2");
        }
      } else {
        current_statement__ = 88;
        if (stan::math::logical_eq(prior_dist_for_cov, 2)) {
          current_statement__ = 82;
          if (stan::math::logical_eq(bK1, 1)) {
            current_statement__ = 81;
            stan::model::assign(bMat1,
              stan::math::transpose(
                stan::math::multiply(
                  stan::model::rvalue(bSd1, "bSd1", stan::model::index_uni(1)),
                  z_bMat1)), "assigning variable bMat1");
          } else {
            current_statement__ = 80;
            if (stan::math::logical_gt(bK1, 1)) {
              current_statement__ = 79;
              stan::model::assign(bMat1,
                stan::math::transpose(
                  stan::math::multiply(
                    stan::math::diag_pre_multiply(bSd1, bCholesky1), z_bMat1)),
                "assigning variable bMat1");
            }
          }
          current_statement__ = 86;
          if (stan::math::logical_eq(bK2, 1)) {
            current_statement__ = 85;
            stan::model::assign(bMat2,
              stan::math::transpose(
                stan::math::multiply(
                  stan::model::rvalue(bSd2, "bSd2", stan::model::index_uni(1)),
                  z_bMat2)), "assigning variable bMat2");
          } else {
            current_statement__ = 84;
            if (stan::math::logical_gt(bK2, 1)) {
              current_statement__ = 83;
              stan::model::assign(bMat2,
                stan::math::transpose(
                  stan::math::multiply(
                    stan::math::diag_pre_multiply(bSd2, bCholesky2), z_bMat2)),
                "assigning variable bMat2");
            }
          }
        }
      }
      if (emit_transformed_parameters__) {
        out__.write(yBeta1);
        out__.write(yBeta2);
        out__.write(yBeta3);
        out__.write(yAux1);
        out__.write(yAux2);
        out__.write(yAux3);
        out__.write(theta_L);
        out__.write(yAuxMaximum);
        out__.write(bMat1);
        out__.write(bMat2);
      }
      if (stan::math::logical_negation(emit_generated_quantities__)) {
        return ;
      }
      std::vector<double> mean_PPD =
        std::vector<double>(M, std::numeric_limits<double>::quiet_NaN());
      std::vector<double> yAlpha1 =
        std::vector<double>(yAlpha1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      std::vector<double> yAlpha2 =
        std::vector<double>(yAlpha2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      std::vector<double> yAlpha3 =
        std::vector<double>(yAlpha3_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> bCov1 =
        Eigen::Matrix<double,-1,1>::Constant(bCov1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> bCov2 =
        Eigen::Matrix<double,-1,1>::Constant(bCov2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      Eigen::Matrix<double,-1,1> b1 =
        Eigen::Matrix<double,-1,1>::Constant(b1_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 52;
      stan::model::assign(b1,
        stan::math::to_vector(stan::math::transpose(bMat1)),
        "assigning variable b1");
      Eigen::Matrix<double,-1,1> b2 =
        Eigen::Matrix<double,-1,1>::Constant(b2_1dim__,
          std::numeric_limits<double>::quiet_NaN());
      current_statement__ = 53;
      stan::model::assign(b2,
        stan::math::to_vector(stan::math::transpose(bMat2)),
        "assigning variable b2");
      {
        int bMat1_colshift = std::numeric_limits<int>::min();
        current_statement__ = 97;
        bMat1_colshift = 0;
        int bMat2_colshift = std::numeric_limits<int>::min();
        current_statement__ = 98;
        bMat2_colshift = 0;
        current_statement__ = 103;
        if (stan::math::logical_gt(M, 0)) {
          current_statement__ = 99;
          stan::math::validate_non_negative_index("yEta1", "yNeta[1]",
            stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(1)));
          Eigen::Matrix<double,-1,1> yEta1 =
            Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(yNeta,
                                                   "yNeta",
                                                   stan::model::index_uni(1)),
              std::numeric_limits<double>::quiet_NaN());
          current_statement__ = 100;
          stan::model::assign(yEta1,
            evaluate_mu(
              evaluate_eta(yX1, y1_Z1, y1_Z2, y1_Z1_id, y1_Z2_id, yGamma1,
                yBeta1, bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                stan::model::rvalue(intercept_type, "intercept_type",
                  stan::model::index_uni(1)), y1_offset, pstream__),
              stan::model::rvalue(family, "family", stan::model::index_uni(1)),
              stan::model::rvalue(link, "link", stan::model::index_uni(1)),
              pstream__), "assigning variable yEta1");
          current_statement__ = 101;
          stan::model::assign(mean_PPD,
            mean_PPD_rng(yEta1, yAux1,
              stan::model::rvalue(family, "family", stan::model::index_uni(1)),
              base_rng__, pstream__), "assigning variable mean_PPD",
            stan::model::index_uni(1));
        }
        current_statement__ = 111;
        if (stan::math::logical_gt(M, 1)) {
          current_statement__ = 104;
          stan::math::validate_non_negative_index("yEta2", "yNeta[2]",
            stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(2)));
          Eigen::Matrix<double,-1,1> yEta2 =
            Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(yNeta,
                                                   "yNeta",
                                                   stan::model::index_uni(2)),
              std::numeric_limits<double>::quiet_NaN());
          current_statement__ = 106;
          bMat1_colshift = (bMat1_colshift +
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(1)));
          current_statement__ = 107;
          bMat2_colshift = (bMat2_colshift +
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(1)));
          current_statement__ = 108;
          stan::model::assign(yEta2,
            evaluate_mu(
              evaluate_eta(yX2, y2_Z1, y2_Z2, y2_Z1_id, y2_Z2_id, yGamma2,
                yBeta2, bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                stan::model::rvalue(intercept_type, "intercept_type",
                  stan::model::index_uni(2)), y2_offset, pstream__),
              stan::model::rvalue(family, "family", stan::model::index_uni(2)),
              stan::model::rvalue(link, "link", stan::model::index_uni(2)),
              pstream__), "assigning variable yEta2");
          current_statement__ = 109;
          stan::model::assign(mean_PPD,
            mean_PPD_rng(yEta2, yAux2,
              stan::model::rvalue(family, "family", stan::model::index_uni(2)),
              base_rng__, pstream__), "assigning variable mean_PPD",
            stan::model::index_uni(2));
        }
        current_statement__ = 119;
        if (stan::math::logical_gt(M, 2)) {
          current_statement__ = 112;
          stan::math::validate_non_negative_index("yEta3", "yNeta[3]",
            stan::model::rvalue(yNeta, "yNeta", stan::model::index_uni(3)));
          Eigen::Matrix<double,-1,1> yEta3 =
            Eigen::Matrix<double,-1,1>::Constant(stan::model::rvalue(yNeta,
                                                   "yNeta",
                                                   stan::model::index_uni(3)),
              std::numeric_limits<double>::quiet_NaN());
          current_statement__ = 114;
          bMat1_colshift = (bMat1_colshift +
            stan::model::rvalue(bK1_len, "bK1_len", stan::model::index_uni(2)));
          current_statement__ = 115;
          bMat2_colshift = (bMat2_colshift +
            stan::model::rvalue(bK2_len, "bK2_len", stan::model::index_uni(2)));
          current_statement__ = 116;
          stan::model::assign(yEta3,
            evaluate_mu(
              evaluate_eta(yX3, y3_Z1, y3_Z2, y3_Z1_id, y3_Z2_id, yGamma3,
                yBeta3, bMat1, bMat2, bMat1_colshift, bMat2_colshift,
                stan::model::rvalue(intercept_type, "intercept_type",
                  stan::model::index_uni(3)), y3_offset, pstream__),
              stan::model::rvalue(family, "family", stan::model::index_uni(3)),
              stan::model::rvalue(link, "link", stan::model::index_uni(3)),
              pstream__), "assigning variable yEta3");
          current_statement__ = 117;
          stan::model::assign(mean_PPD,
            mean_PPD_rng(yEta3, yAux3,
              stan::model::rvalue(family, "family", stan::model::index_uni(3)),
              base_rng__, pstream__), "assigning variable mean_PPD",
            stan::model::index_uni(3));
        }
      }
      current_statement__ = 122;
      if (stan::math::logical_gt(
            stan::model::rvalue(intercept_type, "intercept_type",
              stan::model::index_uni(1)), 0)) {
        current_statement__ = 121;
        stan::model::assign(yAlpha1,
          (stan::model::rvalue(yGamma1, "yGamma1", stan::model::index_uni(1))
          - stan::math::dot_product(yXbar1, yBeta1)),
          "assigning variable yAlpha1", stan::model::index_uni(1));
      }
      current_statement__ = 124;
      if ((stan::math::primitive_value(stan::math::logical_gt(M, 1)) &&
          stan::math::primitive_value(
            stan::math::logical_gt(
              stan::model::rvalue(intercept_type, "intercept_type",
                stan::model::index_uni(2)), 0)))) {
        current_statement__ = 123;
        stan::model::assign(yAlpha2,
          (stan::model::rvalue(yGamma2, "yGamma2", stan::model::index_uni(1))
          - stan::math::dot_product(yXbar2, yBeta2)),
          "assigning variable yAlpha2", stan::model::index_uni(1));
      }
      current_statement__ = 126;
      if ((stan::math::primitive_value(stan::math::logical_gt(M, 2)) &&
          stan::math::primitive_value(
            stan::math::logical_gt(
              stan::model::rvalue(intercept_type, "intercept_type",
                stan::model::index_uni(3)), 0)))) {
        current_statement__ = 125;
        stan::model::assign(yAlpha3,
          (stan::model::rvalue(yGamma3, "yGamma3", stan::model::index_uni(1))
          - stan::math::dot_product(yXbar3, yBeta3)),
          "assigning variable yAlpha3", stan::model::index_uni(1));
      }
      current_statement__ = 132;
      if ((stan::math::primitive_value(
             stan::math::logical_eq(prior_dist_for_cov, 2))
          && stan::math::primitive_value(stan::math::logical_eq(bK1, 1)))) {
        current_statement__ = 130;
        stan::model::assign(bCov1,
          (stan::model::rvalue(bSd1, "bSd1", stan::model::index_uni(1)) *
          stan::model::rvalue(bSd1, "bSd1", stan::model::index_uni(1))),
          "assigning variable bCov1", stan::model::index_uni(1));
      } else {
        current_statement__ = 129;
        if ((stan::math::primitive_value(
               stan::math::logical_eq(prior_dist_for_cov, 2))
            && stan::math::primitive_value(stan::math::logical_gt(bK1, 1)))) {
          current_statement__ = 127;
          stan::model::assign(bCov1,
            stan::model::rvalue(
              stan::math::to_vector(
                stan::math::quad_form_diag(
                  stan::math::multiply_lower_tri_self_transpose(bCholesky1),
                  bSd1)),
              "to_vector(quad_form_diag(multiply_lower_tri_self_transpose(bCholesky1),\nbSd1))",
              stan::model::index_multi(bCov1_idx)),
            "assigning variable bCov1");
        }
      }
      current_statement__ = 138;
      if ((stan::math::primitive_value(
             stan::math::logical_eq(prior_dist_for_cov, 2))
          && stan::math::primitive_value(stan::math::logical_eq(bK2, 1)))) {
        current_statement__ = 136;
        stan::model::assign(bCov2,
          (stan::model::rvalue(bSd2, "bSd2", stan::model::index_uni(1)) *
          stan::model::rvalue(bSd2, "bSd2", stan::model::index_uni(1))),
          "assigning variable bCov2", stan::model::index_uni(1));
      } else {
        current_statement__ = 135;
        if ((stan::math::primitive_value(
               stan::math::logical_eq(prior_dist_for_cov, 2))
            && stan::math::primitive_value(stan::math::logical_gt(bK2, 1)))) {
          current_statement__ = 133;
          stan::model::assign(bCov2,
            stan::model::rvalue(
              stan::math::to_vector(
                stan::math::quad_form_diag(
                  stan::math::multiply_lower_tri_self_transpose(bCholesky2),
                  bSd2)),
              "to_vector(quad_form_diag(multiply_lower_tri_self_transpose(bCholesky2),\nbSd2))",
              stan::model::index_multi(bCov2_idx)),
            "assigning variable bCov2");
        }
      }
      out__.write(mean_PPD);
      out__.write(yAlpha1);
      out__.write(yAlpha2);
      out__.write(yAlpha3);
      out__.write(bCov1);
      out__.write(bCov2);
      out__.write(b1);
      out__.write(b2);
    } catch (const std::exception& e) {
      stan::lang::rethrow_located(e, locations_array__[current_statement__]);
    }
  }
  template <typename VecVar, typename VecI,
            stan::require_vector_t<VecVar>* = nullptr,
            stan::require_vector_like_vt<std::is_integral, VecI>* = nullptr>
  inline void
  unconstrain_array_impl(const VecVar& params_r__, const VecI& params_i__,
                         VecVar& vars__, std::ostream* pstream__ = nullptr) const {
    using local_scalar_t__ = double;
    stan::io::deserializer<local_scalar_t__> in__(params_r__, params_i__);
    stan::io::serializer<local_scalar_t__> out__(vars__);
    int current_statement__ = 0;
    local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
    // suppress unused var warning
    (void) DUMMY_VAR__;
    try {
      int pos__ = std::numeric_limits<int>::min();
      pos__ = 1;
      std::vector<local_scalar_t__> yGamma1 =
        std::vector<local_scalar_t__>(yGamma1_1dim__, DUMMY_VAR__);
      current_statement__ = 1;
      stan::model::assign(yGamma1,
        in__.read<std::vector<local_scalar_t__>>(yGamma1_1dim__),
        "assigning variable yGamma1");
      out__.write_free_lub(lb(
                             stan::model::rvalue(intercept_type,
                               "intercept_type", stan::model::index_uni(1)),
                             pstream__),
        ub(
          stan::model::rvalue(intercept_type, "intercept_type",
            stan::model::index_uni(1)), pstream__), yGamma1);
      std::vector<local_scalar_t__> yGamma2 =
        std::vector<local_scalar_t__>(yGamma2_1dim__, DUMMY_VAR__);
      current_statement__ = 2;
      stan::model::assign(yGamma2,
        in__.read<std::vector<local_scalar_t__>>(yGamma2_1dim__),
        "assigning variable yGamma2");
      out__.write_free_lub(lb(
                             stan::model::rvalue(intercept_type,
                               "intercept_type", stan::model::index_uni(2)),
                             pstream__),
        ub(
          stan::model::rvalue(intercept_type, "intercept_type",
            stan::model::index_uni(2)), pstream__), yGamma2);
      std::vector<local_scalar_t__> yGamma3 =
        std::vector<local_scalar_t__>(yGamma3_1dim__, DUMMY_VAR__);
      current_statement__ = 3;
      stan::model::assign(yGamma3,
        in__.read<std::vector<local_scalar_t__>>(yGamma3_1dim__),
        "assigning variable yGamma3");
      out__.write_free_lub(lb(
                             stan::model::rvalue(intercept_type,
                               "intercept_type", stan::model::index_uni(3)),
                             pstream__),
        ub(
          stan::model::rvalue(intercept_type, "intercept_type",
            stan::model::index_uni(3)), pstream__), yGamma3);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta1_1dim__,
          DUMMY_VAR__);
      current_statement__ = 4;
      stan::model::assign(z_yBeta1,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta1_1dim__),
        "assigning variable z_yBeta1");
      out__.write(z_yBeta1);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta2_1dim__,
          DUMMY_VAR__);
      current_statement__ = 5;
      stan::model::assign(z_yBeta2,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta2_1dim__),
        "assigning variable z_yBeta2");
      out__.write(z_yBeta2);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta3_1dim__,
          DUMMY_VAR__);
      current_statement__ = 6;
      stan::model::assign(z_yBeta3,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(z_yBeta3_1dim__),
        "assigning variable z_yBeta3");
      out__.write(z_yBeta3);
      Eigen::Matrix<local_scalar_t__,-1,1> z_b =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_b_1dim__,
          DUMMY_VAR__);
      current_statement__ = 7;
      stan::model::assign(z_b,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(z_b_1dim__),
        "assigning variable z_b");
      out__.write(z_b);
      Eigen::Matrix<local_scalar_t__,-1,1> z_T =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_T_1dim__,
          DUMMY_VAR__);
      current_statement__ = 8;
      stan::model::assign(z_T,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(z_T_1dim__),
        "assigning variable z_T");
      out__.write(z_T);
      Eigen::Matrix<local_scalar_t__,-1,1> rho =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(rho_1dim__,
          DUMMY_VAR__);
      current_statement__ = 9;
      stan::model::assign(rho,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(rho_1dim__),
        "assigning variable rho");
      out__.write_free_lub(0, 1, rho);
      Eigen::Matrix<local_scalar_t__,-1,1> zeta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(zeta_1dim__,
          DUMMY_VAR__);
      current_statement__ = 10;
      stan::model::assign(zeta,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(zeta_1dim__),
        "assigning variable zeta");
      out__.write_free_lb(0, zeta);
      Eigen::Matrix<local_scalar_t__,-1,1> tau =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(tau_1dim__,
          DUMMY_VAR__);
      current_statement__ = 11;
      stan::model::assign(tau,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(tau_1dim__),
        "assigning variable tau");
      out__.write_free_lb(0, tau);
      Eigen::Matrix<local_scalar_t__,-1,1> bSd1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(bSd1_1dim__,
          DUMMY_VAR__);
      current_statement__ = 12;
      stan::model::assign(bSd1,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(bSd1_1dim__),
        "assigning variable bSd1");
      out__.write_free_lb(0, bSd1);
      Eigen::Matrix<local_scalar_t__,-1,-1> z_bMat1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(z_bMat1_1dim__,
          z_bMat1_2dim__, DUMMY_VAR__);
      current_statement__ = 13;
      stan::model::assign(z_bMat1,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,-1>>(z_bMat1_1dim__,
          z_bMat1_2dim__), "assigning variable z_bMat1");
      out__.write(z_bMat1);
      Eigen::Matrix<local_scalar_t__,-1,-1> bCholesky1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bCholesky1_1dim__,
          bCholesky1_2dim__, DUMMY_VAR__);
      current_statement__ = 14;
      stan::model::assign(bCholesky1,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,-1>>(bCholesky1_1dim__,
          bCholesky1_2dim__), "assigning variable bCholesky1");
      out__.write_free_cholesky_factor_corr(bCholesky1);
      Eigen::Matrix<local_scalar_t__,-1,1> bSd2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(bSd2_1dim__,
          DUMMY_VAR__);
      current_statement__ = 15;
      stan::model::assign(bSd2,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,1>>(bSd2_1dim__),
        "assigning variable bSd2");
      out__.write_free_lb(0, bSd2);
      Eigen::Matrix<local_scalar_t__,-1,-1> z_bMat2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(z_bMat2_1dim__,
          z_bMat2_2dim__, DUMMY_VAR__);
      current_statement__ = 16;
      stan::model::assign(z_bMat2,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,-1>>(z_bMat2_1dim__,
          z_bMat2_2dim__), "assigning variable z_bMat2");
      out__.write(z_bMat2);
      Eigen::Matrix<local_scalar_t__,-1,-1> bCholesky2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bCholesky2_1dim__,
          bCholesky2_2dim__, DUMMY_VAR__);
      current_statement__ = 17;
      stan::model::assign(bCholesky2,
        in__.read<Eigen::Matrix<local_scalar_t__,-1,-1>>(bCholesky2_1dim__,
          bCholesky2_2dim__), "assigning variable bCholesky2");
      out__.write_free_cholesky_factor_corr(bCholesky2);
      std::vector<local_scalar_t__> yAux1_unscaled =
        std::vector<local_scalar_t__>(yAux1_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 18;
      stan::model::assign(yAux1_unscaled,
        in__.read<std::vector<local_scalar_t__>>(yAux1_unscaled_1dim__),
        "assigning variable yAux1_unscaled");
      out__.write_free_lb(0, yAux1_unscaled);
      std::vector<local_scalar_t__> yAux2_unscaled =
        std::vector<local_scalar_t__>(yAux2_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 19;
      stan::model::assign(yAux2_unscaled,
        in__.read<std::vector<local_scalar_t__>>(yAux2_unscaled_1dim__),
        "assigning variable yAux2_unscaled");
      out__.write_free_lb(0, yAux2_unscaled);
      std::vector<local_scalar_t__> yAux3_unscaled =
        std::vector<local_scalar_t__>(yAux3_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 20;
      stan::model::assign(yAux3_unscaled,
        in__.read<std::vector<local_scalar_t__>>(yAux3_unscaled_1dim__),
        "assigning variable yAux3_unscaled");
      out__.write_free_lb(0, yAux3_unscaled);
      std::vector<local_scalar_t__> yGlobal1 =
        std::vector<local_scalar_t__>(yHs1, DUMMY_VAR__);
      current_statement__ = 21;
      stan::model::assign(yGlobal1,
        in__.read<std::vector<local_scalar_t__>>(yHs1),
        "assigning variable yGlobal1");
      out__.write_free_lb(0, yGlobal1);
      std::vector<local_scalar_t__> yGlobal2 =
        std::vector<local_scalar_t__>(yHs2, DUMMY_VAR__);
      current_statement__ = 22;
      stan::model::assign(yGlobal2,
        in__.read<std::vector<local_scalar_t__>>(yHs2),
        "assigning variable yGlobal2");
      out__.write_free_lb(0, yGlobal2);
      std::vector<local_scalar_t__> yGlobal3 =
        std::vector<local_scalar_t__>(yHs3, DUMMY_VAR__);
      current_statement__ = 23;
      stan::model::assign(yGlobal3,
        in__.read<std::vector<local_scalar_t__>>(yHs3),
        "assigning variable yGlobal3");
      out__.write_free_lb(0, yGlobal3);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs1,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal1_2dim__,
            DUMMY_VAR__));
      current_statement__ = 24;
      for (int sym1__ = 1; sym1__ <= yLocal1_2dim__; ++sym1__) {
        current_statement__ = 24;
        for (int sym2__ = 1; sym2__ <= yHs1; ++sym2__) {
          current_statement__ = 24;
          stan::model::assign(yLocal1, in__.read<local_scalar_t__>(),
            "assigning variable yLocal1", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, yLocal1);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs2,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal2_2dim__,
            DUMMY_VAR__));
      current_statement__ = 25;
      for (int sym1__ = 1; sym1__ <= yLocal2_2dim__; ++sym1__) {
        current_statement__ = 25;
        for (int sym2__ = 1; sym2__ <= yHs2; ++sym2__) {
          current_statement__ = 25;
          stan::model::assign(yLocal2, in__.read<local_scalar_t__>(),
            "assigning variable yLocal2", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, yLocal2);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs3,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal3_2dim__,
            DUMMY_VAR__));
      current_statement__ = 26;
      for (int sym1__ = 1; sym1__ <= yLocal3_2dim__; ++sym1__) {
        current_statement__ = 26;
        for (int sym2__ = 1; sym2__ <= yHs3; ++sym2__) {
          current_statement__ = 26;
          stan::model::assign(yLocal3, in__.read<local_scalar_t__>(),
            "assigning variable yLocal3", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, yLocal3);
      std::vector<local_scalar_t__> y_caux1 =
        std::vector<local_scalar_t__>(y_caux1_1dim__, DUMMY_VAR__);
      current_statement__ = 27;
      stan::model::assign(y_caux1,
        in__.read<std::vector<local_scalar_t__>>(y_caux1_1dim__),
        "assigning variable y_caux1");
      out__.write_free_lb(0, y_caux1);
      std::vector<local_scalar_t__> y_caux2 =
        std::vector<local_scalar_t__>(y_caux2_1dim__, DUMMY_VAR__);
      current_statement__ = 28;
      stan::model::assign(y_caux2,
        in__.read<std::vector<local_scalar_t__>>(y_caux2_1dim__),
        "assigning variable y_caux2");
      out__.write_free_lb(0, y_caux2);
      std::vector<local_scalar_t__> y_caux3 =
        std::vector<local_scalar_t__>(y_caux3_1dim__, DUMMY_VAR__);
      current_statement__ = 29;
      stan::model::assign(y_caux3,
        in__.read<std::vector<local_scalar_t__>>(y_caux3_1dim__),
        "assigning variable y_caux3");
      out__.write_free_lb(0, y_caux3);
      std::vector<local_scalar_t__> yOol1 =
        std::vector<local_scalar_t__>(yOol1_1dim__, DUMMY_VAR__);
      current_statement__ = 30;
      stan::model::assign(yOol1,
        in__.read<std::vector<local_scalar_t__>>(yOol1_1dim__),
        "assigning variable yOol1");
      out__.write_free_lb(0, yOol1);
      std::vector<local_scalar_t__> yOol2 =
        std::vector<local_scalar_t__>(yOol2_1dim__, DUMMY_VAR__);
      current_statement__ = 31;
      stan::model::assign(yOol2,
        in__.read<std::vector<local_scalar_t__>>(yOol2_1dim__),
        "assigning variable yOol2");
      out__.write_free_lb(0, yOol2);
      std::vector<local_scalar_t__> yOol3 =
        std::vector<local_scalar_t__>(yOol3_1dim__, DUMMY_VAR__);
      current_statement__ = 32;
      stan::model::assign(yOol3,
        in__.read<std::vector<local_scalar_t__>>(yOol3_1dim__),
        "assigning variable yOol3");
      out__.write_free_lb(0, yOol3);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix1_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix1_2dim__,
            DUMMY_VAR__));
      current_statement__ = 33;
      for (int sym1__ = 1; sym1__ <= yMix1_2dim__; ++sym1__) {
        current_statement__ = 33;
        for (int sym2__ = 1; sym2__ <= yMix1_1dim__; ++sym2__) {
          current_statement__ = 33;
          stan::model::assign(yMix1, in__.read<local_scalar_t__>(),
            "assigning variable yMix1", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, yMix1);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix2_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix2_2dim__,
            DUMMY_VAR__));
      current_statement__ = 34;
      for (int sym1__ = 1; sym1__ <= yMix2_2dim__; ++sym1__) {
        current_statement__ = 34;
        for (int sym2__ = 1; sym2__ <= yMix2_1dim__; ++sym2__) {
          current_statement__ = 34;
          stan::model::assign(yMix2, in__.read<local_scalar_t__>(),
            "assigning variable yMix2", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, yMix2);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix3_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix3_2dim__,
            DUMMY_VAR__));
      current_statement__ = 35;
      for (int sym1__ = 1; sym1__ <= yMix3_2dim__; ++sym1__) {
        current_statement__ = 35;
        for (int sym2__ = 1; sym2__ <= yMix3_1dim__; ++sym2__) {
          current_statement__ = 35;
          stan::model::assign(yMix3, in__.read<local_scalar_t__>(),
            "assigning variable yMix3", stan::model::index_uni(sym2__),
            stan::model::index_uni(sym1__));
        }
      }
      out__.write_free_lb(0, yMix3);
    } catch (const std::exception& e) {
      stan::lang::rethrow_located(e, locations_array__[current_statement__]);
    }
  }
  template <typename VecVar, stan::require_vector_t<VecVar>* = nullptr>
  inline void
  transform_inits_impl(const stan::io::var_context& context__, VecVar&
                       vars__, std::ostream* pstream__ = nullptr) const {
    using local_scalar_t__ = double;
    stan::io::serializer<local_scalar_t__> out__(vars__);
    int current_statement__ = 0;
    local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
    // suppress unused var warning
    (void) DUMMY_VAR__;
    try {
      current_statement__ = 1;
      context__.validate_dims("parameter initialization", "yGamma1",
        "double", std::vector<size_t>{static_cast<size_t>(yGamma1_1dim__)});
      current_statement__ = 2;
      context__.validate_dims("parameter initialization", "yGamma2",
        "double", std::vector<size_t>{static_cast<size_t>(yGamma2_1dim__)});
      current_statement__ = 3;
      context__.validate_dims("parameter initialization", "yGamma3",
        "double", std::vector<size_t>{static_cast<size_t>(yGamma3_1dim__)});
      current_statement__ = 4;
      context__.validate_dims("parameter initialization", "z_yBeta1",
        "double", std::vector<size_t>{static_cast<size_t>(z_yBeta1_1dim__)});
      current_statement__ = 5;
      context__.validate_dims("parameter initialization", "z_yBeta2",
        "double", std::vector<size_t>{static_cast<size_t>(z_yBeta2_1dim__)});
      current_statement__ = 6;
      context__.validate_dims("parameter initialization", "z_yBeta3",
        "double", std::vector<size_t>{static_cast<size_t>(z_yBeta3_1dim__)});
      current_statement__ = 7;
      context__.validate_dims("parameter initialization", "z_b", "double",
        std::vector<size_t>{static_cast<size_t>(z_b_1dim__)});
      current_statement__ = 8;
      context__.validate_dims("parameter initialization", "z_T", "double",
        std::vector<size_t>{static_cast<size_t>(z_T_1dim__)});
      current_statement__ = 9;
      context__.validate_dims("parameter initialization", "rho", "double",
        std::vector<size_t>{static_cast<size_t>(rho_1dim__)});
      current_statement__ = 10;
      context__.validate_dims("parameter initialization", "zeta", "double",
        std::vector<size_t>{static_cast<size_t>(zeta_1dim__)});
      current_statement__ = 11;
      context__.validate_dims("parameter initialization", "tau", "double",
        std::vector<size_t>{static_cast<size_t>(tau_1dim__)});
      current_statement__ = 12;
      context__.validate_dims("parameter initialization", "bSd1", "double",
        std::vector<size_t>{static_cast<size_t>(bSd1_1dim__)});
      current_statement__ = 13;
      context__.validate_dims("parameter initialization", "z_bMat1",
        "double",
        std::vector<size_t>{static_cast<size_t>(z_bMat1_1dim__),
          static_cast<size_t>(z_bMat1_2dim__)});
      current_statement__ = 14;
      context__.validate_dims("parameter initialization", "bCholesky1",
        "double",
        std::vector<size_t>{static_cast<size_t>(bCholesky1_1dim__),
          static_cast<size_t>(bCholesky1_2dim__)});
      current_statement__ = 15;
      context__.validate_dims("parameter initialization", "bSd2", "double",
        std::vector<size_t>{static_cast<size_t>(bSd2_1dim__)});
      current_statement__ = 16;
      context__.validate_dims("parameter initialization", "z_bMat2",
        "double",
        std::vector<size_t>{static_cast<size_t>(z_bMat2_1dim__),
          static_cast<size_t>(z_bMat2_2dim__)});
      current_statement__ = 17;
      context__.validate_dims("parameter initialization", "bCholesky2",
        "double",
        std::vector<size_t>{static_cast<size_t>(bCholesky2_1dim__),
          static_cast<size_t>(bCholesky2_2dim__)});
      current_statement__ = 18;
      context__.validate_dims("parameter initialization", "yAux1_unscaled",
        "double",
        std::vector<size_t>{static_cast<size_t>(yAux1_unscaled_1dim__)});
      current_statement__ = 19;
      context__.validate_dims("parameter initialization", "yAux2_unscaled",
        "double",
        std::vector<size_t>{static_cast<size_t>(yAux2_unscaled_1dim__)});
      current_statement__ = 20;
      context__.validate_dims("parameter initialization", "yAux3_unscaled",
        "double",
        std::vector<size_t>{static_cast<size_t>(yAux3_unscaled_1dim__)});
      current_statement__ = 21;
      context__.validate_dims("parameter initialization", "yGlobal1",
        "double", std::vector<size_t>{static_cast<size_t>(yHs1)});
      current_statement__ = 22;
      context__.validate_dims("parameter initialization", "yGlobal2",
        "double", std::vector<size_t>{static_cast<size_t>(yHs2)});
      current_statement__ = 23;
      context__.validate_dims("parameter initialization", "yGlobal3",
        "double", std::vector<size_t>{static_cast<size_t>(yHs3)});
      current_statement__ = 24;
      context__.validate_dims("parameter initialization", "yLocal1",
        "double",
        std::vector<size_t>{static_cast<size_t>(yHs1),
          static_cast<size_t>(yLocal1_2dim__)});
      current_statement__ = 25;
      context__.validate_dims("parameter initialization", "yLocal2",
        "double",
        std::vector<size_t>{static_cast<size_t>(yHs2),
          static_cast<size_t>(yLocal2_2dim__)});
      current_statement__ = 26;
      context__.validate_dims("parameter initialization", "yLocal3",
        "double",
        std::vector<size_t>{static_cast<size_t>(yHs3),
          static_cast<size_t>(yLocal3_2dim__)});
      current_statement__ = 27;
      context__.validate_dims("parameter initialization", "y_caux1",
        "double", std::vector<size_t>{static_cast<size_t>(y_caux1_1dim__)});
      current_statement__ = 28;
      context__.validate_dims("parameter initialization", "y_caux2",
        "double", std::vector<size_t>{static_cast<size_t>(y_caux2_1dim__)});
      current_statement__ = 29;
      context__.validate_dims("parameter initialization", "y_caux3",
        "double", std::vector<size_t>{static_cast<size_t>(y_caux3_1dim__)});
      current_statement__ = 30;
      context__.validate_dims("parameter initialization", "yOol1", "double",
        std::vector<size_t>{static_cast<size_t>(yOol1_1dim__)});
      current_statement__ = 31;
      context__.validate_dims("parameter initialization", "yOol2", "double",
        std::vector<size_t>{static_cast<size_t>(yOol2_1dim__)});
      current_statement__ = 32;
      context__.validate_dims("parameter initialization", "yOol3", "double",
        std::vector<size_t>{static_cast<size_t>(yOol3_1dim__)});
      current_statement__ = 33;
      context__.validate_dims("parameter initialization", "yMix1", "double",
        std::vector<size_t>{static_cast<size_t>(yMix1_1dim__),
          static_cast<size_t>(yMix1_2dim__)});
      current_statement__ = 34;
      context__.validate_dims("parameter initialization", "yMix2", "double",
        std::vector<size_t>{static_cast<size_t>(yMix2_1dim__),
          static_cast<size_t>(yMix2_2dim__)});
      current_statement__ = 35;
      context__.validate_dims("parameter initialization", "yMix3", "double",
        std::vector<size_t>{static_cast<size_t>(yMix3_1dim__),
          static_cast<size_t>(yMix3_2dim__)});
      int pos__ = std::numeric_limits<int>::min();
      pos__ = 1;
      std::vector<local_scalar_t__> yGamma1 =
        std::vector<local_scalar_t__>(yGamma1_1dim__, DUMMY_VAR__);
      current_statement__ = 1;
      yGamma1 = context__.vals_r("yGamma1");
      out__.write_free_lub(lb(
                             stan::model::rvalue(intercept_type,
                               "intercept_type", stan::model::index_uni(1)),
                             pstream__),
        ub(
          stan::model::rvalue(intercept_type, "intercept_type",
            stan::model::index_uni(1)), pstream__), yGamma1);
      std::vector<local_scalar_t__> yGamma2 =
        std::vector<local_scalar_t__>(yGamma2_1dim__, DUMMY_VAR__);
      current_statement__ = 2;
      yGamma2 = context__.vals_r("yGamma2");
      out__.write_free_lub(lb(
                             stan::model::rvalue(intercept_type,
                               "intercept_type", stan::model::index_uni(2)),
                             pstream__),
        ub(
          stan::model::rvalue(intercept_type, "intercept_type",
            stan::model::index_uni(2)), pstream__), yGamma2);
      std::vector<local_scalar_t__> yGamma3 =
        std::vector<local_scalar_t__>(yGamma3_1dim__, DUMMY_VAR__);
      current_statement__ = 3;
      yGamma3 = context__.vals_r("yGamma3");
      out__.write_free_lub(lb(
                             stan::model::rvalue(intercept_type,
                               "intercept_type", stan::model::index_uni(3)),
                             pstream__),
        ub(
          stan::model::rvalue(intercept_type, "intercept_type",
            stan::model::index_uni(3)), pstream__), yGamma3);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta1_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_yBeta1_flat__;
        current_statement__ = 4;
        z_yBeta1_flat__ = context__.vals_r("z_yBeta1");
        current_statement__ = 4;
        pos__ = 1;
        current_statement__ = 4;
        for (int sym1__ = 1; sym1__ <= z_yBeta1_1dim__; ++sym1__) {
          current_statement__ = 4;
          stan::model::assign(z_yBeta1, z_yBeta1_flat__[(pos__ - 1)],
            "assigning variable z_yBeta1", stan::model::index_uni(sym1__));
          current_statement__ = 4;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_yBeta1);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta2_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_yBeta2_flat__;
        current_statement__ = 5;
        z_yBeta2_flat__ = context__.vals_r("z_yBeta2");
        current_statement__ = 5;
        pos__ = 1;
        current_statement__ = 5;
        for (int sym1__ = 1; sym1__ <= z_yBeta2_1dim__; ++sym1__) {
          current_statement__ = 5;
          stan::model::assign(z_yBeta2, z_yBeta2_flat__[(pos__ - 1)],
            "assigning variable z_yBeta2", stan::model::index_uni(sym1__));
          current_statement__ = 5;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_yBeta2);
      Eigen::Matrix<local_scalar_t__,-1,1> z_yBeta3 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_yBeta3_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_yBeta3_flat__;
        current_statement__ = 6;
        z_yBeta3_flat__ = context__.vals_r("z_yBeta3");
        current_statement__ = 6;
        pos__ = 1;
        current_statement__ = 6;
        for (int sym1__ = 1; sym1__ <= z_yBeta3_1dim__; ++sym1__) {
          current_statement__ = 6;
          stan::model::assign(z_yBeta3, z_yBeta3_flat__[(pos__ - 1)],
            "assigning variable z_yBeta3", stan::model::index_uni(sym1__));
          current_statement__ = 6;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_yBeta3);
      Eigen::Matrix<local_scalar_t__,-1,1> z_b =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_b_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_b_flat__;
        current_statement__ = 7;
        z_b_flat__ = context__.vals_r("z_b");
        current_statement__ = 7;
        pos__ = 1;
        current_statement__ = 7;
        for (int sym1__ = 1; sym1__ <= z_b_1dim__; ++sym1__) {
          current_statement__ = 7;
          stan::model::assign(z_b, z_b_flat__[(pos__ - 1)],
            "assigning variable z_b", stan::model::index_uni(sym1__));
          current_statement__ = 7;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_b);
      Eigen::Matrix<local_scalar_t__,-1,1> z_T =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(z_T_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_T_flat__;
        current_statement__ = 8;
        z_T_flat__ = context__.vals_r("z_T");
        current_statement__ = 8;
        pos__ = 1;
        current_statement__ = 8;
        for (int sym1__ = 1; sym1__ <= z_T_1dim__; ++sym1__) {
          current_statement__ = 8;
          stan::model::assign(z_T, z_T_flat__[(pos__ - 1)],
            "assigning variable z_T", stan::model::index_uni(sym1__));
          current_statement__ = 8;
          pos__ = (pos__ + 1);
        }
      }
      out__.write(z_T);
      Eigen::Matrix<local_scalar_t__,-1,1> rho =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(rho_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> rho_flat__;
        current_statement__ = 9;
        rho_flat__ = context__.vals_r("rho");
        current_statement__ = 9;
        pos__ = 1;
        current_statement__ = 9;
        for (int sym1__ = 1; sym1__ <= rho_1dim__; ++sym1__) {
          current_statement__ = 9;
          stan::model::assign(rho, rho_flat__[(pos__ - 1)],
            "assigning variable rho", stan::model::index_uni(sym1__));
          current_statement__ = 9;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lub(0, 1, rho);
      Eigen::Matrix<local_scalar_t__,-1,1> zeta =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(zeta_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> zeta_flat__;
        current_statement__ = 10;
        zeta_flat__ = context__.vals_r("zeta");
        current_statement__ = 10;
        pos__ = 1;
        current_statement__ = 10;
        for (int sym1__ = 1; sym1__ <= zeta_1dim__; ++sym1__) {
          current_statement__ = 10;
          stan::model::assign(zeta, zeta_flat__[(pos__ - 1)],
            "assigning variable zeta", stan::model::index_uni(sym1__));
          current_statement__ = 10;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, zeta);
      Eigen::Matrix<local_scalar_t__,-1,1> tau =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(tau_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> tau_flat__;
        current_statement__ = 11;
        tau_flat__ = context__.vals_r("tau");
        current_statement__ = 11;
        pos__ = 1;
        current_statement__ = 11;
        for (int sym1__ = 1; sym1__ <= tau_1dim__; ++sym1__) {
          current_statement__ = 11;
          stan::model::assign(tau, tau_flat__[(pos__ - 1)],
            "assigning variable tau", stan::model::index_uni(sym1__));
          current_statement__ = 11;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, tau);
      Eigen::Matrix<local_scalar_t__,-1,1> bSd1 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(bSd1_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> bSd1_flat__;
        current_statement__ = 12;
        bSd1_flat__ = context__.vals_r("bSd1");
        current_statement__ = 12;
        pos__ = 1;
        current_statement__ = 12;
        for (int sym1__ = 1; sym1__ <= bSd1_1dim__; ++sym1__) {
          current_statement__ = 12;
          stan::model::assign(bSd1, bSd1_flat__[(pos__ - 1)],
            "assigning variable bSd1", stan::model::index_uni(sym1__));
          current_statement__ = 12;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, bSd1);
      Eigen::Matrix<local_scalar_t__,-1,-1> z_bMat1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(z_bMat1_1dim__,
          z_bMat1_2dim__, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_bMat1_flat__;
        current_statement__ = 13;
        z_bMat1_flat__ = context__.vals_r("z_bMat1");
        current_statement__ = 13;
        pos__ = 1;
        current_statement__ = 13;
        for (int sym1__ = 1; sym1__ <= z_bMat1_2dim__; ++sym1__) {
          current_statement__ = 13;
          for (int sym2__ = 1; sym2__ <= z_bMat1_1dim__; ++sym2__) {
            current_statement__ = 13;
            stan::model::assign(z_bMat1, z_bMat1_flat__[(pos__ - 1)],
              "assigning variable z_bMat1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 13;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write(z_bMat1);
      Eigen::Matrix<local_scalar_t__,-1,-1> bCholesky1 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bCholesky1_1dim__,
          bCholesky1_2dim__, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> bCholesky1_flat__;
        current_statement__ = 14;
        bCholesky1_flat__ = context__.vals_r("bCholesky1");
        current_statement__ = 14;
        pos__ = 1;
        current_statement__ = 14;
        for (int sym1__ = 1; sym1__ <= bCholesky1_2dim__; ++sym1__) {
          current_statement__ = 14;
          for (int sym2__ = 1; sym2__ <= bCholesky1_1dim__; ++sym2__) {
            current_statement__ = 14;
            stan::model::assign(bCholesky1, bCholesky1_flat__[(pos__ - 1)],
              "assigning variable bCholesky1",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 14;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_cholesky_factor_corr(bCholesky1);
      Eigen::Matrix<local_scalar_t__,-1,1> bSd2 =
        Eigen::Matrix<local_scalar_t__,-1,1>::Constant(bSd2_1dim__,
          DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> bSd2_flat__;
        current_statement__ = 15;
        bSd2_flat__ = context__.vals_r("bSd2");
        current_statement__ = 15;
        pos__ = 1;
        current_statement__ = 15;
        for (int sym1__ = 1; sym1__ <= bSd2_1dim__; ++sym1__) {
          current_statement__ = 15;
          stan::model::assign(bSd2, bSd2_flat__[(pos__ - 1)],
            "assigning variable bSd2", stan::model::index_uni(sym1__));
          current_statement__ = 15;
          pos__ = (pos__ + 1);
        }
      }
      out__.write_free_lb(0, bSd2);
      Eigen::Matrix<local_scalar_t__,-1,-1> z_bMat2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(z_bMat2_1dim__,
          z_bMat2_2dim__, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> z_bMat2_flat__;
        current_statement__ = 16;
        z_bMat2_flat__ = context__.vals_r("z_bMat2");
        current_statement__ = 16;
        pos__ = 1;
        current_statement__ = 16;
        for (int sym1__ = 1; sym1__ <= z_bMat2_2dim__; ++sym1__) {
          current_statement__ = 16;
          for (int sym2__ = 1; sym2__ <= z_bMat2_1dim__; ++sym2__) {
            current_statement__ = 16;
            stan::model::assign(z_bMat2, z_bMat2_flat__[(pos__ - 1)],
              "assigning variable z_bMat2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 16;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write(z_bMat2);
      Eigen::Matrix<local_scalar_t__,-1,-1> bCholesky2 =
        Eigen::Matrix<local_scalar_t__,-1,-1>::Constant(bCholesky2_1dim__,
          bCholesky2_2dim__, DUMMY_VAR__);
      {
        std::vector<local_scalar_t__> bCholesky2_flat__;
        current_statement__ = 17;
        bCholesky2_flat__ = context__.vals_r("bCholesky2");
        current_statement__ = 17;
        pos__ = 1;
        current_statement__ = 17;
        for (int sym1__ = 1; sym1__ <= bCholesky2_2dim__; ++sym1__) {
          current_statement__ = 17;
          for (int sym2__ = 1; sym2__ <= bCholesky2_1dim__; ++sym2__) {
            current_statement__ = 17;
            stan::model::assign(bCholesky2, bCholesky2_flat__[(pos__ - 1)],
              "assigning variable bCholesky2",
              stan::model::index_uni(sym2__), stan::model::index_uni(sym1__));
            current_statement__ = 17;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_cholesky_factor_corr(bCholesky2);
      std::vector<local_scalar_t__> yAux1_unscaled =
        std::vector<local_scalar_t__>(yAux1_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 18;
      yAux1_unscaled = context__.vals_r("yAux1_unscaled");
      out__.write_free_lb(0, yAux1_unscaled);
      std::vector<local_scalar_t__> yAux2_unscaled =
        std::vector<local_scalar_t__>(yAux2_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 19;
      yAux2_unscaled = context__.vals_r("yAux2_unscaled");
      out__.write_free_lb(0, yAux2_unscaled);
      std::vector<local_scalar_t__> yAux3_unscaled =
        std::vector<local_scalar_t__>(yAux3_unscaled_1dim__, DUMMY_VAR__);
      current_statement__ = 20;
      yAux3_unscaled = context__.vals_r("yAux3_unscaled");
      out__.write_free_lb(0, yAux3_unscaled);
      std::vector<local_scalar_t__> yGlobal1 =
        std::vector<local_scalar_t__>(yHs1, DUMMY_VAR__);
      current_statement__ = 21;
      yGlobal1 = context__.vals_r("yGlobal1");
      out__.write_free_lb(0, yGlobal1);
      std::vector<local_scalar_t__> yGlobal2 =
        std::vector<local_scalar_t__>(yHs2, DUMMY_VAR__);
      current_statement__ = 22;
      yGlobal2 = context__.vals_r("yGlobal2");
      out__.write_free_lb(0, yGlobal2);
      std::vector<local_scalar_t__> yGlobal3 =
        std::vector<local_scalar_t__>(yHs3, DUMMY_VAR__);
      current_statement__ = 23;
      yGlobal3 = context__.vals_r("yGlobal3");
      out__.write_free_lb(0, yGlobal3);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs1,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal1_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> yLocal1_flat__;
        current_statement__ = 24;
        yLocal1_flat__ = context__.vals_r("yLocal1");
        current_statement__ = 24;
        pos__ = 1;
        current_statement__ = 24;
        for (int sym1__ = 1; sym1__ <= yLocal1_2dim__; ++sym1__) {
          current_statement__ = 24;
          for (int sym2__ = 1; sym2__ <= yHs1; ++sym2__) {
            current_statement__ = 24;
            stan::model::assign(yLocal1, yLocal1_flat__[(pos__ - 1)],
              "assigning variable yLocal1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 24;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, yLocal1);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs2,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal2_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> yLocal2_flat__;
        current_statement__ = 25;
        yLocal2_flat__ = context__.vals_r("yLocal2");
        current_statement__ = 25;
        pos__ = 1;
        current_statement__ = 25;
        for (int sym1__ = 1; sym1__ <= yLocal2_2dim__; ++sym1__) {
          current_statement__ = 25;
          for (int sym2__ = 1; sym2__ <= yHs2; ++sym2__) {
            current_statement__ = 25;
            stan::model::assign(yLocal2, yLocal2_flat__[(pos__ - 1)],
              "assigning variable yLocal2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 25;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, yLocal2);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yLocal3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yHs3,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yLocal3_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> yLocal3_flat__;
        current_statement__ = 26;
        yLocal3_flat__ = context__.vals_r("yLocal3");
        current_statement__ = 26;
        pos__ = 1;
        current_statement__ = 26;
        for (int sym1__ = 1; sym1__ <= yLocal3_2dim__; ++sym1__) {
          current_statement__ = 26;
          for (int sym2__ = 1; sym2__ <= yHs3; ++sym2__) {
            current_statement__ = 26;
            stan::model::assign(yLocal3, yLocal3_flat__[(pos__ - 1)],
              "assigning variable yLocal3", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 26;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, yLocal3);
      std::vector<local_scalar_t__> y_caux1 =
        std::vector<local_scalar_t__>(y_caux1_1dim__, DUMMY_VAR__);
      current_statement__ = 27;
      y_caux1 = context__.vals_r("y_caux1");
      out__.write_free_lb(0, y_caux1);
      std::vector<local_scalar_t__> y_caux2 =
        std::vector<local_scalar_t__>(y_caux2_1dim__, DUMMY_VAR__);
      current_statement__ = 28;
      y_caux2 = context__.vals_r("y_caux2");
      out__.write_free_lb(0, y_caux2);
      std::vector<local_scalar_t__> y_caux3 =
        std::vector<local_scalar_t__>(y_caux3_1dim__, DUMMY_VAR__);
      current_statement__ = 29;
      y_caux3 = context__.vals_r("y_caux3");
      out__.write_free_lb(0, y_caux3);
      std::vector<local_scalar_t__> yOol1 =
        std::vector<local_scalar_t__>(yOol1_1dim__, DUMMY_VAR__);
      current_statement__ = 30;
      yOol1 = context__.vals_r("yOol1");
      out__.write_free_lb(0, yOol1);
      std::vector<local_scalar_t__> yOol2 =
        std::vector<local_scalar_t__>(yOol2_1dim__, DUMMY_VAR__);
      current_statement__ = 31;
      yOol2 = context__.vals_r("yOol2");
      out__.write_free_lb(0, yOol2);
      std::vector<local_scalar_t__> yOol3 =
        std::vector<local_scalar_t__>(yOol3_1dim__, DUMMY_VAR__);
      current_statement__ = 32;
      yOol3 = context__.vals_r("yOol3");
      out__.write_free_lb(0, yOol3);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix1 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix1_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix1_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> yMix1_flat__;
        current_statement__ = 33;
        yMix1_flat__ = context__.vals_r("yMix1");
        current_statement__ = 33;
        pos__ = 1;
        current_statement__ = 33;
        for (int sym1__ = 1; sym1__ <= yMix1_2dim__; ++sym1__) {
          current_statement__ = 33;
          for (int sym2__ = 1; sym2__ <= yMix1_1dim__; ++sym2__) {
            current_statement__ = 33;
            stan::model::assign(yMix1, yMix1_flat__[(pos__ - 1)],
              "assigning variable yMix1", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 33;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, yMix1);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix2 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix2_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix2_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> yMix2_flat__;
        current_statement__ = 34;
        yMix2_flat__ = context__.vals_r("yMix2");
        current_statement__ = 34;
        pos__ = 1;
        current_statement__ = 34;
        for (int sym1__ = 1; sym1__ <= yMix2_2dim__; ++sym1__) {
          current_statement__ = 34;
          for (int sym2__ = 1; sym2__ <= yMix2_1dim__; ++sym2__) {
            current_statement__ = 34;
            stan::model::assign(yMix2, yMix2_flat__[(pos__ - 1)],
              "assigning variable yMix2", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 34;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, yMix2);
      std::vector<Eigen::Matrix<local_scalar_t__,-1,1>> yMix3 =
        std::vector<Eigen::Matrix<local_scalar_t__,-1,1>>(yMix3_1dim__,
          Eigen::Matrix<local_scalar_t__,-1,1>::Constant(yMix3_2dim__,
            DUMMY_VAR__));
      {
        std::vector<local_scalar_t__> yMix3_flat__;
        current_statement__ = 35;
        yMix3_flat__ = context__.vals_r("yMix3");
        current_statement__ = 35;
        pos__ = 1;
        current_statement__ = 35;
        for (int sym1__ = 1; sym1__ <= yMix3_2dim__; ++sym1__) {
          current_statement__ = 35;
          for (int sym2__ = 1; sym2__ <= yMix3_1dim__; ++sym2__) {
            current_statement__ = 35;
            stan::model::assign(yMix3, yMix3_flat__[(pos__ - 1)],
              "assigning variable yMix3", stan::model::index_uni(sym2__),
              stan::model::index_uni(sym1__));
            current_statement__ = 35;
            pos__ = (pos__ + 1);
          }
        }
      }
      out__.write_free_lb(0, yMix3);
    } catch (const std::exception& e) {
      stan::lang::rethrow_located(e, locations_array__[current_statement__]);
    }
  }
  inline void
  get_param_names(std::vector<std::string>& names__, const bool
                  emit_transformed_parameters__ = true, const bool
                  emit_generated_quantities__ = true) const {
    names__ = std::vector<std::string>{"yGamma1", "yGamma2", "yGamma3",
                "z_yBeta1", "z_yBeta2", "z_yBeta3", "z_b", "z_T", "rho",
                "zeta", "tau", "bSd1", "z_bMat1", "bCholesky1", "bSd2",
                "z_bMat2", "bCholesky2", "yAux1_unscaled", "yAux2_unscaled",
                "yAux3_unscaled", "yGlobal1", "yGlobal2", "yGlobal3",
                "yLocal1", "yLocal2", "yLocal3", "y_caux1", "y_caux2",
                "y_caux3", "yOol1", "yOol2", "yOol3", "yMix1", "yMix2",
                "yMix3"};
    if (emit_transformed_parameters__) {
      std::vector<std::string>
        temp{"yBeta1", "yBeta2", "yBeta3", "yAux1", "yAux2", "yAux3",
             "theta_L", "yAuxMaximum", "bMat1", "bMat2"};
      names__.reserve(names__.size() + temp.size());
      names__.insert(names__.end(), temp.begin(), temp.end());
    }
    if (emit_generated_quantities__) {
      std::vector<std::string>
        temp{"mean_PPD", "yAlpha1", "yAlpha2", "yAlpha3", "bCov1", "bCov2",
             "b1", "b2"};
      names__.reserve(names__.size() + temp.size());
      names__.insert(names__.end(), temp.begin(), temp.end());
    }
  }
  inline void
  get_dims(std::vector<std::vector<size_t>>& dimss__, const bool
           emit_transformed_parameters__ = true, const bool
           emit_generated_quantities__ = true) const {
    dimss__ = std::vector<std::vector<size_t>>{std::vector<size_t>{static_cast<
                                                                    size_t>(
                                                                    yGamma1_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yGamma2_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yGamma3_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_yBeta1_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_yBeta2_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_yBeta3_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_b_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_T_1dim__)},
                std::vector<size_t>{static_cast<size_t>(rho_1dim__)},
                std::vector<size_t>{static_cast<size_t>(zeta_1dim__)},
                std::vector<size_t>{static_cast<size_t>(tau_1dim__)},
                std::vector<size_t>{static_cast<size_t>(bSd1_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_bMat1_1dim__),
                  static_cast<size_t>(z_bMat1_2dim__)},
                std::vector<size_t>{static_cast<size_t>(bCholesky1_1dim__),
                  static_cast<size_t>(bCholesky1_2dim__)},
                std::vector<size_t>{static_cast<size_t>(bSd2_1dim__)},
                std::vector<size_t>{static_cast<size_t>(z_bMat2_1dim__),
                  static_cast<size_t>(z_bMat2_2dim__)},
                std::vector<size_t>{static_cast<size_t>(bCholesky2_1dim__),
                  static_cast<size_t>(bCholesky2_2dim__)},
                std::vector<size_t>{static_cast<size_t>(yAux1_unscaled_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yAux2_unscaled_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yAux3_unscaled_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yHs1)},
                std::vector<size_t>{static_cast<size_t>(yHs2)},
                std::vector<size_t>{static_cast<size_t>(yHs3)},
                std::vector<size_t>{static_cast<size_t>(yHs1),
                  static_cast<size_t>(yLocal1_2dim__)},
                std::vector<size_t>{static_cast<size_t>(yHs2),
                  static_cast<size_t>(yLocal2_2dim__)},
                std::vector<size_t>{static_cast<size_t>(yHs3),
                  static_cast<size_t>(yLocal3_2dim__)},
                std::vector<size_t>{static_cast<size_t>(y_caux1_1dim__)},
                std::vector<size_t>{static_cast<size_t>(y_caux2_1dim__)},
                std::vector<size_t>{static_cast<size_t>(y_caux3_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yOol1_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yOol2_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yOol3_1dim__)},
                std::vector<size_t>{static_cast<size_t>(yMix1_1dim__),
                  static_cast<size_t>(yMix1_2dim__)},
                std::vector<size_t>{static_cast<size_t>(yMix2_1dim__),
                  static_cast<size_t>(yMix2_2dim__)},
                std::vector<size_t>{static_cast<size_t>(yMix3_1dim__),
                  static_cast<size_t>(yMix3_2dim__)}};
    if (emit_transformed_parameters__) {
      std::vector<std::vector<size_t>>
        temp{std::vector<size_t>{static_cast<size_t>(yBeta1_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yBeta2_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yBeta3_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yAux1_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yAux2_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yAux3_1dim__)},
             std::vector<size_t>{static_cast<size_t>(len_theta_L)},
             std::vector<size_t>{},
             std::vector<size_t>{static_cast<size_t>(bMat1_1dim__),
               static_cast<size_t>(bK1)},
             std::vector<size_t>{static_cast<size_t>(bMat2_1dim__),
               static_cast<size_t>(bK2)}};
      dimss__.reserve(dimss__.size() + temp.size());
      dimss__.insert(dimss__.end(), temp.begin(), temp.end());
    }
    if (emit_generated_quantities__) {
      std::vector<std::vector<size_t>>
        temp{std::vector<size_t>{static_cast<size_t>(M)},
             std::vector<size_t>{static_cast<size_t>(yAlpha1_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yAlpha2_1dim__)},
             std::vector<size_t>{static_cast<size_t>(yAlpha3_1dim__)},
             std::vector<size_t>{static_cast<size_t>(bCov1_1dim__)},
             std::vector<size_t>{static_cast<size_t>(bCov2_1dim__)},
             std::vector<size_t>{static_cast<size_t>(b1_1dim__)},
             std::vector<size_t>{static_cast<size_t>(b2_1dim__)}};
      dimss__.reserve(dimss__.size() + temp.size());
      dimss__.insert(dimss__.end(), temp.begin(), temp.end());
    }
  }
  inline void
  constrained_param_names(std::vector<std::string>& param_names__, bool
                          emit_transformed_parameters__ = true, bool
                          emit_generated_quantities__ = true) const final {
    for (int sym1__ = 1; sym1__ <= yGamma1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGamma1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yGamma2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGamma2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yGamma3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGamma3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_yBeta1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_yBeta1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_yBeta2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_yBeta2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_yBeta3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_yBeta3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_b_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_b" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_T_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_T" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= rho_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "rho" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= zeta_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "zeta" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= tau_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "tau" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= bSd1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "bSd1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_bMat1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= z_bMat1_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_bMat1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= bCholesky1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= bCholesky1_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "bCholesky1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= bSd2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "bSd2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_bMat2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= z_bMat2_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_bMat2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= bCholesky2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= bCholesky2_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "bCholesky2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yAux1_unscaled_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yAux1_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yAux2_unscaled_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yAux2_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yAux3_unscaled_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yAux3_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yHs1; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGlobal1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yHs2; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGlobal2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yHs3; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGlobal3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yLocal1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yHs1; ++sym2__) {
        param_names__.emplace_back(std::string() + "yLocal1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yLocal2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yHs2; ++sym2__) {
        param_names__.emplace_back(std::string() + "yLocal2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yLocal3_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yHs3; ++sym2__) {
        param_names__.emplace_back(std::string() + "yLocal3" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= y_caux1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "y_caux1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= y_caux2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "y_caux2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= y_caux3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "y_caux3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yOol1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yOol1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yOol2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yOol2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yOol3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yOol3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yMix1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yMix1_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "yMix1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yMix2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yMix2_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "yMix2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yMix3_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yMix3_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "yMix3" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    if (emit_transformed_parameters__) {
      for (int sym1__ = 1; sym1__ <= yBeta1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yBeta1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yBeta2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yBeta2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yBeta3_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yBeta3" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAux1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAux1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAux2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAux2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAux3_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAux3" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= len_theta_L; ++sym1__) {
        param_names__.emplace_back(std::string() + "theta_L" + '.' +
          std::to_string(sym1__));
      }
      param_names__.emplace_back(std::string() + "yAuxMaximum");
      for (int sym1__ = 1; sym1__ <= bK1; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= bMat1_1dim__; ++sym2__) {
          param_names__.emplace_back(std::string() + "bMat1" + '.' +
            std::to_string(sym2__) + '.' + std::to_string(sym1__));
        }
      }
      for (int sym1__ = 1; sym1__ <= bK2; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= bMat2_1dim__; ++sym2__) {
          param_names__.emplace_back(std::string() + "bMat2" + '.' +
            std::to_string(sym2__) + '.' + std::to_string(sym1__));
        }
      }
    }
    if (emit_generated_quantities__) {
      for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
        param_names__.emplace_back(std::string() + "mean_PPD" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAlpha1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAlpha1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAlpha2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAlpha2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAlpha3_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAlpha3" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= bCov1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "bCov1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= bCov2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "bCov2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= b1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "b1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= b2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "b2" + '.' +
          std::to_string(sym1__));
      }
    }
  }
  inline void
  unconstrained_param_names(std::vector<std::string>& param_names__, bool
                            emit_transformed_parameters__ = true, bool
                            emit_generated_quantities__ = true) const final {
    for (int sym1__ = 1; sym1__ <= yGamma1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGamma1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yGamma2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGamma2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yGamma3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGamma3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_yBeta1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_yBeta1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_yBeta2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_yBeta2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_yBeta3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_yBeta3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_b_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_b" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_T_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "z_T" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= rho_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "rho" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= zeta_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "zeta" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= tau_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "tau" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= bSd1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "bSd1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_bMat1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= z_bMat1_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_bMat1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= ((bCholesky1_1dim__ * (bCholesky1_1dim__ -
         1)) / 2); ++sym1__) {
      param_names__.emplace_back(std::string() + "bCholesky1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= bSd2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "bSd2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= z_bMat2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= z_bMat2_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "z_bMat2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= ((bCholesky2_1dim__ * (bCholesky2_1dim__ -
         1)) / 2); ++sym1__) {
      param_names__.emplace_back(std::string() + "bCholesky2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yAux1_unscaled_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yAux1_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yAux2_unscaled_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yAux2_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yAux3_unscaled_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yAux3_unscaled" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yHs1; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGlobal1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yHs2; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGlobal2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yHs3; ++sym1__) {
      param_names__.emplace_back(std::string() + "yGlobal3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yLocal1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yHs1; ++sym2__) {
        param_names__.emplace_back(std::string() + "yLocal1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yLocal2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yHs2; ++sym2__) {
        param_names__.emplace_back(std::string() + "yLocal2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yLocal3_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yHs3; ++sym2__) {
        param_names__.emplace_back(std::string() + "yLocal3" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= y_caux1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "y_caux1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= y_caux2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "y_caux2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= y_caux3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "y_caux3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yOol1_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yOol1" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yOol2_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yOol2" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yOol3_1dim__; ++sym1__) {
      param_names__.emplace_back(std::string() + "yOol3" + '.' +
        std::to_string(sym1__));
    }
    for (int sym1__ = 1; sym1__ <= yMix1_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yMix1_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "yMix1" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yMix2_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yMix2_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "yMix2" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    for (int sym1__ = 1; sym1__ <= yMix3_2dim__; ++sym1__) {
      for (int sym2__ = 1; sym2__ <= yMix3_1dim__; ++sym2__) {
        param_names__.emplace_back(std::string() + "yMix3" + '.' +
          std::to_string(sym2__) + '.' + std::to_string(sym1__));
      }
    }
    if (emit_transformed_parameters__) {
      for (int sym1__ = 1; sym1__ <= yBeta1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yBeta1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yBeta2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yBeta2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yBeta3_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yBeta3" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAux1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAux1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAux2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAux2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAux3_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAux3" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= len_theta_L; ++sym1__) {
        param_names__.emplace_back(std::string() + "theta_L" + '.' +
          std::to_string(sym1__));
      }
      param_names__.emplace_back(std::string() + "yAuxMaximum");
      for (int sym1__ = 1; sym1__ <= bK1; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= bMat1_1dim__; ++sym2__) {
          param_names__.emplace_back(std::string() + "bMat1" + '.' +
            std::to_string(sym2__) + '.' + std::to_string(sym1__));
        }
      }
      for (int sym1__ = 1; sym1__ <= bK2; ++sym1__) {
        for (int sym2__ = 1; sym2__ <= bMat2_1dim__; ++sym2__) {
          param_names__.emplace_back(std::string() + "bMat2" + '.' +
            std::to_string(sym2__) + '.' + std::to_string(sym1__));
        }
      }
    }
    if (emit_generated_quantities__) {
      for (int sym1__ = 1; sym1__ <= M; ++sym1__) {
        param_names__.emplace_back(std::string() + "mean_PPD" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAlpha1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAlpha1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAlpha2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAlpha2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= yAlpha3_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "yAlpha3" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= bCov1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "bCov1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= bCov2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "bCov2" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= b1_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "b1" + '.' +
          std::to_string(sym1__));
      }
      for (int sym1__ = 1; sym1__ <= b2_1dim__; ++sym1__) {
        param_names__.emplace_back(std::string() + "b2" + '.' +
          std::to_string(sym1__));
      }
    }
  }
  inline std::string get_constrained_sizedtypes() const {
    return std::string("[{\"name\":\"yGamma1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yGamma1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGamma2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yGamma2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGamma3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yGamma3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"z_yBeta1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_yBeta1_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_yBeta2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_yBeta2_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_yBeta3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_yBeta3_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_b\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_b_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_T\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_T_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"rho\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(rho_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"zeta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(zeta_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(tau_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"bSd1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bSd1_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_bMat1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(z_bMat1_1dim__) + ",\"cols\":" + std::to_string(z_bMat1_2dim__) + "},\"block\":\"parameters\"},{\"name\":\"bCholesky1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(bCholesky1_1dim__) + ",\"cols\":" + std::to_string(bCholesky1_2dim__) + "},\"block\":\"parameters\"},{\"name\":\"bSd2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bSd2_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_bMat2\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(z_bMat2_1dim__) + ",\"cols\":" + std::to_string(z_bMat2_2dim__) + "},\"block\":\"parameters\"},{\"name\":\"bCholesky2\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(bCholesky2_1dim__) + ",\"cols\":" + std::to_string(bCholesky2_2dim__) + "},\"block\":\"parameters\"},{\"name\":\"yAux1_unscaled\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux1_unscaled_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yAux2_unscaled\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux2_unscaled_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yAux3_unscaled\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux3_unscaled_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGlobal1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs1) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGlobal2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs2) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGlobal3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs3) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yLocal1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs1) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yLocal1_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yLocal2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs2) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yLocal2_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yLocal3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs3) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yLocal3_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"y_caux1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(y_caux1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y_caux2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(y_caux2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y_caux3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(y_caux3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yOol1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yOol1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yOol2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yOol2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yOol3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yOol3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yMix1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yMix1_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yMix1_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yMix2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yMix2_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yMix2_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yMix3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yMix3_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yMix3_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yBeta1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(yBeta1_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yBeta2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(yBeta2_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yBeta3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(yBeta3_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yAux1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"yAux2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"yAux3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"theta_L\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(len_theta_L) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yAuxMaximum\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"bMat1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(bMat1_1dim__) + ",\"cols\":" + std::to_string(bK1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"bMat2\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(bMat2_1dim__) + ",\"cols\":" + std::to_string(bK2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"mean_PPD\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"yAlpha1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAlpha1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"yAlpha2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAlpha2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"yAlpha3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAlpha3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"bCov1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bCov1_1dim__) + "},\"block\":\"generated_quantities\"},{\"name\":\"bCov2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bCov2_1dim__) + "},\"block\":\"generated_quantities\"},{\"name\":\"b1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(b1_1dim__) + "},\"block\":\"generated_quantities\"},{\"name\":\"b2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(b2_1dim__) + "},\"block\":\"generated_quantities\"}]");
  }
  inline std::string get_unconstrained_sizedtypes() const {
    return std::string("[{\"name\":\"yGamma1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yGamma1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGamma2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yGamma2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGamma3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yGamma3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"z_yBeta1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_yBeta1_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_yBeta2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_yBeta2_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_yBeta3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_yBeta3_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_b\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_b_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_T\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(z_T_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"rho\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(rho_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"zeta\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(zeta_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"tau\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(tau_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"bSd1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bSd1_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_bMat1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(z_bMat1_1dim__) + ",\"cols\":" + std::to_string(z_bMat1_2dim__) + "},\"block\":\"parameters\"},{\"name\":\"bCholesky1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(((bCholesky1_1dim__ * (bCholesky1_1dim__ - 1)) /2)) + "},\"block\":\"parameters\"},{\"name\":\"bSd2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bSd2_1dim__) + "},\"block\":\"parameters\"},{\"name\":\"z_bMat2\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(z_bMat2_1dim__) + ",\"cols\":" + std::to_string(z_bMat2_2dim__) + "},\"block\":\"parameters\"},{\"name\":\"bCholesky2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(((bCholesky2_1dim__ * (bCholesky2_1dim__ - 1)) /2)) + "},\"block\":\"parameters\"},{\"name\":\"yAux1_unscaled\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux1_unscaled_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yAux2_unscaled\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux2_unscaled_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yAux3_unscaled\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux3_unscaled_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGlobal1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs1) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGlobal2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs2) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yGlobal3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs3) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yLocal1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs1) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yLocal1_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yLocal2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs2) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yLocal2_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yLocal3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yHs3) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yLocal3_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"y_caux1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(y_caux1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y_caux2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(y_caux2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"y_caux3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(y_caux3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yOol1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yOol1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yOol2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yOol2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yOol3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yOol3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"parameters\"},{\"name\":\"yMix1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yMix1_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yMix1_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yMix2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yMix2_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yMix2_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yMix3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yMix3_1dim__) + ",\"element_type\":{\"name\":\"vector\",\"length\":" + std::to_string(yMix3_2dim__) + "}},\"block\":\"parameters\"},{\"name\":\"yBeta1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(yBeta1_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yBeta2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(yBeta2_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yBeta3\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(yBeta3_1dim__) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yAux1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"yAux2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"yAux3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAux3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"transformed_parameters\"},{\"name\":\"theta_L\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(len_theta_L) + "},\"block\":\"transformed_parameters\"},{\"name\":\"yAuxMaximum\",\"type\":{\"name\":\"real\"},\"block\":\"transformed_parameters\"},{\"name\":\"bMat1\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(bMat1_1dim__) + ",\"cols\":" + std::to_string(bK1) + "},\"block\":\"transformed_parameters\"},{\"name\":\"bMat2\",\"type\":{\"name\":\"matrix\",\"rows\":" + std::to_string(bMat2_1dim__) + ",\"cols\":" + std::to_string(bK2) + "},\"block\":\"transformed_parameters\"},{\"name\":\"mean_PPD\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(M) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"yAlpha1\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAlpha1_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"yAlpha2\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAlpha2_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"yAlpha3\",\"type\":{\"name\":\"array\",\"length\":" + std::to_string(yAlpha3_1dim__) + ",\"element_type\":{\"name\":\"real\"}},\"block\":\"generated_quantities\"},{\"name\":\"bCov1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bCov1_1dim__) + "},\"block\":\"generated_quantities\"},{\"name\":\"bCov2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(bCov2_1dim__) + "},\"block\":\"generated_quantities\"},{\"name\":\"b1\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(b1_1dim__) + "},\"block\":\"generated_quantities\"},{\"name\":\"b2\",\"type\":{\"name\":\"vector\",\"length\":" + std::to_string(b2_1dim__) + "},\"block\":\"generated_quantities\"}]");
  }
  // Begin method overload boilerplate
  template <typename RNG> inline void
  write_array(RNG& base_rng, Eigen::Matrix<double,-1,1>& params_r,
              Eigen::Matrix<double,-1,1>& vars, const bool
              emit_transformed_parameters = true, const bool
              emit_generated_quantities = true, std::ostream*
              pstream = nullptr) const {
    const size_t num_params__ =
      ((((((((((((((((((((((((((((((((((yGamma1_1dim__ + yGamma2_1dim__) +
      yGamma3_1dim__) + z_yBeta1_1dim__) + z_yBeta2_1dim__) +
      z_yBeta3_1dim__) + z_b_1dim__) + z_T_1dim__) + rho_1dim__) +
      zeta_1dim__) + tau_1dim__) + bSd1_1dim__) + (z_bMat1_1dim__ *
      z_bMat1_2dim__)) + (bCholesky1_1dim__ * bCholesky1_2dim__)) +
      bSd2_1dim__) + (z_bMat2_1dim__ * z_bMat2_2dim__)) + (bCholesky2_1dim__
      * bCholesky2_2dim__)) + yAux1_unscaled_1dim__) + yAux2_unscaled_1dim__)
      + yAux3_unscaled_1dim__) + yHs1) + yHs2) + yHs3) + (yHs1 *
      yLocal1_2dim__)) + (yHs2 * yLocal2_2dim__)) + (yHs3 * yLocal3_2dim__))
      + y_caux1_1dim__) + y_caux2_1dim__) + y_caux3_1dim__) + yOol1_1dim__) +
      yOol2_1dim__) + yOol3_1dim__) + (yMix1_1dim__ * yMix1_2dim__)) +
      (yMix2_1dim__ * yMix2_2dim__)) + (yMix3_1dim__ * yMix3_2dim__));
    const size_t num_transformed = emit_transformed_parameters *
      ((((((((((yBeta1_1dim__ + yBeta2_1dim__) + yBeta3_1dim__) +
      yAux1_1dim__) + yAux2_1dim__) + yAux3_1dim__) + len_theta_L) + 1) +
      (bMat1_1dim__ * bK1)) + (bMat2_1dim__ * bK2)));
    const size_t num_gen_quantities = emit_generated_quantities * ((((((((M +
      yAlpha1_1dim__) + yAlpha2_1dim__) + yAlpha3_1dim__) + bCov1_1dim__) +
      bCov2_1dim__) + b1_1dim__) + b2_1dim__));
    const size_t num_to_write = num_params__ + num_transformed +
      num_gen_quantities;
    std::vector<int> params_i;
    vars = Eigen::Matrix<double,-1,1>::Constant(num_to_write,
             std::numeric_limits<double>::quiet_NaN());
    write_array_impl(base_rng, params_r, params_i, vars,
      emit_transformed_parameters, emit_generated_quantities, pstream);
  }
  template <typename RNG> inline void
  write_array(RNG& base_rng, std::vector<double>& params_r, std::vector<int>&
              params_i, std::vector<double>& vars, bool
              emit_transformed_parameters = true, bool
              emit_generated_quantities = true, std::ostream*
              pstream = nullptr) const {
    const size_t num_params__ =
      ((((((((((((((((((((((((((((((((((yGamma1_1dim__ + yGamma2_1dim__) +
      yGamma3_1dim__) + z_yBeta1_1dim__) + z_yBeta2_1dim__) +
      z_yBeta3_1dim__) + z_b_1dim__) + z_T_1dim__) + rho_1dim__) +
      zeta_1dim__) + tau_1dim__) + bSd1_1dim__) + (z_bMat1_1dim__ *
      z_bMat1_2dim__)) + (bCholesky1_1dim__ * bCholesky1_2dim__)) +
      bSd2_1dim__) + (z_bMat2_1dim__ * z_bMat2_2dim__)) + (bCholesky2_1dim__
      * bCholesky2_2dim__)) + yAux1_unscaled_1dim__) + yAux2_unscaled_1dim__)
      + yAux3_unscaled_1dim__) + yHs1) + yHs2) + yHs3) + (yHs1 *
      yLocal1_2dim__)) + (yHs2 * yLocal2_2dim__)) + (yHs3 * yLocal3_2dim__))
      + y_caux1_1dim__) + y_caux2_1dim__) + y_caux3_1dim__) + yOol1_1dim__) +
      yOol2_1dim__) + yOol3_1dim__) + (yMix1_1dim__ * yMix1_2dim__)) +
      (yMix2_1dim__ * yMix2_2dim__)) + (yMix3_1dim__ * yMix3_2dim__));
    const size_t num_transformed = emit_transformed_parameters *
      ((((((((((yBeta1_1dim__ + yBeta2_1dim__) + yBeta3_1dim__) +
      yAux1_1dim__) + yAux2_1dim__) + yAux3_1dim__) + len_theta_L) + 1) +
      (bMat1_1dim__ * bK1)) + (bMat2_1dim__ * bK2)));
    const size_t num_gen_quantities = emit_generated_quantities * ((((((((M +
      yAlpha1_1dim__) + yAlpha2_1dim__) + yAlpha3_1dim__) + bCov1_1dim__) +
      bCov2_1dim__) + b1_1dim__) + b2_1dim__));
    const size_t num_to_write = num_params__ + num_transformed +
      num_gen_quantities;
    vars = std::vector<double>(num_to_write,
             std::numeric_limits<double>::quiet_NaN());
    write_array_impl(base_rng, params_r, params_i, vars,
      emit_transformed_parameters, emit_generated_quantities, pstream);
  }
  template <bool propto__, bool jacobian__, typename T_> inline T_
  log_prob(Eigen::Matrix<T_,-1,1>& params_r, std::ostream* pstream = nullptr) const {
    Eigen::Matrix<int,-1,1> params_i;
    return log_prob_impl<propto__, jacobian__>(params_r, params_i, pstream);
  }
  template <bool propto__, bool jacobian__, typename T_> inline T_
  log_prob(std::vector<T_>& params_r, std::vector<int>& params_i,
           std::ostream* pstream = nullptr) const {
    return log_prob_impl<propto__, jacobian__>(params_r, params_i, pstream);
  }
  inline void
  transform_inits(const stan::io::var_context& context,
                  Eigen::Matrix<double,-1,1>& params_r, std::ostream*
                  pstream = nullptr) const final {
    std::vector<double> params_r_vec(params_r.size());
    std::vector<int> params_i;
    transform_inits(context, params_i, params_r_vec, pstream);
    params_r = Eigen::Map<Eigen::Matrix<double,-1,1>>(params_r_vec.data(),
                 params_r_vec.size());
  }
  inline void
  transform_inits(const stan::io::var_context& context, std::vector<int>&
                  params_i, std::vector<double>& vars, std::ostream*
                  pstream__ = nullptr) const {
    vars.resize(num_params_r__);
    transform_inits_impl(context, vars, pstream__);
  }
  inline void
  unconstrain_array(const std::vector<double>& params_constrained,
                    std::vector<double>& params_unconstrained, std::ostream*
                    pstream = nullptr) const {
    const std::vector<int> params_i;
    params_unconstrained = std::vector<double>(num_params_r__,
                             std::numeric_limits<double>::quiet_NaN());
    unconstrain_array_impl(params_constrained, params_i,
      params_unconstrained, pstream);
  }
  inline void
  unconstrain_array(const Eigen::Matrix<double,-1,1>& params_constrained,
                    Eigen::Matrix<double,-1,1>& params_unconstrained,
                    std::ostream* pstream = nullptr) const {
    const std::vector<int> params_i;
    params_unconstrained = Eigen::Matrix<double,-1,1>::Constant(num_params_r__,
                             std::numeric_limits<double>::quiet_NaN());
    unconstrain_array_impl(params_constrained, params_i,
      params_unconstrained, pstream);
  }
};
}
using stan_model = model_mvmer_namespace::model_mvmer;
#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_mvmer_namespace::profiles__;
}
#endif
#endif
