Running ‘testthat.R’ [343s/393s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # Part of the rstanarm package for estimating model parameters
  > # Copyright (C) 2015 Trustees of Columbia University
  > # 
  > # This program 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.
  > # 
  > # This program 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 this program; if not, write to the Free Software
  > # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  > 
  > library(testthat)
  > library(rstanarm)
  Loading required package: Rcpp
  rstanarm (Version 2.17.4, packaged: 2018-04-13 01:51:52 UTC)
  - Do not expect the default priors to remain the same in future rstanarm versions.
  Thus, R scripts should specify priors explicitly, even if they are just the defaults.
  - For execution on a local, multicore CPU with excess RAM we recommend calling
  options(mc.cores = parallel::detectCores())
  - Plotting theme set to bayesplot::theme_default().
  > Sys.unsetenv("R_TESTS")
  > # options(error = function() traceback(2))
  > example(example_model)
  
  exmpl_> example_model <- 
  exmpl_+   stan_glmer(cbind(incidence, size - incidence) ~ size + period + (1|herd),
  exmpl_+              data = lme4::cbpp, family = binomial, QR = TRUE,
  exmpl_+              # this next line is only to keep the example small in size!
  exmpl_+              chains = 2, cores = 1, seed = 12345, iter = 500)
  
  SAMPLING FOR MODEL 'binomial' NOW (CHAIN 1).
  
  Gradient evaluation took 0.000187 seconds
  1000 transitions using 10 leapfrog steps per transition would take 1.87 seconds.
  Adjust your expectations accordingly!
  
  
  Iteration:   1 / 500 [  0%]  (Warmup)
  Iteration:  50 / 500 [ 10%]  (Warmup)
  Iteration: 100 / 500 [ 20%]  (Warmup)
  Iteration: 150 / 500 [ 30%]  (Warmup)
  Iteration: 200 / 500 [ 40%]  (Warmup)
  Iteration: 250 / 500 [ 50%]  (Warmup)
  Iteration: 251 / 500 [ 50%]  (Sampling)
  Iteration: 300 / 500 [ 60%]  (Sampling)
  Iteration: 350 / 500 [ 70%]  (Sampling)
  Iteration: 400 / 500 [ 80%]  (Sampling)
  Iteration: 450 / 500 [ 90%]  (Sampling)
  Iteration: 500 / 500 [100%]  (Sampling)
  
   Elapsed Time: 1.23521 seconds (Warm-up)
                 0.379137 seconds (Sampling)
                 1.61434 seconds (Total)
  
  
  SAMPLING FOR MODEL 'binomial' NOW (CHAIN 2).
  
  Gradient evaluation took 0.000113 seconds
  1000 transitions using 10 leapfrog steps per transition would take 1.13 seconds.
  Adjust your expectations accordingly!
  
  
  Iteration:   1 / 500 [  0%]  (Warmup)
  Iteration:  50 / 500 [ 10%]  (Warmup)
  Iteration: 100 / 500 [ 20%]  (Warmup)
  Iteration: 150 / 500 [ 30%]  (Warmup)
  Iteration: 200 / 500 [ 40%]  (Warmup)
  Iteration: 250 / 500 [ 50%]  (Warmup)
  Iteration: 251 / 500 [ 50%]  (Sampling)
  Iteration: 300 / 500 [ 60%]  (Sampling)
  Iteration: 350 / 500 [ 70%]  (Sampling)
  Iteration: 400 / 500 [ 80%]  (Sampling)
  Iteration: 450 / 500 [ 90%]  (Sampling)
  Iteration: 500 / 500 [100%]  (Sampling)
  
   Elapsed Time: 1.4909 seconds (Warm-up)
                 0.41203 seconds (Sampling)
                 1.90293 seconds (Total)
  
  
  exmpl_> example_model
  stan_glmer
   family:       binomial [logit]
   formula:      cbind(incidence, size - incidence) ~ size + period + (1 | herd)
   observations: 56
  ------
              Median MAD_SD
  (Intercept) -1.5    0.6  
  size         0.0    0.0  
  period2     -1.0    0.3  
  period3     -1.1    0.3  
  period4     -1.6    0.4  
  
  Error terms:
   Groups Name        Std.Dev.
   herd   (Intercept) 0.77    
  Num. levels: herd 15 
  
  Sample avg. posterior predictive distribution of y:
           Median MAD_SD
  mean_PPD 1.8    0.2   
  
  ------
  For info on the priors used see help('prior_summary.stanreg').
  > if (!grepl("^sparc",  R.version$platform)) 
  +   test_check("rstanarm", invert = TRUE,
  +              filter = if (Sys.getenv("NOT_CRAN") != "true") "jm|mvmer")
  Initial log joint probability = -3395
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  ------------------------------------------------------------
  EXPERIMENTAL ALGORITHM:
    This procedure has not been thoroughly tested and may be unstable
    or buggy. The interface is subject to change.
  ------------------------------------------------------------
  
  
  
  Gradient evaluation took 6.3e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.63 seconds.
  Adjust your expectations accordingly!
  
  
  Begin eta adaptation.
  Iteration:   1 / 250 [  0%]  (Adaptation)
  Iteration:  50 / 250 [ 20%]  (Adaptation)
  Iteration: 100 / 250 [ 40%]  (Adaptation)
  Iteration: 150 / 250 [ 60%]  (Adaptation)
  Iteration: 200 / 250 [ 80%]  (Adaptation)
  Success! Found best value [eta = 1] earlier than expected.
  
  Begin stochastic gradient ascent.
    iter             ELBO   delta_ELBO_mean   delta_ELBO_med   notes 
  Informational Message: The maximum number of iterations is reached! The algorithm may not have converged.
  This variational approximation is not guaranteed to be meaningful.
  
  Drawing a sample of size 1000 from the approximate posterior... 
  COMPLETED.
  ------------------------------------------------------------
  EXPERIMENTAL ALGORITHM:
    This procedure has not been thoroughly tested and may be unstable
    or buggy. The interface is subject to change.
  ------------------------------------------------------------
  
  
  
  Gradient evaluation took 4.6e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.46 seconds.
  Adjust your expectations accordingly!
  
  
  Begin eta adaptation.
  Iteration:   1 / 250 [  0%]  (Adaptation)
  Iteration:  50 / 250 [ 20%]  (Adaptation)
  Iteration: 100 / 250 [ 40%]  (Adaptation)
  Iteration: 150 / 250 [ 60%]  (Adaptation)
  Success! Found best value [eta = 10] earlier than expected.
  
  Begin stochastic gradient ascent.
    iter             ELBO   delta_ELBO_mean   delta_ELBO_med   notes 
  Informational Message: The maximum number of iterations is reached! The algorithm may not have converged.
  This variational approximation is not guaranteed to be meaningful.
  
  Drawing a sample of size 1000 from the approximate posterior... 
  COMPLETED.
  
  Gradient evaluation took 7.1e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.71 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 20
             term_buffer = 2
  
  
   Elapsed Time: 0.014816 seconds (Warm-up)
                 0.008808 seconds (Sampling)
                 0.023624 seconds (Total)
  
  
  Gradient evaluation took 3.8e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.38 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 20
             term_buffer = 2
  
  
   Elapsed Time: 0.007494 seconds (Warm-up)
                 0.029482 seconds (Sampling)
                 0.036976 seconds (Total)
  
  
  Gradient evaluation took 3.7e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.37 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 20
             term_buffer = 2
  
  
   Elapsed Time: 0.008752 seconds (Warm-up)
                 0.005067 seconds (Sampling)
                 0.013819 seconds (Total)
  
  
  Gradient evaluation took 3.3e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.33 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 20
             term_buffer = 2
  
  
   Elapsed Time: 0.006556 seconds (Warm-up)
                 0.04208 seconds (Sampling)
                 0.048636 seconds (Total)
  
  
  Gradient evaluation took 5.5e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.55 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 15
             adapt_window = 75
             term_buffer = 10
  
  
   Elapsed Time: 0.03174 seconds (Warm-up)
                 0.015762 seconds (Sampling)
                 0.047502 seconds (Total)
  
  
  Gradient evaluation took 2.3e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.23 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 15
             adapt_window = 75
             term_buffer = 10
  
  
   Elapsed Time: 0.023512 seconds (Warm-up)
                 0.021255 seconds (Sampling)
                 0.044767 seconds (Total)
  
  
  Gradient evaluation took 2.1e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.21 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 15
             adapt_window = 75
             term_buffer = 10
  
  
   Elapsed Time: 0.019999 seconds (Warm-up)
                 0.02229 seconds (Sampling)
                 0.042289 seconds (Total)
  
  
  Gradient evaluation took 2.1e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.21 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 15
             adapt_window = 75
             term_buffer = 10
  
  
   Elapsed Time: 0.019009 seconds (Warm-up)
                 0.020195 seconds (Sampling)
                 0.039204 seconds (Total)
  
  Initial log joint probability = -306.809
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  
  Gradient evaluation took 7.2e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.72 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 15
             term_buffer = 2
  
  
   Elapsed Time: 0.005893 seconds (Warm-up)
                 0.005951 seconds (Sampling)
                 0.011844 seconds (Total)
  
  
  Gradient evaluation took 3.5e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.35 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 15
             term_buffer = 2
  
  
   Elapsed Time: 0.008283 seconds (Warm-up)
                 0.040727 seconds (Sampling)
                 0.04901 seconds (Total)
  
  
  Gradient evaluation took 5.1e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.51 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 7
             adapt_window = 38
             term_buffer = 5
  
  
   Elapsed Time: 0.006121 seconds (Warm-up)
                 0.008748 seconds (Sampling)
                 0.014869 seconds (Total)
  
  
   4-fold cross-validation
  
             Estimate  SE
  elpd_kfold    -82.6 4.6
  
   2-fold cross-validation
  
             Estimate  SE
  elpd_kfold   -100.9 9.4
  
  Gradient evaluation took 3.9e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.39 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 15
             term_buffer = 2
  
  
   Elapsed Time: 0.004983 seconds (Warm-up)
                 0.003733 seconds (Sampling)
                 0.008716 seconds (Total)
  
  
  Gradient evaluation took 2.5e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.25 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 15
             term_buffer = 2
  
  
   Elapsed Time: 0.001709 seconds (Warm-up)
                 0.001684 seconds (Sampling)
                 0.003393 seconds (Total)
  
  
  Gradient evaluation took 5.5e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.55 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 15
             term_buffer = 2
  
  
   Elapsed Time: 0.007865 seconds (Warm-up)
                 0.004301 seconds (Sampling)
                 0.012166 seconds (Total)
  
  
  Gradient evaluation took 3.7e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.37 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 15
             term_buffer = 2
  
  
   Elapsed Time: 0.006764 seconds (Warm-up)
                 0.005005 seconds (Sampling)
                 0.011769 seconds (Total)
  
  Error in new_CppObject_xp(fields$.module, fields$.pointer, ...) : 
    object 'SEED' not found
  ── 1. Error: print and summary methods ok for optimization (@test_methods.R#648)
  Exception: poisson_rng: Rate parameter is 0, but must be > 0!  (in 'model_count' at line 168)
  1: capture.output(fit <- stan_glm.nb(counts ~ outcome + treatment, algorithm = "optimizing", 
         seed = SEED)) at testthat/test_methods.R:648
  2: evalVis(expr)
  3: withVisible(eval(expr, pf))
  4: eval(expr, pf)
  5: eval(expr, pf)
  6: stan_glm.nb(counts ~ outcome + treatment, algorithm = "optimizing", seed = SEED)
  7: eval(mc, parent.frame())
  8: eval(mc, parent.frame())
  9: stan_glm(formula = counts ~ outcome + treatment, seed = SEED, algorithm = "optimizing", 
         family = structure(list(family = "neg_binomial_2", link = "log", linkfun = function (mu) 
         log(mu), linkinv = function (eta) 
         pmax(exp(eta), .Machine$double.eps), variance = function (mu, theta = Inf) 
         mu + mu^2/theta, dev.resids = function (y, mu, wt) 
         {
             stop("'dev.resids' function should not be called")
         }, aic = function (y, n, mu, wt, dev) 
         {
             stop("'aic' function should not have been called")
         }, mu.eta = function (eta) 
         pmax(exp(eta), .Machine$double.eps), initialize = expression({
             if (any(y < 0)) 
                 stop("negative values not allowed for the 'Poisson' family")
             n <- rep.int(1, nobs)
             mustart <- y + 0.1
         }), validmu = function (mu) 
         all(is.finite(mu)) && all(mu > 0), valideta = function (eta) 
         TRUE, simulate = function (object, nsim) 
         stop("'simulate' function should not have been called")), class = "family"))
  10: stan_glm.fit(x = X, y = Y, weights = weights, offset = offset, family = family, prior = prior, 
         prior_intercept = prior_intercept, prior_aux = prior_aux, prior_PD = prior_PD, 
         algorithm = algorithm, adapt_delta = adapt_delta, QR = QR, sparse = sparse, ...)
  11: optimizing(stanfit, data = standata, draws = 1000, constrained = TRUE, ...)
  12: optimizing(stanfit, data = standata, draws = 1000, constrained = TRUE, ...)
  13: .local(object, ...)
  14: sampler$call_sampler(c(args, dotlist))
  
  Initial log joint probability = -25083.8
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  ------------------------------------------------------------
  EXPERIMENTAL ALGORITHM:
    This procedure has not been thoroughly tested and may be unstable
    or buggy. The interface is subject to change.
  ------------------------------------------------------------
  
  
  
  Gradient evaluation took 5.8e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.58 seconds.
  Adjust your expectations accordingly!
  
  
  Begin eta adaptation.
  Iteration:   1 / 250 [  0%]  (Adaptation)
  Iteration:  50 / 250 [ 20%]  (Adaptation)
  Iteration: 100 / 250 [ 40%]  (Adaptation)
  Iteration: 150 / 250 [ 60%]  (Adaptation)
  Iteration: 200 / 250 [ 80%]  (Adaptation)
  Success! Found best value [eta = 1] earlier than expected.
  
  Begin stochastic gradient ascent.
    iter             ELBO   delta_ELBO_mean   delta_ELBO_med   notes 
     100         -315.821             1.000            1.000
     200         -161.577             0.977            1.000
     300         -148.682             0.680            0.955
     400         -144.920             0.517            0.955
     500         -134.239             0.429            0.087
     600         -125.319             0.370            0.087
     700         -118.261             0.325            0.080
     800         -123.001             0.290            0.080
     900         -120.168             0.260            0.071
    1000         -116.061             0.238            0.071
    1100         -115.933             0.138            0.060
    1200         -116.075             0.042            0.039
    1300         -114.335             0.035            0.035
    1400         -122.168             0.039            0.039
    1500         -116.574             0.036            0.039
    1600         -118.286             0.030            0.035
    1700         -114.750             0.027            0.031
    1800         -115.917             0.024            0.024
    1900         -115.784             0.022            0.015
    2000         -118.402             0.021            0.015
    2100         -118.077             0.021            0.015
    2200         -113.117             0.025            0.022
    2300         -113.369             0.024            0.022
    2400         -113.345             0.018            0.014
    2500         -115.384             0.015            0.014
    2600         -113.704             0.015            0.015
    2700         -113.951             0.012            0.010
    2800         -118.944             0.015            0.015
    2900         -113.840             0.019            0.018
    3000         -112.662             0.018            0.015
    3100         -115.124             0.020            0.018
    3200         -114.282             0.016            0.015
    3300         -113.311             0.017            0.015
    3400         -112.431             0.018            0.015
    3500         -113.099             0.017            0.010
    3600         -113.455             0.015            0.009   MEDIAN ELBO CONVERGED
  
  Drawing a sample of size 1000 from the approximate posterior... 
  COMPLETED.
  
  SAMPLING FOR MODEL 'continuous' NOW (CHAIN 1).
  
  Gradient evaluation took 4.8e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.48 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 7
             adapt_window = 38
             term_buffer = 5
  
  Iteration:  1 / 100 [  1%]  (Warmup)
  Iteration: 10 / 100 [ 10%]  (Warmup)
  Iteration: 20 / 100 [ 20%]  (Warmup)
  Iteration: 30 / 100 [ 30%]  (Warmup)
  Iteration: 40 / 100 [ 40%]  (Warmup)
  Iteration: 50 / 100 [ 50%]  (Warmup)
  Iteration: 51 / 100 [ 51%]  (Sampling)
  Iteration: 60 / 100 [ 60%]  (Sampling)
  Iteration: 70 / 100 [ 70%]  (Sampling)
  Iteration: 80 / 100 [ 80%]  (Sampling)
  Iteration: 90 / 100 [ 90%]  (Sampling)
  Iteration: 100 / 100 [100%]  (Sampling)
  
   Elapsed Time: 0.018866 seconds (Warm-up)
                 0.019607 seconds (Sampling)
                 0.038473 seconds (Total)
  
  
  Gradient evaluation took 0.000119 seconds
  1000 transitions using 10 leapfrog steps per transition would take 1.19 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 7
             adapt_window = 38
             term_buffer = 5
  
  
   Elapsed Time: 0.209692 seconds (Warm-up)
                 0.126208 seconds (Sampling)
                 0.3359 seconds (Total)
  
  
  Gradient evaluation took 9.3e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.93 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 7
             adapt_window = 38
             term_buffer = 5
  
  
   Elapsed Time: 0.197977 seconds (Warm-up)
                 0.135834 seconds (Sampling)
                 0.333811 seconds (Total)
  
  Initial log joint probability = -470.264
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  ------------------------------------------------------------
  EXPERIMENTAL ALGORITHM:
    This procedure has not been thoroughly tested and may be unstable
    or buggy. The interface is subject to change.
  ------------------------------------------------------------
  
  
  
  Gradient evaluation took 6e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.6 seconds.
  Adjust your expectations accordingly!
  
  
  Begin eta adaptation.
  Iteration:   1 / 250 [  0%]  (Adaptation)
  Iteration:  50 / 250 [ 20%]  (Adaptation)
  Iteration: 100 / 250 [ 40%]  (Adaptation)
  Iteration: 150 / 250 [ 60%]  (Adaptation)
  Iteration: 200 / 250 [ 80%]  (Adaptation)
  Success! Found best value [eta = 1] earlier than expected.
  
  Begin stochastic gradient ascent.
    iter             ELBO   delta_ELBO_mean   delta_ELBO_med   notes 
     100         -145.954             1.000            1.000
     200         -132.991             0.549            1.000
     300         -114.222             0.421            0.164
     400          -95.429             0.365            0.197
     500          -91.911             0.299            0.164
     600          -91.832             0.250            0.164
     700          -92.239             0.215            0.097
     800          -92.882             0.189            0.097
     900          -92.856             0.168            0.038
    1000          -98.595             0.157            0.058
    1100          -93.141             0.063            0.058
    1200          -92.020             0.054            0.038
    1300          -91.463             0.038            0.012
    1400          -92.597             0.020            0.012
    1500          -94.062             0.018            0.012
    1600          -93.247             0.018            0.012
    1700          -91.538             0.020            0.012
    1800          -91.186             0.019            0.012
    1900          -91.569             0.020            0.012
    2000          -91.299             0.014            0.012
    2100          -91.280             0.008            0.009   MEAN ELBO CONVERGED   MEDIAN ELBO CONVERGED
  
  Drawing a sample of size 1000 from the approximate posterior... 
  COMPLETED.
  ------------------------------------------------------------
  EXPERIMENTAL ALGORITHM:
    This procedure has not been thoroughly tested and may be unstable
    or buggy. The interface is subject to change.
  ------------------------------------------------------------
  
  
  
  Gradient evaluation took 5.4e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.54 seconds.
  Adjust your expectations accordingly!
  
  
  Begin eta adaptation.
  Iteration:   1 / 250 [  0%]  (Adaptation)
  Iteration:  50 / 250 [ 20%]  (Adaptation)
  Iteration: 100 / 250 [ 40%]  (Adaptation)
  Iteration: 150 / 250 [ 60%]  (Adaptation)
  Iteration: 200 / 250 [ 80%]  (Adaptation)
  Success! Found best value [eta = 1] earlier than expected.
  
  Begin stochastic gradient ascent.
    iter             ELBO   delta_ELBO_mean   delta_ELBO_med   notes 
     100         -430.217             1.000            1.000
     200         -167.237             1.286            1.573
     300         -135.181             0.937            1.000
     400         -125.938             0.721            1.000
     500         -126.426             0.577            0.237
     600         -115.669             0.497            0.237
     700         -100.203             0.448            0.154
     800          -98.546             0.394            0.154
     900         -103.399             0.355            0.093
    1000          -95.673             0.328            0.093
    1100          -96.011             0.228            0.081
    1200          -96.648             0.072            0.073
    1300          -93.732             0.051            0.047
    1400          -94.582             0.045            0.031
    1500         -101.002             0.051            0.047
    1600          -93.650             0.049            0.047
    1700          -93.611             0.034            0.031
    1800          -95.768             0.034            0.031
    1900          -91.905             0.034            0.031
    2000          -95.274             0.029            0.031
    2100          -94.493             0.030            0.031
    2200          -97.764             0.032            0.033
    2300         -101.370             0.033            0.035
    2400          -92.819             0.041            0.036
    2500          -99.061             0.041            0.036
    2600          -91.689             0.041            0.036
    2700          -91.545             0.041            0.036
    2800          -91.153             0.040            0.036
    2900          -92.620             0.037            0.035
    3000          -99.165             0.040            0.036
    3100          -92.286             0.047            0.063
    3200          -92.048             0.044            0.063
    3300          -94.187             0.042            0.063
    3400          -92.850             0.035            0.023
    3500          -93.454             0.029            0.016
    3600          -96.340             0.024            0.016
    3700          -93.506             0.027            0.023
    3800          -95.237             0.028            0.023
    3900          -91.093             0.031            0.030
    4000          -93.131             0.027            0.023
    4100          -95.312             0.021            0.023
    4200          -93.196             0.023            0.023
    4300          -95.324             0.023            0.023
    4400          -94.142             0.023            0.023
    4500          -91.072             0.026            0.023
    4600          -94.138             0.026            0.023
    4700          -92.411             0.025            0.023
    4800          -92.032             0.024            0.023
    4900          -93.173             0.020            0.022
    5000          -94.890             0.020            0.022
    5100          -92.819             0.020            0.022
    5200          -91.472             0.019            0.019
    5300          -91.612             0.017            0.018
    5400          -93.607             0.018            0.019
    5500          -91.916             0.016            0.018
    5600          -93.118             0.014            0.018
    5700          -93.682             0.013            0.015
    5800          -96.688             0.016            0.018
    5900          -91.116             0.021            0.018
    6000          -93.746             0.022            0.021
    6100          -92.590             0.021            0.018
    6200          -91.511             0.020            0.018
    6300          -91.170             0.021            0.018
    6400          -92.732             0.020            0.017
    6500          -91.396             0.020            0.015
    6600          -93.474             0.021            0.017
    6700          -92.197             0.022            0.017
    6800          -90.948             0.020            0.015
    6900          -95.977             0.019            0.015
    7000          -91.478             0.021            0.015
    7100          -92.406             0.021            0.015
    7200          -91.225             0.021            0.015
    7300          -91.872             0.021            0.015
    7400          -92.486             0.020            0.014
    7500          -92.755             0.019            0.014
    7600          -92.094             0.018            0.013
    7700          -90.920             0.017            0.013
    7800          -93.067             0.018            0.013
    7900          -93.529             0.014            0.010
    8000          -92.656             0.010            0.009   MEAN ELBO CONVERGED   MEDIAN ELBO CONVERGED
  
  Drawing a sample of size 1000 from the approximate posterior... 
  COMPLETED.
  
  Gradient evaluation took 8.8e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.88 seconds.
  Adjust your expectations accordingly!
  
  
  
   Elapsed Time: 1.19506 seconds (Warm-up)
                 0.682095 seconds (Sampling)
                 1.87716 seconds (Total)
  
  
  Gradient evaluation took 6.3e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.63 seconds.
  Adjust your expectations accordingly!
  
  
  
   Elapsed Time: 1.86369 seconds (Warm-up)
                 0.627542 seconds (Sampling)
                 2.49124 seconds (Total)
  
  
  Gradient evaluation took 6.6e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.66 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 7
             adapt_window = 38
             term_buffer = 5
  
  
   Elapsed Time: 0.020436 seconds (Warm-up)
                 0.018266 seconds (Sampling)
                 0.038702 seconds (Total)
  
  
  Gradient evaluation took 3.2e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.32 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 7
             adapt_window = 38
             term_buffer = 5
  
  
   Elapsed Time: 0.021126 seconds (Warm-up)
                 0.01453 seconds (Sampling)
                 0.035656 seconds (Total)
  
  
  Gradient evaluation took 5.5e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.55 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  
   Elapsed Time: 0.000542 seconds (Warm-up)
                 0.001391 seconds (Sampling)
                 0.001933 seconds (Total)
  
  
  Gradient evaluation took 2.9e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.29 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  
   Elapsed Time: 0.002762 seconds (Warm-up)
                 0.002272 seconds (Sampling)
                 0.005034 seconds (Total)
  
  
  Gradient evaluation took 4.9e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.49 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  
   Elapsed Time: 0.000375 seconds (Warm-up)
                 0.000611 seconds (Sampling)
                 0.000986 seconds (Total)
  
  
  Gradient evaluation took 2e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.2 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  
   Elapsed Time: 0.000366 seconds (Warm-up)
                 0.000531 seconds (Sampling)
                 0.000897 seconds (Total)
  
  
  Gradient evaluation took 0.000119 seconds
  1000 transitions using 10 leapfrog steps per transition would take 1.19 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  
   Elapsed Time: 0.010427 seconds (Warm-up)
                 0.011723 seconds (Sampling)
                 0.02215 seconds (Total)
  
  
  Gradient evaluation took 7.8e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.78 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  
   Elapsed Time: 0.011831 seconds (Warm-up)
                 0.010682 seconds (Sampling)
                 0.022513 seconds (Total)
  
  ------------------------------------------------------------
  EXPERIMENTAL ALGORITHM:
    This procedure has not been thoroughly tested and may be unstable
    or buggy. The interface is subject to change.
  ------------------------------------------------------------
  
  
  
  Gradient evaluation took 5.2e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.52 seconds.
  Adjust your expectations accordingly!
  
  
  Begin eta adaptation.
  Iteration:   1 / 250 [  0%]  (Adaptation)
  Iteration:  50 / 250 [ 20%]  (Adaptation)
  Iteration: 100 / 250 [ 40%]  (Adaptation)
  Iteration: 150 / 250 [ 60%]  (Adaptation)
  Iteration: 200 / 250 [ 80%]  (Adaptation)
  Success! Found best value [eta = 1] earlier than expected.
  
  Begin stochastic gradient ascent.
    iter             ELBO   delta_ELBO_mean   delta_ELBO_med   notes 
     100         -133.538             1.000            1.000
     200         -113.327             0.589            1.000
     300          -92.778             0.467            0.221
     400          -91.923             0.352            0.221
     500          -91.622             0.282            0.178
     600          -90.498             0.237            0.178
     700          -90.696             0.204            0.012
     800          -90.789             0.179            0.012
     900          -90.784             0.159            0.009   MEDIAN ELBO CONVERGED
  
  Drawing a sample of size 1000 from the approximate posterior... 
  COMPLETED.
  Initial log joint probability = -470.264
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  
  Gradient evaluation took 5.4e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.54 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  
   Elapsed Time: 0.000525 seconds (Warm-up)
                 0.001315 seconds (Sampling)
                 0.00184 seconds (Total)
  
  
  Gradient evaluation took 2.7e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.27 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  
   Elapsed Time: 0.002616 seconds (Warm-up)
                 0.002171 seconds (Sampling)
                 0.004787 seconds (Total)
  
  Initial log joint probability = -569.387
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -154193
  Exception: beta_lpdf: First shape parameter[4] is 0, but must be > 0!  (in 'model_continuous' at line 192)
  
  Exception: beta_lpdf: First shape parameter[4] is 0, but must be > 0!  (in 'model_continuous' at line 192)
  
  Exception: beta_lpdf: First shape parameter[14] is 0, but must be > 0!  (in 'model_continuous' at line 192)
  
  Exception: beta_lpdf: First shape parameter[47] is 0, but must be > 0!  (in 'model_continuous' at line 192)
  
  
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -491.938
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -879.578
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -484.693
  Exception: beta_lpdf: Second shape parameter[1] is 0, but must be > 0!  (in 'model_continuous' at line 185)
  
  
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -426.896
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -615.262
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Rejecting initial value:
    Error evaluating the log probability at the initial value.
  Exception: beta_lpdf: First shape parameter[6] is 0, but must be > 0!  (in 'model_continuous' at line 185)
  
  Rejecting initial value:
    Error evaluating the log probability at the initial value.
  Exception: beta_lpdf: First shape parameter[6] is 0, but must be > 0!  (in 'model_continuous' at line 185)
  
  Initial log joint probability = -257.044
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -569.239
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  
  SAMPLING FOR MODEL 'continuous' NOW (CHAIN 1).
  
  Gradient evaluation took 0.000259 seconds
  1000 transitions using 10 leapfrog steps per transition would take 2.59 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 7
             adapt_window = 38
             term_buffer = 5
  
  Iteration:  1 / 100 [  1%]  (Warmup)
  Iteration: 10 / 100 [ 10%]  (Warmup)
  Iteration: 20 / 100 [ 20%]  (Warmup)
  Iteration: 30 / 100 [ 30%]  (Warmup)
  Iteration: 40 / 100 [ 40%]  (Warmup)
  Iteration: 50 / 100 [ 50%]  (Warmup)
  Iteration: 51 / 100 [ 51%]  (Sampling)
  Iteration: 60 / 100 [ 60%]  (Sampling)
  Iteration: 70 / 100 [ 70%]  (Sampling)
  Iteration: 80 / 100 [ 80%]  (Sampling)
  Iteration: 90 / 100 [ 90%]  (Sampling)
  Iteration: 100 / 100 [100%]  (Sampling)
  
   Elapsed Time: 0.178234 seconds (Warm-up)
                 0.234107 seconds (Sampling)
                 0.412341 seconds (Total)
  
  
  SAMPLING FOR MODEL 'continuous' NOW (CHAIN 2).
  
  Gradient evaluation took 0.000243 seconds
  1000 transitions using 10 leapfrog steps per transition would take 2.43 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 7
             adapt_window = 38
             term_buffer = 5
  
  Iteration:  1 / 100 [  1%]  (Warmup)
  Iteration: 10 / 100 [ 10%]  (Warmup)
  Iteration: 20 / 100 [ 20%]  (Warmup)
  Iteration: 30 / 100 [ 30%]  (Warmup)
  Iteration: 40 / 100 [ 40%]  (Warmup)
  Iteration: 50 / 100 [ 50%]  (Warmup)
  Iteration: 51 / 100 [ 51%]  (Sampling)
  Iteration: 60 / 100 [ 60%]  (Sampling)
  Iteration: 70 / 100 [ 70%]  (Sampling)
  Iteration: 80 / 100 [ 80%]  (Sampling)
  Iteration: 90 / 100 [ 90%]  (Sampling)
  Iteration: 100 / 100 [100%]  (Sampling)
  
   Elapsed Time: 0.305493 seconds (Warm-up)
                 0.273946 seconds (Sampling)
                 0.579439 seconds (Total)
  
  Initial log joint probability = -4956.4
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -6610.95
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -4709.91
  Exception: beta_lpdf: Second shape parameter[14] is 0, but must be > 0!  (in 'model_continuous' at line 192)
  
  
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -4551.1
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -5909.47
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Rejecting initial value:
    Error evaluating the log probability at the initial value.
  Exception: beta_lpdf: First shape parameter[5] is 0, but must be > 0!  (in 'model_continuous' at line 192)
  
  Initial log joint probability = -316.539
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -2387.7
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -3331.05
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -2279.49
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -2155.46
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Initial log joint probability = -3306.94
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  Rejecting initial value:
    Error evaluating the log probability at the initial value.
  Exception: beta_lpdf: First shape parameter[9] is 0, but must be > 0!  (in 'model_continuous' at line 192)
  
  Initial log joint probability = -188.536
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  
  SAMPLING FOR MODEL 'continuous' NOW (CHAIN 1).
  
  Gradient evaluation took 0.003241 seconds
  1000 transitions using 10 leapfrog steps per transition would take 32.41 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  Iteration: 1 / 1 [100%]  (Sampling)
  
   Elapsed Time: 3e-06 seconds (Warm-up)
                 0.004775 seconds (Sampling)
                 0.004778 seconds (Total)
  
  
  SAMPLING FOR MODEL 'continuous' NOW (CHAIN 1).
  
  Gradient evaluation took 0.001375 seconds
  1000 transitions using 10 leapfrog steps per transition would take 13.75 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  Iteration: 1 / 1 [100%]  (Sampling)
  
   Elapsed Time: 2e-06 seconds (Warm-up)
                 0.003426 seconds (Sampling)
                 0.003428 seconds (Total)
  
  
  SAMPLING FOR MODEL 'continuous' NOW (CHAIN 1).
  Rejecting initial value:
    Error evaluating the log probability at the initial value.
  Exception: beta_lpdf: Second shape parameter[607] is 0, but must be > 0!  (in 'model_continuous' at line 192)
  
  Rejecting initial value:
    Error evaluating the log probability at the initial value.
  Exception: beta_lpdf: Second shape parameter[9] is 0, but must be > 0!  (in 'model_continuous' at line 192)
  
  Rejecting initial value:
    Error evaluating the log probability at the initial value.
  Exception: beta_lpdf: Second shape parameter[3] is 0, but must be > 0!  (in 'model_continuous' at line 192)
  
  
  Gradient evaluation took 0.001845 seconds
  1000 transitions using 10 leapfrog steps per transition would take 18.45 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  Iteration: 1 / 1 [100%]  (Sampling)
  
   Elapsed Time: 3e-06 seconds (Warm-up)
                 0.003297 seconds (Sampling)
                 0.0033 seconds (Total)
  
  
  SAMPLING FOR MODEL 'continuous' NOW (CHAIN 1).
  
  Gradient evaluation took 0.001986 seconds
  1000 transitions using 10 leapfrog steps per transition would take 19.86 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  Iteration: 1 / 1 [100%]  (Sampling)
  
   Elapsed Time: 3e-06 seconds (Warm-up)
                 0.003663 seconds (Sampling)
                 0.003666 seconds (Total)
  
  
  SAMPLING FOR MODEL 'continuous' NOW (CHAIN 1).
  
  Gradient evaluation took 0.001329 seconds
  1000 transitions using 10 leapfrog steps per transition would take 13.29 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  Iteration: 1 / 1 [100%]  (Sampling)
  
   Elapsed Time: 2e-06 seconds (Warm-up)
                 0.003337 seconds (Sampling)
                 0.003339 seconds (Total)
  
  
  SAMPLING FOR MODEL 'continuous' NOW (CHAIN 1).
  
  Gradient evaluation took 0.001513 seconds
  1000 transitions using 10 leapfrog steps per transition would take 15.13 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  Iteration: 1 / 1 [100%]  (Sampling)
  
   Elapsed Time: 2e-06 seconds (Warm-up)
                 0.003517 seconds (Sampling)
                 0.003519 seconds (Total)
  
  Initial log joint probability = -228.234
  Optimization terminated normally: 
    Convergence detected: relative gradient magnitude is below tolerance
  
  Gradient evaluation took 0.000111 seconds
  1000 transitions using 10 leapfrog steps per transition would take 1.11 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  
   Elapsed Time: 0.002758 seconds (Warm-up)
                 0.002234 seconds (Sampling)
                 0.004992 seconds (Total)
  
  
  Gradient evaluation took 7.5e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.75 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  
   Elapsed Time: 0.008402 seconds (Warm-up)
                 0.009318 seconds (Sampling)
                 0.01772 seconds (Total)
  
  
  Gradient evaluation took 0.000114 seconds
  1000 transitions using 10 leapfrog steps per transition would take 1.14 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 20
             term_buffer = 2
  
  
   Elapsed Time: 0.075652 seconds (Warm-up)
                 0.267059 seconds (Sampling)
                 0.342711 seconds (Total)
  
  
  Gradient evaluation took 7.7e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.77 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 20
             term_buffer = 2
  
  
   Elapsed Time: 0.166773 seconds (Warm-up)
                 0.163559 seconds (Sampling)
                 0.330332 seconds (Total)
  
  
  Gradient evaluation took 6.4e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.64 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 20
             term_buffer = 2
  
  
   Elapsed Time: 0.113887 seconds (Warm-up)
                 0.184628 seconds (Sampling)
                 0.298515 seconds (Total)
  
  
  Gradient evaluation took 7.4e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.74 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 20
             term_buffer = 2
  
  
   Elapsed Time: 0.07576 seconds (Warm-up)
                 0.237574 seconds (Sampling)
                 0.313334 seconds (Total)
  
  
  Gradient evaluation took 0.0001 seconds
  1000 transitions using 10 leapfrog steps per transition would take 1 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  
   Elapsed Time: 0.00146 seconds (Warm-up)
                 0.001649 seconds (Sampling)
                 0.003109 seconds (Total)
  
  
  Gradient evaluation took 6.1e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.61 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: No variance estimation is
           performed for num_warmup < 20
  
  
   Elapsed Time: 0.001484 seconds (Warm-up)
                 0.001835 seconds (Sampling)
                 0.003319 seconds (Total)
  
  
  Gradient evaluation took 0.000102 seconds
  1000 transitions using 10 leapfrog steps per transition would take 1.02 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 20
             term_buffer = 2
  
  
   Elapsed Time: 0.01706 seconds (Warm-up)
                 0.018415 seconds (Sampling)
                 0.035475 seconds (Total)
  
  
  Gradient evaluation took 7.9e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.79 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 20
             term_buffer = 2
  
  
   Elapsed Time: 0.016197 seconds (Warm-up)
                 0.021421 seconds (Sampling)
                 0.037618 seconds (Total)
  
  
  Gradient evaluation took 9.8e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.98 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 20
             term_buffer = 2
  
  
   Elapsed Time: 0.015901 seconds (Warm-up)
                 0.016985 seconds (Sampling)
                 0.032886 seconds (Total)
  
  
  Gradient evaluation took 6.8e-05 seconds
  1000 transitions using 10 leapfrog steps per transition would take 0.68 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 3
             adapt_window = 20
             term_buffer = 2
  
  
   Elapsed Time: 0.016938 seconds (Warm-up)
                 0.020856 seconds (Sampling)
                 0.037794 seconds (Total)
  
  
  Gradient evaluation took 0.000151 seconds
  1000 transitions using 10 leapfrog steps per transition would take 1.51 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 7
             adapt_window = 38
             term_buffer = 5
  
  
   Elapsed Time: 0.041508 seconds (Warm-up)
                 0.046623 seconds (Sampling)
                 0.088131 seconds (Total)
  
  
  Gradient evaluation took 0.000114 seconds
  1000 transitions using 10 leapfrog steps per transition would take 1.14 seconds.
  Adjust your expectations accordingly!
  
  
  WARNING: There aren't enough warmup iterations to fit the
           three stages of adaptation as currently configured.
           Reducing each adaptation stage to 15%/75%/10% of
           the given number of warmup iterations:
             init_buffer = 7
             adapt_window = 38
             term_buffer = 5
  
  
   Elapsed Time: 0.04956 seconds (Warm-up)
                 0.035378 seconds (Sampling)
                 0.084938 seconds (Total)
  
  DIAGNOSTIC(S) FROM PARSER:
  Info: left-hand side variable (name=theta_L_mark) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=pi) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=zeta_mark) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=rho_mark) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=z_T_mark) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=rho_mark) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=theta_L_mark) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=b_mark) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=theta_L_mark) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=theta_L_mark) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=theta_L_mark) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=b_mark) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=b_mark) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=pos_reg) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=nu) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=pos_rho) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=pos) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=pos0) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=pos1) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=ret) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=ret) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=ret) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=pos) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=running_sum) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=running_sum) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=running_sum) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=running_sum) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Info: left-hand side variable (name=running_sum) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Dense:1:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Core:531:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Dense:2:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/LU:47:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Dense:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Cholesky:12:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Jacobi:29:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Dense:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Cholesky:43:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Dense:4:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/QR:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Householder:27:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Dense:5:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/SVD:48:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Dense:6:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Geometry:58:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Dense:7:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Eigenvalues:58:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:31:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Sparse:26:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/SparseCore:66:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:31:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Sparse:27:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/OrderingMethods:71:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:31:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Sparse:29:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/SparseCholesky:43:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:31:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Sparse:32:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/SparseQR:35:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:31:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/Sparse:33:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/IterativeLinearSolvers:46:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:32:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/CholmodSupport:45:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:35:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/unsupported/Eigen/KroneckerProduct:34:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/unsupported/Eigen/../../Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:39:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/unsupported/Eigen/Polynomials:135:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/unsupported/Eigen/../../Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:3:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigen.h:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/RcppEigenForward.h:40:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/unsupported/Eigen/SparseExtra:51:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/unsupported/Eigen/../../Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
      #pragma clang diagnostic pop
                               ^
  In file included from file5eae3ee5b9b.cpp:8:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math.hpp:4:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/rev/mat.hpp:12:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat.hpp:309:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/prob/multinomial_rng.hpp:10:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/scal/prob/binomial_rng.hpp:10:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/random/binomial_distribution.hpp:407:9: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types]
          struct {
          ^
  In file included from file5eae3ee5b9b.cpp:8:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math.hpp:4:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/rev/mat.hpp:12:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat.hpp:325:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr.hpp:44:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint.hpp:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/ublas_wrapper.hpp:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/algebra/default_operations.hpp:26:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/unit_helper.hpp:23:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/quantity.hpp:29:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/conversion.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/detail/conversion_impl.hpp:20:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/heterogeneous_system.hpp:34:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/static_rational.hpp:166:10: warning: extension used [-Wlanguage-extension-token]
  #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
           ^
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/typeof/typeof.hpp:196:13: note: expanded from macro 'BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP'
       <boost/typeof/incr_registration_group.hpp>
              ^
  In file included from file5eae3ee5b9b.cpp:8:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math.hpp:4:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/rev/mat.hpp:12:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat.hpp:325:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr.hpp:44:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint.hpp:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/ublas_wrapper.hpp:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/algebra/default_operations.hpp:26:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/unit_helper.hpp:23:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/quantity.hpp:29:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/conversion.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/detail/conversion_impl.hpp:20:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/heterogeneous_system.hpp:35:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/dimension.hpp:21:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/detail/dimension_list.hpp:125:10: warning: extension used [-Wlanguage-extension-token]
  #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
           ^
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/typeof/typeof.hpp:196:13: note: expanded from macro 'BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP'
       <boost/typeof/incr_registration_group.hpp>
              ^
  In file included from file5eae3ee5b9b.cpp:8:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math.hpp:4:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/rev/mat.hpp:12:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat.hpp:325:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr.hpp:44:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint.hpp:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/ublas_wrapper.hpp:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/algebra/default_operations.hpp:26:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/unit_helper.hpp:23:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/quantity.hpp:29:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/conversion.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/detail/conversion_impl.hpp:20:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/heterogeneous_system.hpp:35:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/dimension.hpp:21:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/detail/dimension_list.hpp:131:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/dimensionless_type.hpp:49:10: warning: extension used [-Wlanguage-extension-token]
  #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
           ^
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/typeof/typeof.hpp:196:13: note: expanded from macro 'BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP'
       <boost/typeof/incr_registration_group.hpp>
              ^
  In file included from file5eae3ee5b9b.cpp:8:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math.hpp:4:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/rev/mat.hpp:12:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat.hpp:325:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr.hpp:44:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint.hpp:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/ublas_wrapper.hpp:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/algebra/default_operations.hpp:26:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/unit_helper.hpp:23:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/quantity.hpp:29:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/conversion.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/detail/conversion_impl.hpp:20:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/heterogeneous_system.hpp:39:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/detail/linear_algebra.hpp:20:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/dim.hpp:75:10: warning: extension used [-Wlanguage-extension-token]
  #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
           ^
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/typeof/typeof.hpp:196:13: note: expanded from macro 'BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP'
       <boost/typeof/incr_registration_group.hpp>
              ^
  In file included from file5eae3ee5b9b.cpp:8:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math.hpp:4:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/rev/mat.hpp:12:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat.hpp:325:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr.hpp:44:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint.hpp:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/ublas_wrapper.hpp:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/algebra/default_operations.hpp:26:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/unit_helper.hpp:23:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/quantity.hpp:29:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/conversion.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/detail/conversion_impl.hpp:20:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/heterogeneous_system.hpp:40:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/detail/unscale.hpp:28:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/scale.hpp:139:10: warning: extension used [-Wlanguage-extension-token]
  #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
           ^
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/typeof/typeof.hpp:196:13: note: expanded from macro 'BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP'
       <boost/typeof/incr_registration_group.hpp>
              ^
  In file included from file5eae3ee5b9b.cpp:8:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math.hpp:4:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/rev/mat.hpp:12:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat.hpp:325:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr.hpp:44:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint.hpp:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/ublas_wrapper.hpp:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/algebra/default_operations.hpp:26:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/unit_helper.hpp:23:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/quantity.hpp:29:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/conversion.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/detail/conversion_impl.hpp:20:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/heterogeneous_system.hpp:120:10: warning: extension used [-Wlanguage-extension-token]
  #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
           ^
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/typeof/typeof.hpp:196:13: note: expanded from macro 'BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP'
       <boost/typeof/incr_registration_group.hpp>
              ^
  In file included from file5eae3ee5b9b.cpp:8:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math.hpp:4:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/rev/mat.hpp:12:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat.hpp:325:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr.hpp:44:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint.hpp:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/ublas_wrapper.hpp:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/algebra/default_operations.hpp:26:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/unit_helper.hpp:23:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/quantity.hpp:29:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/conversion.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/detail/conversion_impl.hpp:21:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/homogeneous_system.hpp:99:10: warning: extension used [-Wlanguage-extension-token]
  #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
           ^
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/typeof/typeof.hpp:196:13: note: expanded from macro 'BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP'
       <boost/typeof/incr_registration_group.hpp>
              ^
  In file included from file5eae3ee5b9b.cpp:8:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math.hpp:4:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/rev/mat.hpp:12:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat.hpp:325:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr.hpp:44:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:17:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint.hpp:25:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/ublas_wrapper.hpp:30:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/algebra/default_operations.hpp:26:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/numeric/odeint/util/unit_helper.hpp:23:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/units/quantity.hpp:495:10: warning: extension used [-Wlanguage-extension-token]
  #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
           ^
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/typeof/typeof.hpp:196:13: note: expanded from macro 'BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP'
       <boost/typeof/incr_registration_group.hpp>
              ^
  In file included from file5eae3ee5b9b.cpp:8:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math.hpp:4:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/rev/mat.hpp:12:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat.hpp:325:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/arr.hpp:49:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/scal.hpp:316:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/scal/prob/neg_binomial_2_ccdf_log.hpp:5:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/scal/prob/neg_binomial_2_lccdf.hpp:11:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/scal/prob/neg_binomial_ccdf_log.hpp:5:
  In file included from /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/scal/prob/neg_binomial_lccdf.hpp:24:
  In file included from /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/random/negative_binomial_distribution.hpp:21:
  /tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include/boost/random/poisson_distribution.hpp:338:9: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types]
          struct {
          ^
  file5eae3ee5b9b.cpp:34:1: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
  vector_d
  ^~~~~~~~
  stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:38:24: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
                   const vector_d& tau,
                         ^~~~~~~~
                         stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:39:24: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
                   const vector_d& scale,
                         ^~~~~~~~
                         stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:40:24: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
                   const vector_d& zeta,
                         ^~~~~~~~
                         stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:41:24: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
                   const vector_d& rho,
                         ^~~~~~~~
                         stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:42:24: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
                   const vector_d& z_T) {
                         ^~~~~~~~
                         stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:190:9: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
          vector_d
          ^~~~~~~~
          stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:194:24: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
                   const vector_d& tau,
                         ^~~~~~~~
                         stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:195:24: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
                   const vector_d& scale,
                         ^~~~~~~~
                         stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:196:24: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
                   const vector_d& zeta,
                         ^~~~~~~~
                         stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:197:24: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
                   const vector_d& rho,
                         ^~~~~~~~
                         stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:198:24: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
                   const vector_d& z_T, std::ostream* pstream__ = &Rcpp::Rcout) const {
                         ^~~~~~~~
                         stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:203:1: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
  vector_d
  ^~~~~~~~
  stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:204:14: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
  make_b(const vector_d& z_b,
               ^~~~~~~~
               stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:205:18: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
             const vector_d& theta_L,
                   ^~~~~~~~
                   stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:312:9: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
          vector_d
          ^~~~~~~~
          stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:313:22: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
      operator()(const vector_d& z_b,
                       ^~~~~~~~
                       stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:314:18: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
             const vector_d& theta_L,
                   ^~~~~~~~
                   stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  file5eae3ee5b9b.cpp:322:16: error: unknown type name 'vector_d'; did you mean 'stan::math::vector_d'?
  decov_lp(const vector_d& z_b,
                 ^~~~~~~~
                 stan::math::vector_d
  /data/gannet/ripley/R/test-clang/StanHeaders/include/stan/math/prim/mat/fun/typedefs.hpp:24:50: note: 'stan::math::vector_d' declared here
  typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector_d;
                                                   ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  27 warnings and 20 errors generated.
  make[1]: *** [/data/gannet/ripley/R/R-clang/etc/Makeconf:166: file5eae3ee5b9b.o] Error 1
  make[1]: Target 'all' not remade because of errors.
  make[1]: Entering directory '/tmp/RtmpKOjKJn/sourceCpp-x86_64-pc-linux-gnu-0.12.19/sourcecpp_5eae4532b025'
  clang++ -std=gnu++11 -I"/data/gannet/ripley/R/R-clang/include" -DNDEBUG   -I"/data/gannet/ripley/R/test-clang/Rcpp/include/"  -I"/tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/"  -I"/tmp/RtmpVELL3j/RLIBS_5d12466d8412/RcppEigen/include/unsupported"  -I"/data/gannet/ripley/R/test-clang/rstan/include/boost_not_in_BH" -I"/tmp/RtmpVELL3j/RLIBS_5d12466d8412/BH/include" -I"/data/gannet/ripley/R/test-clang/StanHeaders/include/src/"  -I"/data/gannet/ripley/R/test-clang/StanHeaders/include/"  -I"/data/gannet/ripley/R/test-clang/rstan/include" -DEIGEN_NO_DEBUG  -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DBOOST_NO_CXX11_RVALUE_REFERENCES  -I"/data/gannet/ripley/R/test-clang/Rcpp/include" -I"/data/gannet/ripley/R/test-clang/rstan/include" -I"/tmp/RtmpKOjKJn/sourceCpp-x86_64-pc-linux-gnu-0.12.19" -isystem /usr/local/clang/include   -fpic  -g -O3 -Wall -pedantic -frtti  -c file5eae3ee5b9b.cpp -o file5eae3ee5b9b.o
  make[1]: Leaving directory '/tmp/RtmpKOjKJn/sourceCpp-x86_64-pc-linux-gnu-0.12.19/sourcecpp_5eae4532b025'
  ── 2. Error: (unknown) (@test_stan_functions.R#59)  ────────────────────────────
  Error 1 occurred building shared library.
  1: expose_stan_functions(stanc_ret) at testthat/test_stan_functions.R:59
  2: Rcpp::sourceCpp(code = paste(lines, collapse = "\n"), ...)
  3: stop("Error ", status, " occurred building shared library.")
  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "// [[Rcpp::depends(rstan)]]" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "#include <Rcpp.h>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "#include <RcppEigen.h>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     /data/gannet/ripley/R/test-clang/rstan/include/boost_not_in_BH/boost/exception/exception.hpp 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "#include</data/gannet/ripley/R/test-clang/rstan/include/boost_not_in_BH/boost/exception/exception.hpp>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   /data/gannet/ripley/R/test-clang/rstan/include/boost_not_in_BH/boost/fusion/support/unused.hpp 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "#include</data/gannet/ripley/R/test-clang/rstan/include/boost_not_in_BH/boost/fusion/support/unused.hpp>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            /data/gannet/ripley/R/test-clang/rstan/include/boost_not_in_BH/boost/math/policies/error_handling.hpp 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "#include</data/gannet/ripley/R/test-clang/rstan/include/boost_not_in_BH/boost/math/policies/error_handling.hpp>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      /data/gannet/ripley/R/test-clang/rstan/include/boost_not_in_BH/boost/phoenix/core/actor.hpp 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "#include</data/gannet/ripley/R/test-clang/rstan/include/boost_not_in_BH/boost/phoenix/core/actor.hpp>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "#include <stan/math.hpp>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "#include <src/stan/lang/rethrow_located.hpp>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "#include <src/stan/model/indexing.hpp>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "#include <boost/exception/all.hpp>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "#include <boost/random/linear_congruential.hpp>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "#include <cmath>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "#include <cstddef>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "#include <fstream>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "#include <iostream>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "#include <sstream>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "#include <stdexcept>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "#include <utility>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "#include <vector>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "#include <boost/date_time/posix_time/posix_time_types.hpp>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "#include <boost/math/special_functions/fpclassify.hpp>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "#include <boost/random/additive_combine.hpp>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "#include <boost/random/uniform_real_distribution.hpp>" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "// Code generated by Stan version 2.18.0" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "stan::io::program_reader prog_reader__() {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "    stan::io::program_reader reader;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "    reader.add_event(0, 0, \"start\", \"model5eae2d5306b1_Stan_Functions\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "    reader.add_event(1103, 1101, \"end\", \"model5eae2d5306b1_Stan_Functions\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "    return reader;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "}" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "// [[Rcpp::export]]" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "vector_d" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "make_theta_L(const int& len_theta_L," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "                 const std::vector<int>& p," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "                 const double& dispersion," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                 const vector_d& tau," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "                 const vector_d& scale," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "                 const vector_d& zeta," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                 const vector_d& rho," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "                 const vector_d& z_T) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "using std::istream;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "using std::string;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "using std::stringstream;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "using std::vector;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "using stan::math::lgamma;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "using namespace stan::math;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "std::ostream* pstream__ = &Rcpp::Rcout;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "(void) pstream__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "    typedef double local_scalar_t__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "    typedef local_scalar_t__ fun_return_scalar_t__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "    const static bool propto__ = false;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "    (void) propto__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "        local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        (void) DUMMY_VAR__;  // suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "    try {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "        {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "        validate_non_negative_index(\"theta_L\", \"len_theta_L\", len_theta_L);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "        vector_d  theta_L(static_cast<Eigen::VectorXd::Index>(len_theta_L));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "        (void) theta_L;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "        stan::math::initialize(theta_L, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "        stan::math::fill(theta_L,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "        int zeta_mark(0);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "        (void) zeta_mark;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "        stan::math::fill(zeta_mark, std::numeric_limits<int>::min());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "        stan::math::assign(zeta_mark,1);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "        int rho_mark(0);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "        (void) rho_mark;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "        stan::math::fill(rho_mark, std::numeric_limits<int>::min());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "        stan::math::assign(rho_mark,1);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "        int z_T_mark(0);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "        (void) z_T_mark;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "        stan::math::fill(z_T_mark, std::numeric_limits<int>::min());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "        stan::math::assign(z_T_mark,1);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "        int theta_L_mark(0);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "        (void) theta_L_mark;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "        stan::math::fill(theta_L_mark, std::numeric_limits<int>::min());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        stan::math::assign(theta_L_mark,1);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "        for (int i = 1; i <= size(p); ++i) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "            {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "            int nc(0);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "            (void) nc;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "            stan::math::fill(nc, std::numeric_limits<int>::min());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "            stan::math::assign(nc,get_base1(p,i,\"p\",1));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "            if (as_bool(logical_eq(nc,1))) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "                stan::model::assign(theta_L, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                            stan::model::cons_list(stan::model::index_uni(theta_L_mark), stan::model::nil_index_list()), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "                            ((get_base1(tau,i,\"tau\",1) * get_base1(scale,i,\"scale\",1)) * dispersion), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                            \"assigning variable theta_L\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "                stan::math::assign(theta_L_mark, stan::model::deep_copy((theta_L_mark + 1)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "            } else {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                validate_non_negative_index(\"T_i\", \"nc\", nc);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                validate_non_negative_index(\"T_i\", \"nc\", nc);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                matrix_d  T_i(static_cast<Eigen::VectorXd::Index>(nc),static_cast<Eigen::VectorXd::Index>(nc));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "                (void) T_i;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                stan::math::initialize(T_i, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "                stan::math::fill(T_i,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                local_scalar_t__ std_dev;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "                (void) std_dev;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "                stan::math::initialize(std_dev, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "                stan::math::fill(std_dev,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                local_scalar_t__ T21;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "                (void) T21;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                stan::math::initialize(T21, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "                stan::math::fill(T21,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "                local_scalar_t__ trace_T_i;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "                (void) trace_T_i;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                stan::math::initialize(trace_T_i, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "                stan::math::fill(trace_T_i,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "                stan::math::assign(trace_T_i,(square(((get_base1(tau,i,\"tau\",1) * get_base1(scale,i,\"scale\",1)) * dispersion)) * nc));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "                validate_non_negative_index(\"pi\", \"nc\", nc);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "                vector_d  pi(static_cast<Eigen::VectorXd::Index>(nc));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "                (void) pi;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "                stan::math::initialize(pi, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                stan::math::fill(pi,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "                stan::math::assign(pi,segment(zeta,zeta_mark,nc));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "                stan::math::assign(pi, stan::model::deep_copy(divide(pi,sum(pi))));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "                stan::math::assign(zeta_mark, stan::model::deep_copy((zeta_mark + nc)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "                stan::math::assign(std_dev, stan::math::sqrt((get_base1(pi,1,\"pi\",1) * trace_T_i)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                stan::model::assign(T_i, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                            stan::model::cons_list(stan::model::index_uni(1), stan::model::cons_list(stan::model::index_uni(1), stan::model::nil_index_list())), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                            std_dev, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "                            \"assigning variable T_i\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "                stan::math::assign(std_dev, stan::math::sqrt((get_base1(pi,2,\"pi\",1) * trace_T_i)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "                stan::math::assign(T21, ((2.0 * get_base1(rho,rho_mark,\"rho\",1)) - 1.0));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                stan::math::assign(rho_mark, stan::model::deep_copy((rho_mark + 1)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                stan::model::assign(T_i, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                            stan::model::cons_list(stan::model::index_uni(2), stan::model::cons_list(stan::model::index_uni(2), stan::model::nil_index_list())), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                            (std_dev * stan::math::sqrt((1.0 - square(T21)))), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "                            \"assigning variable T_i\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                stan::model::assign(T_i, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                            stan::model::cons_list(stan::model::index_uni(2), stan::model::cons_list(stan::model::index_uni(1), stan::model::nil_index_list())), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "                            (std_dev * T21), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "                            \"assigning variable T_i\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                for (int r = 2; r <= (nc - 1); ++r) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                    {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                    int rp1(0);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "                    (void) rp1;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "                    stan::math::fill(rp1, std::numeric_limits<int>::min());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "                    stan::math::assign(rp1,(r + 1));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                    validate_non_negative_index(\"T_row\", \"r\", r);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                    vector_d  T_row(static_cast<Eigen::VectorXd::Index>(r));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "                    (void) T_row;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                    stan::math::initialize(T_row, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "                    stan::math::fill(T_row,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "                    stan::math::assign(T_row,segment(z_T,z_T_mark,r));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "                    local_scalar_t__ scale_factor;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                    (void) scale_factor;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "                    stan::math::initialize(scale_factor, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                    stan::math::fill(scale_factor,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                    stan::math::assign(scale_factor,(stan::math::sqrt((get_base1(rho,rho_mark,\"rho\",1) / dot_self(T_row))) * std_dev));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                    stan::math::assign(z_T_mark, stan::model::deep_copy((z_T_mark + r)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                    stan::math::assign(std_dev, stan::math::sqrt((get_base1(pi,rp1,\"pi\",1) * trace_T_i)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "                    for (int c = 1; c <= r; ++c) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                        stan::model::assign(T_i, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "                                    stan::model::cons_list(stan::model::index_uni(rp1), stan::model::cons_list(stan::model::index_uni(c), stan::model::nil_index_list())), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                                    (get_base1(T_row,c,\"T_row\",1) * scale_factor), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "                                    \"assigning variable T_i\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "                    stan::model::assign(T_i, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                                stan::model::cons_list(stan::model::index_uni(rp1), stan::model::cons_list(stan::model::index_uni(rp1), stan::model::nil_index_list())), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                                (stan::math::sqrt((1.0 - get_base1(rho,rho_mark,\"rho\",1))) * std_dev), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                                \"assigning variable T_i\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                    stan::math::assign(rho_mark, stan::model::deep_copy((rho_mark + 1)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                for (int c = 1; c <= nc; ++c) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "                    for (int r = c; r <= nc; ++r) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                        stan::model::assign(theta_L, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                                    stan::model::cons_list(stan::model::index_uni(theta_L_mark), stan::model::nil_index_list()), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "                                    get_base1(T_i,r,c,\"T_i\",1), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "                                    \"assigning variable theta_L\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                        stan::math::assign(theta_L_mark, stan::model::deep_copy((theta_L_mark + 1)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "            }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "            }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "        }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "        return stan::math::promote_scalar<fun_return_scalar_t__>(theta_L);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "        }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "    } catch (const std::exception& e) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "        // Next line prevents compiler griping about no return" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        throw std::runtime_error(e.what());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "}" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "struct make_theta_L_functor__ {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "        vector_d" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "    operator()(const int& len_theta_L," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "                 const std::vector<int>& p," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "                 const double& dispersion," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                 const vector_d& tau," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "                 const vector_d& scale," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "                 const vector_d& zeta," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                 const vector_d& rho," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                 const vector_d& z_T, std::ostream* pstream__ = &Rcpp::Rcout) const {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "        return make_theta_L(len_theta_L, p, dispersion, tau, scale, zeta, rho, z_T);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "};" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "// [[Rcpp::export]]" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "vector_d" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "make_b(const vector_d& z_b," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "           const vector_d& theta_L," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "           const std::vector<int>& p," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "           const std::vector<int>& l) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "using std::istream;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "using std::string;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "using std::stringstream;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "using std::vector;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "using stan::math::lgamma;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "using namespace stan::math;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "std::ostream* pstream__ = &Rcpp::Rcout;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "(void) pstream__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "    typedef double local_scalar_t__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "    typedef local_scalar_t__ fun_return_scalar_t__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "    const static bool propto__ = false;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "    (void) propto__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "        local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        (void) DUMMY_VAR__;  // suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "    try {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "        {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "        validate_non_negative_index(\"b\", \"rows(z_b)\", rows(z_b));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "        vector_d  b(static_cast<Eigen::VectorXd::Index>(rows(z_b)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "        (void) b;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "        stan::math::initialize(b, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "        stan::math::fill(b,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "        int b_mark(0);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "        (void) b_mark;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "        stan::math::fill(b_mark, std::numeric_limits<int>::min());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "        stan::math::assign(b_mark,1);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "        int theta_L_mark(0);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "        (void) theta_L_mark;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "        stan::math::fill(theta_L_mark, std::numeric_limits<int>::min());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        stan::math::assign(theta_L_mark,1);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "        for (int i = 1; i <= size(p); ++i) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "            {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "            int nc(0);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "            (void) nc;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "            stan::math::fill(nc, std::numeric_limits<int>::min());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "            stan::math::assign(nc,get_base1(p,i,\"p\",1));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "            if (as_bool(logical_eq(nc,1))) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                local_scalar_t__ theta_L_start;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "                (void) theta_L_start;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "                stan::math::initialize(theta_L_start, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                stan::math::fill(theta_L_start,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "                stan::math::assign(theta_L_start,get_base1(theta_L,theta_L_mark,\"theta_L\",1));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                for (int s = b_mark; s <= ((b_mark + get_base1(l,i,\"l\",1)) - 1); ++s) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "                    stan::model::assign(b, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "                                stan::model::cons_list(stan::model::index_uni(s), stan::model::nil_index_list()), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "                                (theta_L_start * get_base1(z_b,s,\"z_b\",1)), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "                                \"assigning variable b\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "                stan::math::assign(b_mark, stan::model::deep_copy((b_mark + get_base1(l,i,\"l\",1))));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "                stan::math::assign(theta_L_mark, stan::model::deep_copy((theta_L_mark + 1)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "            } else {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                validate_non_negative_index(\"T_i\", \"nc\", nc);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                validate_non_negative_index(\"T_i\", \"nc\", nc);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                matrix_d  T_i(static_cast<Eigen::VectorXd::Index>(nc),static_cast<Eigen::VectorXd::Index>(nc));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "                (void) T_i;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                stan::math::initialize(T_i, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "                stan::math::fill(T_i,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                stan::math::assign(T_i,rep_matrix(0,nc,nc));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                for (int c = 1; c <= nc; ++c) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "                    stan::model::assign(T_i, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                                stan::model::cons_list(stan::model::index_uni(c), stan::model::cons_list(stan::model::index_uni(c), stan::model::nil_index_list())), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                                get_base1(theta_L,theta_L_mark,\"theta_L\",1), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                                \"assigning variable T_i\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                    stan::math::assign(theta_L_mark, stan::model::deep_copy((theta_L_mark + 1)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                    for (int r = (c + 1); r <= nc; ++r) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                        stan::model::assign(T_i, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                                    stan::model::cons_list(stan::model::index_uni(r), stan::model::cons_list(stan::model::index_uni(c), stan::model::nil_index_list())), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "                                    get_base1(theta_L,theta_L_mark,\"theta_L\",1), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "                                    \"assigning variable T_i\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                        stan::math::assign(theta_L_mark, stan::model::deep_copy((theta_L_mark + 1)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "                for (int j = 1; j <= get_base1(l,i,\"l\",1); ++j) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                    {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "                    validate_non_negative_index(\"temp\", \"nc\", nc);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                    vector_d  temp(static_cast<Eigen::VectorXd::Index>(nc));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                    (void) temp;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "                    stan::math::initialize(temp, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "                    stan::math::fill(temp,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "                    stan::math::assign(temp,multiply(T_i,segment(z_b,b_mark,nc)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                    stan::math::assign(b_mark, stan::model::deep_copy((b_mark - 1)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "                    for (int s = 1; s <= nc; ++s) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                        stan::model::assign(b, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                                    stan::model::cons_list(stan::model::index_uni((b_mark + s)), stan::model::nil_index_list()), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "                                    get_base1(temp,s,\"temp\",1), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "                                    \"assigning variable b\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                    stan::math::assign(b_mark, stan::model::deep_copy(((b_mark + nc) + 1)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "            }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "            }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "        }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "        return stan::math::promote_scalar<fun_return_scalar_t__>(b);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "        }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "    } catch (const std::exception& e) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "        // Next line prevents compiler griping about no return" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        throw std::runtime_error(e.what());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "}" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "struct make_b_functor__ {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "        vector_d" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "    operator()(const vector_d& z_b," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "           const vector_d& theta_L," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "           const std::vector<int>& p," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "           const std::vector<int>& l, std::ostream* pstream__ = &Rcpp::Rcout) const {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "        return make_b(z_b, theta_L, p, l);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "};" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "// [[Rcpp::export]]" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "void" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "decov_lp(const vector_d& z_b," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "             const vector_d& z_T," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "             const vector_d& rho," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "             const vector_d& zeta," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "             const vector_d& tau," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "             const std::vector<double>& regularization," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "             const std::vector<double>& delta," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "             const vector_d& shape," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "             const int& t," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "             const std::vector<int>& p, double lp__ = 0.0) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "using std::istream;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "using std::string;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "using std::stringstream;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "using std::vector;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "using stan::math::lgamma;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "using namespace stan::math;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "stan::math::accumulator<double> lp_accum__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "std::ostream* pstream__ = &Rcpp::Rcout;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "(void) pstream__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "    typedef double local_scalar_t__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "    typedef local_scalar_t__ fun_return_scalar_t__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "    const static bool propto__ = false;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "    (void) propto__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "        local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        (void) DUMMY_VAR__;  // suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "    try {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "        {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "        int pos_reg(0);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "        (void) pos_reg;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "        stan::math::fill(pos_reg, std::numeric_limits<int>::min());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "        stan::math::assign(pos_reg,1);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "        int pos_rho(0);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "        (void) pos_rho;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "        stan::math::fill(pos_rho, std::numeric_limits<int>::min());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "        stan::math::assign(pos_rho,1);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "        lp_accum__.add(normal_log(z_b,0,1));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "        lp_accum__.add(normal_log(z_T,0,1));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "        for (int i = 1; i <= t; ++i) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "            if (as_bool(logical_gt(get_base1(p,i,\"p\",1),1))) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                validate_non_negative_index(\"shape1\", \"(get_base1(p,i,\\\"p\\\",1) - 1)\", (get_base1(p,i,\"p\",1) - 1));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "                vector_d  shape1(static_cast<Eigen::VectorXd::Index>((get_base1(p,i,\"p\",1) - 1)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "                (void) shape1;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                stan::math::initialize(shape1, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                stan::math::fill(shape1,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                validate_non_negative_index(\"shape2\", \"(get_base1(p,i,\\\"p\\\",1) - 1)\", (get_base1(p,i,\"p\",1) - 1));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "                vector_d  shape2(static_cast<Eigen::VectorXd::Index>((get_base1(p,i,\"p\",1) - 1)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "                (void) shape2;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                stan::math::initialize(shape2, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "                stan::math::fill(shape2,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "                local_scalar_t__ nu;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "                (void) nu;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "                stan::math::initialize(nu, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                stan::math::fill(nu,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "                stan::math::assign(nu,(get_base1(regularization,pos_reg,\"regularization\",1) + (0.5 * (get_base1(p,i,\"p\",1) - 2))));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "                stan::math::assign(pos_reg, stan::model::deep_copy((pos_reg + 1)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                stan::model::assign(shape1, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "                            stan::model::cons_list(stan::model::index_uni(1), stan::model::nil_index_list()), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "                            nu, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "                            \"assigning variable shape1\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "                stan::model::assign(shape2, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "                            stan::model::cons_list(stan::model::index_uni(1), stan::model::nil_index_list()), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "                            nu, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "                            \"assigning variable shape2\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "                for (int j = 2; j <= (get_base1(p,i,\"p\",1) - 1); ++j) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                    stan::math::assign(nu, stan::model::deep_copy((nu - 0.5)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "                    stan::model::assign(shape1, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "                                stan::model::cons_list(stan::model::index_uni(j), stan::model::nil_index_list()), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "                                (0.5 * j), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                                \"assigning variable shape1\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "                    stan::model::assign(shape2, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "                                stan::model::cons_list(stan::model::index_uni(j), stan::model::nil_index_list()), " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "                                nu, " 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "                                \"assigning variable shape2\");" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "                lp_accum__.add(beta_log(stan::model::rvalue(rho, stan::model::cons_list(stan::model::index_min_max(pos_rho, ((pos_rho + get_base1(p,i,\"p\",1)) - 2)), stan::model::nil_index_list()), \"rho\"),shape1,shape2));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "                stan::math::assign(pos_rho, stan::model::deep_copy(((pos_rho + get_base1(p,i,\"p\",1)) - 1)));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "                }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "            }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "        }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "        lp_accum__.add(gamma_log(zeta,delta,1));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "        lp_accum__.add(gamma_log(tau,shape,1));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "        }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "    } catch (const std::exception& e) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "        // Next line prevents compiler griping about no return" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        throw std::runtime_error(e.what());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "}" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "struct decov_lp_functor__ {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "        void" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "    operator()(const vector_d& z_b," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "             const vector_d& z_T," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "             const vector_d& rho," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "             const vector_d& zeta," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "             const vector_d& tau," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "             const std::vector<double>& regularization," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "             const std::vector<double>& delta," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "             const vector_d& shape," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "             const int& t," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "             const std::vector<int>& p, double lp__ = 0.0, std::ostream* pstream__ = &Rcpp::Rcout) const {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "        return decov_lp(z_b, z_T, rho, zeta, tau, regularization, delta, shape, t, p, lp__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "};" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "// [[Rcpp::export]]" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "vector_d" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "hs_prior(const vector_d& z_beta," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "             const std::vector<double>& global," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "             const std::vector<vector_d>& local," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "             const double& global_prior_scale," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "             const double& error_scale," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "             const double& c2) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "using std::istream;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "using std::string;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "using std::stringstream;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "using std::vector;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "using stan::math::lgamma;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "using namespace stan::math;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "std::ostream* pstream__ = &Rcpp::Rcout;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "(void) pstream__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "    typedef double local_scalar_t__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "    typedef local_scalar_t__ fun_return_scalar_t__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "    const static bool propto__ = false;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "    (void) propto__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "        local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        (void) DUMMY_VAR__;  // suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "    try {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "        {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "        int K(0);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "        (void) K;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "        stan::math::fill(K, std::numeric_limits<int>::min());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        stan::math::assign(K,rows(z_beta));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "        validate_non_negative_index(\"lambda\", \"K\", K);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "        vector_d  lambda(static_cast<Eigen::VectorXd::Index>(K));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "        (void) lambda;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "        stan::math::initialize(lambda, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "        stan::math::fill(lambda,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "        stan::math::assign(lambda,elt_multiply(get_base1(local,1,\"local\",1),stan::math::sqrt(get_base1(local,2,\"local\",1))));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "        local_scalar_t__ tau;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "        (void) tau;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "        stan::math::initialize(tau, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "        stan::math::fill(tau,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "        stan::math::assign(tau,(((get_base1(global,1,\"global\",1) * stan::math::sqrt(get_base1(global,2,\"global\",1))) * global_prior_scale) * error_scale));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        validate_non_negative_index(\"lambda2\", \"K\", K);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "        vector_d  lambda2(static_cast<Eigen::VectorXd::Index>(K));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "        (void) lambda2;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "        stan::math::initialize(lambda2, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "        stan::math::fill(lambda2,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "        stan::math::assign(lambda2,square(lambda));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "        validate_non_negative_index(\"lambda_tilde\", \"K\", K);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "        vector_d  lambda_tilde(static_cast<Eigen::VectorXd::Index>(K));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "        (void) lambda_tilde;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "        stan::math::initialize(lambda_tilde, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "        stan::math::fill(lambda_tilde,DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "        stan::math::assign(lambda_tilde,stan::math::sqrt(elt_divide(multiply(c2,lambda2),add(c2,multiply(square(tau),lambda2)))));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "        return stan::math::promote_scalar<fun_return_scalar_t__>(multiply(elt_multiply(z_beta,lambda_tilde),tau));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "        }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "    } catch (const std::exception& e) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "        // Next line prevents compiler griping about no return" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        throw std::runtime_error(e.what());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "}" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "struct hs_prior_functor__ {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "        vector_d" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         "    operator()(const vector_d& z_beta," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "             const std::vector<double>& global," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               "             const std::vector<vector_d>& local," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "             const double& global_prior_scale," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "             const double& error_scale," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 "             const double& c2, std::ostream* pstream__ = &Rcpp::Rcout) const {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "        return hs_prior(z_beta, global, local, global_prior_scale, error_scale, c2);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          "    }" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "};" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "// [[Rcpp::export]]" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "vector_d" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "hsplus_prior(const vector_d& z_beta," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "                 const std::vector<double>& global," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "                 const std::vector<vector_d>& local," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "                 const double& global_prior_scale," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "                 const double& error_scale," 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "                 const double& c2) {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "using std::istream;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "using std::string;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "using std::stringstream;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             "using std::vector;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "using stan::math::lgamma;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "using namespace stan::math;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "std::ostream* pstream__ = &Rcpp::Rcout;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "(void) pstream__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "    typedef double local_scalar_t__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "    typedef local_scalar_t__ fun_return_scalar_t__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "    const static bool propto__ = false;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "    (void) propto__;" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "        local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        (void) DUMMY_VAR__;  // suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "    try {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      "        {" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "        int K(0);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "        (void) K;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "        stan::math::fill(K, std::numeric_limits<int>::min());" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    "        stan::math::assign(K,rows(z_beta));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     "        validate_non_negative_index(\"lambda\", \"K\", K);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              "        vector_d  lambda(static_cast<Eigen::VectorXd::Index>(K));" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                "        (void) lambda;  // dummy to suppress unused var warning" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           "        stan::math::initialize(lambda, DUMMY_VAR__);" 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "        stan::math::fill(lambda,DUMMY_VAR__);"