CRAN Package Check Results for Package brms

Last updated on 2018-05-21 10:49:47 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 2.3.0 32.13 508.07 540.20 WARN
r-devel-linux-x86_64-debian-gcc 2.3.0 29.98 414.46 444.44 WARN
r-devel-linux-x86_64-fedora-clang 2.3.0 386.81 NOTE
r-devel-linux-x86_64-fedora-gcc 2.3.0 378.62 NOTE
r-devel-windows-ix86+x86_64 2.3.0 59.00 526.00 585.00 NOTE
r-patched-linux-x86_64 2.3.0 29.25 513.51 542.76 OK
r-patched-solaris-x86 2.3.0 767.50 NOTE
r-release-linux-x86_64 2.3.0 31.79 512.82 544.61 OK
r-release-windows-ix86+x86_64 2.3.0 45.00 516.00 561.00 NOTE
r-release-osx-x86_64 2.3.0 NOTE
r-oldrel-windows-ix86+x86_64 2.3.0 31.00 417.00 448.00 ERROR
r-oldrel-osx-x86_64 2.2.0 NOTE

Check Details

Version: 2.3.0
Check: for unstated dependencies in ‘tests’
Result: WARN
    '::' or ':::' import not declared from: ‘statmod’
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc

Version: 2.3.0
Check: installed package size
Result: NOTE
     installed size is 6.6Mb
     sub-directories of 1Mb or more:
     R 3.5Mb
     doc 2.4Mb
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-patched-solaris-x86, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64

Version: 2.3.0
Check: R code for possible problems
Result: NOTE
    combine_family_info: no visible binding for global variable 'isFALSE'
    no_sigma: no visible global function definition for 'isFALSE'
    resp_cens : prepare_cens: no visible global function definition for
     'isFALSE'
    Undefined global functions or variables:
     isFALSE
Flavor: r-oldrel-windows-ix86+x86_64

Version: 2.3.0
Check: tests
Result: ERROR
     Running 'testthat.R' [174s]
    Running the tests in 'tests/testthat.R' failed.
    Complete output:
     > library(testthat)
     > library(brms)
     Loading required package: Rcpp
     Loading required package: ggplot2
     Loading 'brms' package (version 2.3.0). Useful instructions
     can be found by typing help('brms'). A more detailed introduction
     to the package is available through vignette('brms_overview').
     Run theme_set(theme_default()) to use the default bayesplot theme.
     >
     > test_check("brms")
     -- 1. Failure: brm produces expected errors (@tests.brm.R#17) -----------------
     `brm(bf(y | se(sei) ~ x, sigma ~ x), dat)` threw an error with unexpected message.
     Expected match: "Cannot predict or fix 'sigma' in this model"
     Actual message: "could not find function \"isFALSE\""
    
     -- 2. Error: all S3 methods have reasonable ouputs (@tests.brmsfit-methods.R#235
     object 'isFALSE' not found
     1: SW(loo(fit5, cores = 1)) at testthat/tests.brmsfit-methods.R:235
     2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
     3: loo(fit5, cores = 1)
     4: loo.brmsfit(fit5, cores = 1)
     5: do.call(compute_ics, args)
     6: (function (models, ic = c("loo", "waic", "psis", "psislw", "kfold"), use_stored_ic = FALSE,
     compare = TRUE, ...)
     {
     ic <- match.arg(ic)
     args <- nlist(ic, ...)
     if (length(models) > 1L) {
     if (length(use_stored_ic) == 1L) {
     use_stored_ic <- rep(use_stored_ic, length(models))
     }
     out <- named_list(names(models))
     for (i in seq_along(models)) {
     ic_obj <- models[[i]][[ic]]
     if (use_stored_ic[i] && is.ic(ic_obj)) {
     out[[i]] <- ic_obj
     out[[i]]$model_name <- names(models)[i]
     }
     else {
     args$x <- models[[i]]
     args$model_name <- names(models)[i]
     out[[i]] <- do.call(compute_ic, args)
     }
     }
     compare <- as_one_logical(compare)
     if (compare) {
     out <- compare_ic(x = out)
     }
     class(out) <- "iclist"
     }
     else {
     ic_obj <- models[[1]][[ic]]
     use_stored_ic <- as_one_logical(use_stored_ic)
     if (use_stored_ic && is.ic(ic_obj)) {
     out <- ic_obj
     out$model_name <- names(models)
     }
     else {
     args$x <- models[[1]]
     args$model_name <- names(models)
     out <- do.call(compute_ic, args)
     }
     }
     out
     })(cores = 1, models = structure(list(fit5 = structure(list(formula = structure(list(
     formula = count ~ Age + (1 | gr(patient, by = gender)), pforms = structure(list(
     mu2 = mu2 ~ Age), .Names = "mu2"), pfix = list(), resp = "count", family = structure(list(
     family = "mixture", link = "identity", mix = list(structure(list(family = "gaussian",
     link = "identity", linkfun = function (mu)
     link(mu, link = slink), linkinv = function (eta)
     ilink(eta, link = slink), dpars = c("mu", "sigma"), type = "real", ybounds = c(-Inf,
     Inf), closed = c(NA, NA), ad = c("weights", "se", "cens", "trunc", "mi"
     ), specials = "autocor"), .Names = c("family", "link", "linkfun", "linkinv",
     "dpars", "type", "ybounds", "closed", "ad", "specials"), class = c("brmsfamily",
     "family")), structure(list(family = "exponential", link = "log", linkfun = function (mu)
     link(mu, link = slink), linkinv = function (eta)
     ilink(eta, link = slink), dpars = "mu", type = "real", ybounds = c(0, Inf
     ), closed = c(FALSE, NA), ad = c("weights", "cens", "trunc", "mi"), specials = "transeta"), .Names = c("family",
     "link", "linkfun", "linkinv", "dpars", "type", "ybounds", "closed", "ad",
     "specials"), class = c("brmsfamily", "family"))), order = "none"), .Names = c("family",
     "link", "mix", "order"), class = c("mixfamily", "brmsfamily", "family")), autocor = structure(list(), class = c("cor_empty",
     "cor_brms")), mecor = TRUE), .Names = c("formula", "pforms", "pfix", "resp",
     "family", "autocor", "mecor"), class = c("brmsformula", "bform")), family = structure(list(
     family = "mixture", link = "identity", mix = list(structure(list(family = "gaussian",
     link = "identity", linkfun = function (mu)
     link(mu, link = slink), linkinv = function (eta)
     ilink(eta, link = slink), dpars = c("mu", "sigma"), type = "real", ybounds = c(-Inf,
     Inf), closed = c(NA, NA), ad = c("weights", "se", "cens", "trunc", "mi"),
     specials = "autocor"), .Names = c("family", "link", "linkfun", "linkinv",
     "dpars", "type", "ybounds", "closed", "ad", "specials"), class = c("brmsfamily",
     "family")), structure(list(family = "exponential", link = "log", linkfun = function (mu)
     link(mu, link = slink), linkinv = function (eta)
     ilink(eta, link = slink), dpars = "mu", type = "real", ybounds = c(0, Inf), closed = c(FALSE,
     NA), ad = c("weights", "cens", "trunc", "mi"), specials = "transeta"), .Names = c("family",
     "link", "linkfun", "linkinv", "dpars", "type", "ybounds", "closed", "ad", "specials"
     ), class = c("brmsfamily", "family"))), order = "none"), .Names = c("family",
     "link", "mix", "order"), class = c("mixfamily", "brmsfamily", "family")), data = structure(list(
     count = c(14L, 21L, 21L, 16L, 22L, 17L, 24L, 17L, 17L, 12L, 20L, 24L, 19L, 17L,
     23L, 17L, 20L, 17L, 20L, 19L, 23L, 17L, 15L, 23L, 24L, 35L, 27L, 13L, 26L, 15L,
     25L, 17L, 15L, 14L, 17L, 22L, 20L, 16L, 15L, 28L, 22L, 31L, 19L, 17L, 17L, 14L,
     19L, 21L, 25L, 29L, 19L, 21L, 20L, 20L, 16L, 16L, 33L, 20L, 20L, 16L, 19L, 23L,
     23L, 22L, 18L, 19L, 14L, 18L, 31L, 17L, 30L, 25L, 24L, 22L, 21L, 20L, 23L, 22L,
     18L, 29L, 17L, 20L, 21L, 19L, 19L, 17L, 19L, 18L, 19L, 20L, 23L, 16L, 19L, 19L,
     16L, 19L, 20L, 23L, 21L, 17L, 17L, 20L, 33L, 18L, 11L, 20L, 18L, 19L, 23L, 17L,
     22L, 21L, 27L, 21L, 22L, 21L, 18L, 20L, 27L, 16L, 23L, 22L, 18L, 16L, 18L, 16L,
     15L, 19L, 21L, 22L, 27L, 19L, 18L, 26L, 27L, 20L, 18L, 11L, 12L, 14L, 27L, 22L,
     23L, 20L, 18L, 28L, 16L, 28L, 25L, 17L, 14L, 30L, 21L, 26L, 20L, 18L, 19L, 23L,
     16L, 21L, 23L, 28L, 24L, 20L, 15L, 25L, 14L, 12L, 17L, 19L, 17L, 26L, 21L, 25L,
     20L, 20L, 21L, 11L, 33L, 23L, 16L, 12L, 18L, 15L, 18L, 20L, 17L, 18L, 20L, 22L,
     20L, 21L, 15L, 22L, 15L, 26L, 21L, 21L, 21L, 21L, 24L, 22L, 22L, 14L, 27L, 21L,
     23L, 13L, 24L, 18L, 20L, 12L, 16L, 18L, 14L, 21L, 20L, 21L, 16L, 24L, 29L, 17L,
     15L, 19L, 21L, 15L, 24L, 24L, 21L, 13L, 16L, 18L, 19L, 24L, 29L, 14L), Age = c(0.45344675558955,
     0.515410849100596, -1.16395023282441, -0.937743376681319, 0.152347654725241,
     -0.281439223792983, -0.810624371131412, -0.266400655561554, 0.852246789038166,
     -1.41776055713248, -0.308979706199335, 0.425672808701975, -0.0398116914911732,
     -1.64594201898624, 0.936577082331917, 1.48721204653766, 1.60767667745622, 0.250893744637267,
     0.272454067431696, 0.151120397835553, 0.972148262845829, 1.00919767461536, -0.414270986076424,
     -0.885750295902445, 1.45433503960248, -0.368401509778208, 1.19897700932785, 0.85857279129482,
     0.486899829486885, -0.12527496668046, 0.0218001786366695, -1.83427457779305,
     1.53076518296909, 1.64020757062729, -1.65152757583031, 0.0301909317630092, -0.569073609790872,
     0.610966061213216, 1.50856768900047, -0.67724858172127, 1.00127286222824, 1.23559803737651,
     1.64678333547692, -1.22505623464341, -0.543198952827159, -0.44553541605053, -1.9167749987803,
     -0.0528137742633058, -0.0330211947986275, 0.0229248785448746, -1.35010686320641,
     0.113811588677316, 0.642987378208233, 0.249825197296058, -0.0853459836885707,
     -1.19303796064907, 0.356282686810803, 0.172087576644518, 1.97372864188582, -1.19054711512027,
     -0.889302769453446, -0.827772216986977, -1.28492962354055, -1.27572577571741,
     -2.5515137258786, 2.18791774683888, -0.402669219876226, 2.21595633668288, -2.25042387258164,
     0.103253708285337, 0.819019530197075, 0.867531285479854, 1.45796570320058, -1.28845863666195,
     -0.887796180641521, -3.13369995808798, 0.399934717710489, 0.424783268348672,
     0.656107670120149, 0.976750081918345, 1.20595407698, 1.38233486764073, 0.292553993771553,
     0.378996689455366, 0.195106148373049, 0.28069898192494, 0.184565208265105, -0.522969262859226,
     1.05836414940362, -1.46032492037081, 0.0269141400185939, -0.758262165486903,
     -0.352524669710462, -1.58457956897182, -0.553440569784362, 0.491812863604194,
     -1.88318389628993, -0.967118505538357, -1.0543856090554, 0.050837227090923, -0.629417112744721,
     0.924316787947288, 1.10143585050171, 1.13320919652301, -0.565994326413448, 0.175488291195354,
     -0.152562951735197, -0.201027284098198, -0.857357542563745, 0.449804227360598,
     -0.313668046187967, 0.86055240847413, -0.147304115800428, -0.322504326013132,
     -0.278551253551235, 0.804984394971709, -0.256557862947846, -0.106027782045305,
     0.853242333363048, 1.59438968914969, 0.45498283638342, -0.835716642310009, 0.314721239337338,
     0.214291606322232, -0.883144613924108, 1.38836823895975, 1.57378393709947, 0.57326436069633,
     1.99057681524775, -0.928682845284003, 0.371482908625141, -1.77187408647868, 1.72030111258072,
     -0.247534044217241, -0.216269720531311, 1.39224353083729, 2.09536749444053, 0.0791333846972169,
     1.31007058639189, -0.521463931761034, -0.880147136903953, -1.36589200183303,
     0.195888104256897, -0.669565834143609, 0.103535552782471, 1.47893408156977, -1.7594676418151,
     -2.15688641404017, 0.663347217297412, -0.311537309737727, -0.446717394693444,
     0.339719529339608, 1.12367688242356, -0.22876884555024, -0.122069607807934, -1.9372877356011,
     -0.655485827986667, -0.53578198090703, -0.0719121864618582, -0.750105730003408,
     -1.40521469639207, 2.10663910374229, 0.83306337133343, -0.111081896784211, -0.736744243092158,
     -0.648786930890289, 0.129568451880837, -1.03426394719344, 2.34821580897133, 0.270817612974725,
     0.0236286659597419, 0.0181035772221675, 0.224113043529505, 0.211004018490418,
     0.73074666263149, 0.0847811381994243, -1.15430061874769, -0.33886212929266, 1.66025649906944,
     0.918131834194581, -1.68556173334183, -0.059842894849279, 0.401287288421787,
     -0.0999552590508416, 0.818026626579207, -1.49244224737004, -0.742561852454392,
     -0.439439068071281, 0.54985856574768, 0.737970984861386, 0.494431480847877, -0.711694061618348,
     0.214145690616044, 1.51097429224047, 0.422312786437685, -0.667172230386497, 2.18681454568855,
     -0.929979960786568, 0.348013688277128, -1.28420745848875, -3.00942634973815,
     -0.467755990126433, -0.858176212788862, -0.0314226306356567, -0.381643184740578,
     -0.280192664614407, -1.24077596080931, 2.26024123694442, 1.1148425960005, 0.479082155770462,
     -0.484605885570993, 0.361765297282803, 1.06252110783168, -0.198514299870965,
     2.03102867175013, -0.320044208478049, 0.50836374848498, -0.322321693332168, 0.780634775586391,
     1.48344504649836, -0.665854117878145, -0.0581632048625474, -0.508618952033426,
     -0.640026576824838, 0.546517355456073, 0.0329007023975169, -1.64687663176852,
     0.801161945422651, 1.18046753142577, -0.612964286863616, -0.972300313108074,
     1.79137772032282, 0.809192900381366, 0.105157638138101, -1.07024130237152, 0.854941633799389
     ), patient = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L,
     14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L,
     30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L,
     46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 1L, 2L,
     3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L,
     20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L,
     36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L,
     52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L,
     11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L,
     27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L,
     43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L,
     59L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L,
     18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L,
     34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L,
     50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L), .Label = c("1", "2", "3",
     "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17",
     "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30",
     "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43",
     "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56",
     "57", "58", "59"), class = "factor"), gender = structure(c(2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), class = "factor", .Label = c("f",
     "m"), contrasts = structure(c(0, 1), .Dim = c(2L, 1L), .Dimnames = list(c("f",
     "m"), "m")))), .Names = c("count", "Age", "patient", "gender"), row.names = c(NA,
     236L), terms = count ~ count + Age + patient + gender, class = "data.frame", brmsframe = TRUE),
     data.name = "dat", model = structure("// generated with brms 2.2.4\nfunctions { \n\n /* compute correlated group-level effects with 'by' variables\n * Args: \n * z: matrix of unscaled group-level effects\n * SD: matrix of standard deviation parameters\n * L: an array of cholesky factor correlation matrices\n * Jby: index which grouping level belongs to which by level\n * Returns: \n * matrix of scaled group-level effects\n */ \n matrix scale_r_cor_by(matrix z, matrix SD, matrix[] L, int[] Jby) {\n // r is stored in another dimension order than z\n matrix[cols(z), rows(z)] r;\n for (j in 1:rows(r)) {\n r[j] = (diag_pre_multiply(SD[, Jby[j]], L[Jby[j]]) * z[, j])';\n }\n return r;\n }\n} \ndata { \n int<lower=1> N; // total number of observations \n vector[N] Y; // response variable \n int<lower=1> K_mu1; // number of population-level effects \n matrix[N, K_mu1] X_mu1; // population-level design matrix \n int<lower=1> K_mu2; // number of population-level effects \n matrix[N, K_mu2] X_mu2; // population-level design matrix \n vector[2] con_theta; // prior concentration \n // data for group-level effects of ID 1\n int<lower=1> J_1[N];\n int<lower=1> N_1;\n int<lower=1> M_1;\n int<lower=1> Nby_1;\n int<lower=1> Jby_1[N_1];\n vector[N] Z_1_mu1_1;\n int prior_only; // should the likelihood be ignored? \n} \ntransformed data { \n int Kc_mu1 = K_mu1 - 1; \n matrix[N, K_mu1 - 1] Xc_mu1; // centered version of X_mu1 \n vector[K_mu1 - 1] means_X_mu1; // column means of X_mu1 before centering \n int Kc_mu2 = K_mu2 - 1; \n matrix[N, K_mu2 - 1] Xc_mu2; // centered version of X_mu2 \n vector[K_mu2 - 1] means_X_mu2; // column means of X_mu2 before centering \n for (i in 2:K_mu1) { \n means_X_mu1[i - 1] = mean(X_mu1[, i]); \n Xc_mu1[, i - 1] = X_mu1[, i] - means_X_mu1[i - 1]; \n } \n for (i in 2:K_mu2) { \n means_X_mu2[i - 1] = mean(X_mu2[, i]); \n Xc_mu2[, i - 1] = X_mu2[, i] - means_X_mu2[i - 1]; \n } \n} \nparameters { \n vector[Kc_mu1] b_mu1; // population-level effects \n real temp_mu1_Intercept; // temporary intercept \n real<lower=0> sigma1; // residual SD \n vector[Kc_mu2] b_mu2; // population-level effects \n real temp_mu2_Intercept; // temporary intercept \n simplex[2] theta; // mixing proportions \n matrix<lower=0>[M_1, Nby_1] sd_1; // group-level standard deviations\n vector[N_1] z_1[M_1]; // unscaled group-level effects\n} \ntransformed parameters { \n // mixing proportions \n real<lower=0,upper=1> theta1 = theta[1]; \n real<lower=0,upper=1> theta2 = theta[2]; \n // group-level effects \n vector[N_1] r_1_mu1_1 = sd_1[1, Jby_1]' .* (z_1[1]);\n} \nmodel { \n vector[N] mu1 = Xc_mu1 * b_mu1 + temp_mu1_Intercept; \n vector[N] mu2 = Xc_mu2 * b_mu2 + temp_mu2_Intercept; \n for (n in 1:N) { \n mu1[n] += r_1_mu1_1[J_1[n]] * Z_1_mu1_1[n];\n mu2[n] = exp(-(mu2[n])); \n } \n // priors including all constants \n target += normal_lpdf(temp_mu1_Intercept | 0, 10); \n target += student_t_lpdf(sigma1 | 3, 0, 10); \n target += normal_lpdf(b_mu2 | 0, 1); \n target += normal_lpdf(temp_mu2_Intercept | 0, 1); \n target += dirichlet_lpdf(theta | con_theta); \n target += student_t_lpdf(to_vector(sd_1) | 3, 0, 10); \n target += normal_lpdf(z_1[1] | 0, 1);\n // likelihood including all constants \n if (!prior_only) { \n for (n in 1:N) { \n real ps[2]; \n ps[1] = log(theta1) + normal_lpdf(Y[n] | mu1[n], sigma1); \n ps[2] = log(theta2) + exponential_lpdf(Y[n] | mu2[n]); \n target += log_sum_exp(ps); \n } \n } \n} \ngenerated quantities { \n // actual population-level intercept \n real b_mu1_Intercept = temp_mu1_Intercept - dot_product(means_X_mu1, b_mu1); \n // actual population-level intercept \n real b_mu2_Intercept = temp_mu2_Intercept - dot_product(means_X_mu2, b_mu2); \n} ", model_name2 = "paste(program, collapse = \"\\n\")", class = c("character",
     "brmsmodel")), prior = structure(list(prior = c("", "", "normal(0, 1)", "", "normal(0, 10)",
     "normal(0, 1)", "student_t(3, 0, 10)", "", "", "student_t(3, 0, 10)", "", "logistic(0, 1)",
     "logistic(0, 1)"), class = c("b", "b", "b", "b", "Intercept", "Intercept", "sd",
     "sd", "sd", "sigma1", "theta", "theta1", "theta2"), coef = c("", "Age", "", "Age",
     "", "", "", "", "Intercept", "", "", "", ""), group = c("", "", "", "", "", "",
     "", "patient", "patient", "", "", "", ""), resp = c("", "", "", "", "", "", "",
     "", "", "", "", "", ""), dpar = c("mu1", "mu1", "mu2", "mu2", "mu1", "mu2", "mu1",
     "mu1", "mu1", "", "", "", ""), nlpar = c("", "", "", "", "", "", "", "", "",
     "", "", "", ""), bound = c("", "", "", "", "", "", "", "", "", "", "", "", ""
     )), .Names = c("prior", "class", "coef", "group", "resp", "dpar", "nlpar", "bound"
     ), special = structure(list(mu2 = list(), mu1 = list()), .Names = c("mu2", "mu1"
     )), row.names = c(NA, -13L), class = c("brmsprior", "data.frame"), sample_prior = "no", checked = TRUE),
     autocor = structure(list(), class = c("cor_empty", "cor_brms")), ranef = structure(list(
     id = 1, group = "patient", gn = 1L, gtype = "", coef = "Intercept", cn = 1L,
     resp = "", dpar = "mu1", nlpar = "", ggn = 1L, cor = TRUE, type = "", by = "gender",
     dist = "gaussian", bylevels = list(c("f", "m")), form = list(~1), gcall = list(
     structure(list(groups = "patient", allvars = ~patient + gender, label = "gr(patient, by = gender)",
     by = "gender", dist = "gaussian", type = ""), .Names = c("groups",
     "allvars", "label", "by", "dist", "type")))), .Names = c("id", "group",
     "gn", "gtype", "coef", "cn", "resp", "dpar", "nlpar", "ggn", "cor", "type", "by",
     "dist", "bylevels", "form", "gcall"), row.names = 1L, class = c("ranef_frame",
     "data.frame"), .Label = structure(list(patient = structure(c("1", "2", "3", "4",
     "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18",
     "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31",
     "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44",
     "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57",
     "58", "59"), by = c("m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m",
     "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m",
     "m", "m", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f",
     "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f"))), .Names = "patient")),
     cov_ranef = NULL, loo = NULL, waic = NULL, R2 = NULL, marglik = NULL, stanvars = NULL,
     stan_funs = NULL, fit = <S4 object of class structure("stanfit", package = "rstan")>,
     exclude = structure(c("res_cov_matrix", "mu2", "mu1", "temp_Intercept1", "ordered_Intercept",
     "theta", "zcar", "temp_mu2_Intercept", "hs_local_mu2", "hs_global_mu2", "zb_mu2",
     "temp_mu1_Intercept", "hs_local_mu1", "hs_global_mu1", "zb_mu1", "z_1", "L_1",
     "Cor_1", "r_1"), save_ranef = TRUE, save_mevars = FALSE, save_all_pars = FALSE),
     algorithm = "sampling", version = structure(list(brms = structure(list(c(2L,
     2L, 4L)), class = c("package_version", "numeric_version")), rstan = structure(list(
     c(2L, 17L, 3L)), class = c("package_version", "numeric_version"))), .Names = c("brms",
     "rstan"))), .Names = c("formula", "family", "data", "data.name", "model", "prior",
     "autocor", "ranef", "cov_ranef", "loo", "waic", "R2", "marglik", "stanvars", "stan_funs",
     "fit", "exclude", "algorithm", "version"), class = "brmsfit")), .Names = "fit5"),
     use_stored_ic = TRUE, ic = "loo", pointwise = FALSE, compare = TRUE, resp = NULL,
     k_threshold = 0.7, reloo = FALSE)
     7: do.call(compute_ic, args)
     8: (function (x, ic = c("loo", "waic", "psis", "kfold"), reloo = FALSE, k_threshold = 0.7,
     pointwise = FALSE, model_name = "", ...)
     {
     ic <- match.arg(ic)
     if (ic == "kfold") {
     out <- do.call(kfold_internal, list(x, ...))
     }
     else {
     contains_samples(x)
     pointwise <- as_one_logical(pointwise)
     loo_args <- list(...)
     loo_args$x <- log_lik(x, pointwise = pointwise, ...)
     if (pointwise) {
     loo_args$draws <- attr(loo_args$x, "draws")
     loo_args$data <- attr(loo_args$x, "data")
     }
     if (ic == "psis") {
     if (pointwise) {
     stop2("Cannot use pointwise evaluation for 'psis'.")
     }
     loo_args$log_ratios <- -loo_args$x
     loo_args$x <- NULL
     }
     out <- SW(do.call(eval2(paste0("loo::", ic)), loo_args))
     }
     out$model_name <- model_name
     class(out) <- c("ic", class(out))
     attr(out, "yhash") <- hash_response(x)
     if (ic == "loo") {
     if (reloo) {
     reloo_args <- nlist(x = out, fit = x, k_threshold, check = FALSE)
     out <- do.call(reloo.loo, c(reloo_args, ...))
     }
     else {
     n_bad_obs <- length(loo::pareto_k_ids(out, threshold = k_threshold))
     recommend_loo_options(n_bad_obs, k_threshold, model_name)
     }
     }
     out
     })(ic = "loo", cores = 1, pointwise = FALSE, resp = NULL, k_threshold = 0.7, reloo = FALSE,
     x = structure(list(formula = structure(list(formula = count ~ Age + (1 | gr(patient,
     by = gender)), pforms = structure(list(mu2 = mu2 ~ Age), .Names = "mu2"),
     pfix = list(), resp = "count", family = structure(list(family = "mixture",
     link = "identity", mix = list(structure(list(family = "gaussian", link = "identity",
     linkfun = function (mu)
     link(mu, link = slink), linkinv = function (eta)
     ilink(eta, link = slink), dpars = c("mu", "sigma"), type = "real",
     ybounds = c(-Inf, Inf), closed = c(NA, NA), ad = c("weights", "se",
     "cens", "trunc", "mi"), specials = "autocor"), .Names = c("family",
     "link", "linkfun", "linkinv", "dpars", "type", "ybounds", "closed", "ad",
     "specials"), class = c("brmsfamily", "family")), structure(list(family = "exponential",
     link = "log", linkfun = function (mu)
     link(mu, link = slink), linkinv = function (eta)
     ilink(eta, link = slink), dpars = "mu", type = "real", ybounds = c(0,
     Inf), closed = c(FALSE, NA), ad = c("weights", "cens", "trunc", "mi"
     ), specials = "transeta"), .Names = c("family", "link", "linkfun",
     "linkinv", "dpars", "type", "ybounds", "closed", "ad", "specials"), class = c("brmsfamily",
     "family"))), order = "none"), .Names = c("family", "link", "mix", "order"
     ), class = c("mixfamily", "brmsfamily", "family")), autocor = structure(list(), class = c("cor_empty",
     "cor_brms")), mecor = TRUE), .Names = c("formula", "pforms", "pfix", "resp",
     "family", "autocor", "mecor"), class = c("brmsformula", "bform")), family = structure(list(
     family = "mixture", link = "identity", mix = list(structure(list(family = "gaussian",
     link = "identity", linkfun = function (mu)
     link(mu, link = slink), linkinv = function (eta)
     ilink(eta, link = slink), dpars = c("mu", "sigma"), type = "real", ybounds = c(-Inf,
     Inf), closed = c(NA, NA), ad = c("weights", "se", "cens", "trunc", "mi"
     ), specials = "autocor"), .Names = c("family", "link", "linkfun", "linkinv",
     "dpars", "type", "ybounds", "closed", "ad", "specials"), class = c("brmsfamily",
     "family")), structure(list(family = "exponential", link = "log", linkfun = function (mu)
     link(mu, link = slink), linkinv = function (eta)
     ilink(eta, link = slink), dpars = "mu", type = "real", ybounds = c(0, Inf
     ), closed = c(FALSE, NA), ad = c("weights", "cens", "trunc", "mi"), specials = "transeta"), .Names = c("family",
     "link", "linkfun", "linkinv", "dpars", "type", "ybounds", "closed", "ad",
     "specials"), class = c("brmsfamily", "family"))), order = "none"), .Names = c("family",
     "link", "mix", "order"), class = c("mixfamily", "brmsfamily", "family")), data = structure(list(
     count = c(14L, 21L, 21L, 16L, 22L, 17L, 24L, 17L, 17L, 12L, 20L, 24L, 19L,
     17L, 23L, 17L, 20L, 17L, 20L, 19L, 23L, 17L, 15L, 23L, 24L, 35L, 27L, 13L,
     26L, 15L, 25L, 17L, 15L, 14L, 17L, 22L, 20L, 16L, 15L, 28L, 22L, 31L, 19L,
     17L, 17L, 14L, 19L, 21L, 25L, 29L, 19L, 21L, 20L, 20L, 16L, 16L, 33L, 20L,
     20L, 16L, 19L, 23L, 23L, 22L, 18L, 19L, 14L, 18L, 31L, 17L, 30L, 25L, 24L,
     22L, 21L, 20L, 23L, 22L, 18L, 29L, 17L, 20L, 21L, 19L, 19L, 17L, 19L, 18L,
     19L, 20L, 23L, 16L, 19L, 19L, 16L, 19L, 20L, 23L, 21L, 17L, 17L, 20L, 33L,
     18L, 11L, 20L, 18L, 19L, 23L, 17L, 22L, 21L, 27L, 21L, 22L, 21L, 18L, 20L,
     27L, 16L, 23L, 22L, 18L, 16L, 18L, 16L, 15L, 19L, 21L, 22L, 27L, 19L, 18L,
     26L, 27L, 20L, 18L, 11L, 12L, 14L, 27L, 22L, 23L, 20L, 18L, 28L, 16L, 28L,
     25L, 17L, 14L, 30L, 21L, 26L, 20L, 18L, 19L, 23L, 16L, 21L, 23L, 28L, 24L,
     20L, 15L, 25L, 14L, 12L, 17L, 19L, 17L, 26L, 21L, 25L, 20L, 20L, 21L, 11L,
     33L, 23L, 16L, 12L, 18L, 15L, 18L, 20L, 17L, 18L, 20L, 22L, 20L, 21L, 15L,
     22L, 15L, 26L, 21L, 21L, 21L, 21L, 24L, 22L, 22L, 14L, 27L, 21L, 23L, 13L,
     24L, 18L, 20L, 12L, 16L, 18L, 14L, 21L, 20L, 21L, 16L, 24L, 29L, 17L, 15L,
     19L, 21L, 15L, 24L, 24L, 21L, 13L, 16L, 18L, 19L, 24L, 29L, 14L), Age = c(0.45344675558955,
     0.515410849100596, -1.16395023282441, -0.937743376681319, 0.152347654725241,
     -0.281439223792983, -0.810624371131412, -0.266400655561554, 0.852246789038166,
     -1.41776055713248, -0.308979706199335, 0.425672808701975, -0.0398116914911732,
     -1.64594201898624, 0.936577082331917, 1.48721204653766, 1.60767667745622,
     0.250893744637267, 0.272454067431696, 0.151120397835553, 0.972148262845829,
     1.00919767461536, -0.414270986076424, -0.885750295902445, 1.45433503960248,
     -0.368401509778208, 1.19897700932785, 0.85857279129482, 0.486899829486885,
     -0.12527496668046, 0.0218001786366695, -1.83427457779305, 1.53076518296909,
     1.64020757062729, -1.65152757583031, 0.0301909317630092, -0.569073609790872,
     0.610966061213216, 1.50856768900047, -0.67724858172127, 1.00127286222824,
     1.23559803737651, 1.64678333547692, -1.22505623464341, -0.543198952827159,
     -0.44553541605053, -1.9167749987803, -0.0528137742633058, -0.0330211947986275,
     0.0229248785448746, -1.35010686320641, 0.113811588677316, 0.642987378208233,
     0.249825197296058, -0.0853459836885707, -1.19303796064907, 0.356282686810803,
     0.172087576644518, 1.97372864188582, -1.19054711512027, -0.889302769453446,
     -0.827772216986977, -1.28492962354055, -1.27572577571741, -2.5515137258786,
     2.18791774683888, -0.402669219876226, 2.21595633668288, -2.25042387258164,
     0.103253708285337, 0.819019530197075, 0.867531285479854, 1.45796570320058,
     -1.28845863666195, -0.887796180641521, -3.13369995808798, 0.399934717710489,
     0.424783268348672, 0.656107670120149, 0.976750081918345, 1.20595407698, 1.38233486764073,
     0.292553993771553, 0.378996689455366, 0.195106148373049, 0.28069898192494,
     0.184565208265105, -0.522969262859226, 1.05836414940362, -1.46032492037081,
     0.0269141400185939, -0.758262165486903, -0.352524669710462, -1.58457956897182,
     -0.553440569784362, 0.491812863604194, -1.88318389628993, -0.967118505538357,
     -1.0543856090554, 0.050837227090923, -0.629417112744721, 0.924316787947288,
     1.10143585050171, 1.13320919652301, -0.565994326413448, 0.175488291195354,
     -0.152562951735197, -0.201027284098198, -0.857357542563745, 0.449804227360598,
     -0.313668046187967, 0.86055240847413, -0.147304115800428, -0.322504326013132,
     -0.278551253551235, 0.804984394971709, -0.256557862947846, -0.106027782045305,
     0.853242333363048, 1.59438968914969, 0.45498283638342, -0.835716642310009,
     0.314721239337338, 0.214291606322232, -0.883144613924108, 1.38836823895975,
     1.57378393709947, 0.57326436069633, 1.99057681524775, -0.928682845284003,
     0.371482908625141, -1.77187408647868, 1.72030111258072, -0.247534044217241,
     -0.216269720531311, 1.39224353083729, 2.09536749444053, 0.0791333846972169,
     1.31007058639189, -0.521463931761034, -0.880147136903953, -1.36589200183303,
     0.195888104256897, -0.669565834143609, 0.103535552782471, 1.47893408156977,
     -1.7594676418151, -2.15688641404017, 0.663347217297412, -0.311537309737727,
     -0.446717394693444, 0.339719529339608, 1.12367688242356, -0.22876884555024,
     -0.122069607807934, -1.9372877356011, -0.655485827986667, -0.53578198090703,
     -0.0719121864618582, -0.750105730003408, -1.40521469639207, 2.10663910374229,
     0.83306337133343, -0.111081896784211, -0.736744243092158, -0.648786930890289,
     0.129568451880837, -1.03426394719344, 2.34821580897133, 0.270817612974725,
     0.0236286659597419, 0.0181035772221675, 0.224113043529505, 0.211004018490418,
     0.73074666263149, 0.0847811381994243, -1.15430061874769, -0.33886212929266,
     1.66025649906944, 0.918131834194581, -1.68556173334183, -0.059842894849279,
     0.401287288421787, -0.0999552590508416, 0.818026626579207, -1.49244224737004,
     -0.742561852454392, -0.439439068071281, 0.54985856574768, 0.737970984861386,
     0.494431480847877, -0.711694061618348, 0.214145690616044, 1.51097429224047,
     0.422312786437685, -0.667172230386497, 2.18681454568855, -0.929979960786568,
     0.348013688277128, -1.28420745848875, -3.00942634973815, -0.467755990126433,
     -0.858176212788862, -0.0314226306356567, -0.381643184740578, -0.280192664614407,
     -1.24077596080931, 2.26024123694442, 1.1148425960005, 0.479082155770462,
     -0.484605885570993, 0.361765297282803, 1.06252110783168, -0.198514299870965,
     2.03102867175013, -0.320044208478049, 0.50836374848498, -0.322321693332168,
     0.780634775586391, 1.48344504649836, -0.665854117878145, -0.0581632048625474,
     -0.508618952033426, -0.640026576824838, 0.546517355456073, 0.0329007023975169,
     -1.64687663176852, 0.801161945422651, 1.18046753142577, -0.612964286863616,
     -0.972300313108074, 1.79137772032282, 0.809192900381366, 0.105157638138101,
     -1.07024130237152, 0.854941633799389), patient = structure(c(1L, 2L, 3L,
     4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L,
     20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L,
     35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L,
     50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 1L, 2L, 3L, 4L, 5L, 6L,
     7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L,
     23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L,
     38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L,
     53L, 54L, 55L, 56L, 57L, 58L, 59L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L,
     11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L,
     26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L,
     41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 54L, 55L,
     56L, 57L, 58L, 59L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L,
     14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L,
     29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L,
     44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L,
     59L), .Label = c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11",
     "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24",
     "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37",
     "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50",
     "51", "52", "53", "54", "55", "56", "57", "58", "59"), class = "factor"),
     gender = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), class = "factor", .Label = c("f",
     "m"), contrasts = structure(c(0, 1), .Dim = c(2L, 1L), .Dimnames = list(c("f",
     "m"), "m")))), .Names = c("count", "Age", "patient", "gender"), row.names = c(NA,
     236L), terms = count ~ count + Age + patient + gender, class = "data.frame", brmsframe = TRUE),
     data.name = "dat", model = structure("// generated with brms 2.2.4\nfunctions { \n\n /* compute correlated group-level effects with 'by' variables\n * Args: \n * z: matrix of unscaled group-level effects\n * SD: matrix of standard deviation parameters\n * L: an array of cholesky factor correlation matrices\n * Jby: index which grouping level belongs to which by level\n * Returns: \n * matrix of scaled group-level effects\n */ \n matrix scale_r_cor_by(matrix z, matrix SD, matrix[] L, int[] Jby) {\n // r is stored in another dimension order than z\n matrix[cols(z), rows(z)] r;\n for (j in 1:rows(r)) {\n r[j] = (diag_pre_multiply(SD[, Jby[j]], L[Jby[j]]) * z[, j])';\n }\n return r;\n }\n} \ndata { \n int<lower=1> N; // total number of observations \n vector[N] Y; // response variable \n int<lower=1> K_mu1; // number of population-level effects \n matrix[N, K_mu1] X_mu1; // population-level design matrix \n int<lower=1> K_mu2; // number of population-level effects \n matrix[N, K_mu2] X_mu2; // population-level design matrix \n vector[2] con_theta; // prior concentration \n // data for group-level effects of ID 1\n int<lower=1> J_1[N];\n int<lower=1> N_1;\n int<lower=1> M_1;\n int<lower=1> Nby_1;\n int<lower=1> Jby_1[N_1];\n vector[N] Z_1_mu1_1;\n int prior_only; // should the likelihood be ignored? \n} \ntransformed data { \n int Kc_mu1 = K_mu1 - 1; \n matrix[N, K_mu1 - 1] Xc_mu1; // centered version of X_mu1 \n vector[K_mu1 - 1] means_X_mu1; // column means of X_mu1 before centering \n int Kc_mu2 = K_mu2 - 1; \n matrix[N, K_mu2 - 1] Xc_mu2; // centered version of X_mu2 \n vector[K_mu2 - 1] means_X_mu2; // column means of X_mu2 before centering \n for (i in 2:K_mu1) { \n means_X_mu1[i - 1] = mean(X_mu1[, i]); \n Xc_mu1[, i - 1] = X_mu1[, i] - means_X_mu1[i - 1]; \n } \n for (i in 2:K_mu2) { \n means_X_mu2[i - 1] = mean(X_mu2[, i]); \n Xc_mu2[, i - 1] = X_mu2[, i] - means_X_mu2[i - 1]; \n } \n} \nparameters { \n vector[Kc_mu1] b_mu1; // population-level effects \n real temp_mu1_Intercept; // temporary intercept \n real<lower=0> sigma1; // residual SD \n vector[Kc_mu2] b_mu2; // population-level effects \n real temp_mu2_Intercept; // temporary intercept \n simplex[2] theta; // mixing proportions \n matrix<lower=0>[M_1, Nby_1] sd_1; // group-level standard deviations\n vector[N_1] z_1[M_1]; // unscaled group-level effects\n} \ntransformed parameters { \n // mixing proportions \n real<lower=0,upper=1> theta1 = theta[1]; \n real<lower=0,upper=1> theta2 = theta[2]; \n // group-level effects \n vector[N_1] r_1_mu1_1 = sd_1[1, Jby_1]' .* (z_1[1]);\n} \nmodel { \n vector[N] mu1 = Xc_mu1 * b_mu1 + temp_mu1_Intercept; \n vector[N] mu2 = Xc_mu2 * b_mu2 + temp_mu2_Intercept; \n for (n in 1:N) { \n mu1[n] += r_1_mu1_1[J_1[n]] * Z_1_mu1_1[n];\n mu2[n] = exp(-(mu2[n])); \n } \n // priors including all constants \n target += normal_lpdf(temp_mu1_Intercept | 0, 10); \n target += student_t_lpdf(sigma1 | 3, 0, 10); \n target += normal_lpdf(b_mu2 | 0, 1); \n target += normal_lpdf(temp_mu2_Intercept | 0, 1); \n target += dirichlet_lpdf(theta | con_theta); \n target += student_t_lpdf(to_vector(sd_1) | 3, 0, 10); \n target += normal_lpdf(z_1[1] | 0, 1);\n // likelihood including all constants \n if (!prior_only) { \n for (n in 1:N) { \n real ps[2]; \n ps[1] = log(theta1) + normal_lpdf(Y[n] | mu1[n], sigma1); \n ps[2] = log(theta2) + exponential_lpdf(Y[n] | mu2[n]); \n target += log_sum_exp(ps); \n } \n } \n} \ngenerated quantities { \n // actual population-level intercept \n real b_mu1_Intercept = temp_mu1_Intercept - dot_product(means_X_mu1, b_mu1); \n // actual population-level intercept \n real b_mu2_Intercept = temp_mu2_Intercept - dot_product(means_X_mu2, b_mu2); \n} ", model_name2 = "paste(program, collapse = \"\\n\")", class = c("character",
     "brmsmodel")), prior = structure(list(prior = c("", "", "normal(0, 1)", "",
     "normal(0, 10)", "normal(0, 1)", "student_t(3, 0, 10)", "", "", "student_t(3, 0, 10)",
     "", "logistic(0, 1)", "logistic(0, 1)"), class = c("b", "b", "b", "b", "Intercept",
     "Intercept", "sd", "sd", "sd", "sigma1", "theta", "theta1", "theta2"), coef = c("",
     "Age", "", "Age", "", "", "", "", "Intercept", "", "", "", ""), group = c("",
     "", "", "", "", "", "", "patient", "patient", "", "", "", ""), resp = c("",
     "", "", "", "", "", "", "", "", "", "", "", ""), dpar = c("mu1", "mu1", "mu2",
     "mu2", "mu1", "mu2", "mu1", "mu1", "mu1", "", "", "", ""), nlpar = c("",
     "", "", "", "", "", "", "", "", "", "", "", ""), bound = c("", "", "", "",
     "", "", "", "", "", "", "", "", "")), .Names = c("prior", "class", "coef",
     "group", "resp", "dpar", "nlpar", "bound"), special = structure(list(mu2 = list(),
     mu1 = list()), .Names = c("mu2", "mu1")), row.names = c(NA, -13L), class = c("brmsprior",
     "data.frame"), sample_prior = "no", checked = TRUE), autocor = structure(list(), class = c("cor_empty",
     "cor_brms")), ranef = structure(list(id = 1, group = "patient", gn = 1L,
     gtype = "", coef = "Intercept", cn = 1L, resp = "", dpar = "mu1", nlpar = "",
     ggn = 1L, cor = TRUE, type = "", by = "gender", dist = "gaussian", bylevels = list(
     c("f", "m")), form = list(~1), gcall = list(structure(list(groups = "patient",
     allvars = ~patient + gender, label = "gr(patient, by = gender)",
     by = "gender", dist = "gaussian", type = ""), .Names = c("groups",
     "allvars", "label", "by", "dist", "type")))), .Names = c("id", "group",
     "gn", "gtype", "coef", "cn", "resp", "dpar", "nlpar", "ggn", "cor", "type",
     "by", "dist", "bylevels", "form", "gcall"), row.names = 1L, class = c("ranef_frame",
     "data.frame"), .Label = structure(list(patient = structure(c("1", "2", "3",
     "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17",
     "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30",
     "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43",
     "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56",
     "57", "58", "59"), by = c("m", "m", "m", "m", "m", "m", "m", "m", "m", "m",
     "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m", "m",
     "m", "m", "m", "m", "m", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f",
     "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f", "f",
     "f", "f", "f", "f"))), .Names = "patient")), cov_ranef = NULL, loo = NULL,
     waic = NULL, R2 = NULL, marglik = NULL, stanvars = NULL, stan_funs = NULL,
     fit = <S4 object of class structure("stanfit", package = "rstan")>, exclude = structure(c("res_cov_matrix",
     "mu2", "mu1", "temp_Intercept1", "ordered_Intercept", "theta", "zcar", "temp_mu2_Intercept",
     "hs_local_mu2", "hs_global_mu2", "zb_mu2", "temp_mu1_Intercept", "hs_local_mu1",
     "hs_global_mu1", "zb_mu1", "z_1", "L_1", "Cor_1", "r_1"), save_ranef = TRUE, save_mevars = FALSE, save_all_pars = FALSE),
     algorithm = "sampling", version = structure(list(brms = structure(list(c(2L,
     2L, 4L)), class = c("package_version", "numeric_version")), rstan = structure(list(
     c(2L, 17L, 3L)), class = c("package_version", "numeric_version"))), .Names = c("brms",
     "rstan"))), .Names = c("formula", "family", "data", "data.name", "model",
     "prior", "autocor", "ranef", "cov_ranef", "loo", "waic", "R2", "marglik", "stanvars",
     "stan_funs", "fit", "exclude", "algorithm", "version"), class = "brmsfit"), model_name = "fit5")
     9: log_lik(x, pointwise = pointwise, ...)
     10: log_lik.brmsfit(x, pointwise = pointwise, ...)
     ...
     18: (function (formula, data, family = gaussian(), prior = NULL, autocor = NULL, cov_ranef = NULL,
     sample_prior = c("no", "yes", "only"), stanvars = NULL, knots = NULL, check_response = TRUE,
     only_response = FALSE, control = list(), ...)
     {
     dots <- list(...)
     if (is.brmsfit(formula)) {
     stop2("Use 'standata' to extract Stan data from 'brmsfit' objects.")
     }
     check_response <- as_one_logical(check_response)
     only_response <- as_one_logical(only_response)
     not4stan <- isTRUE(control$not4stan)
     new <- isTRUE(control$new)
     formula <- validate_formula(formula, data = data, family = family, autocor = autocor)
     bterms <- parse_bf(formula)
     sample_prior <- check_sample_prior(sample_prior)
     check_prior_content(prior, warn = FALSE)
     prior <- check_prior_special(prior, bterms = bterms, data = data, check_nlpar_prior = FALSE)
     na_action <- if (new)
     na.pass
     else na.omit2
     data <- update_data(data, bterms = bterms, na.action = na_action, drop.unused.levels = !new,
     knots = knots, terms_attr = control$terms_attr)
     if (has_arma(autocor) || is.cor_bsts(autocor)) {
     data <- order_data(data, bterms = bterms)
     }
     out <- c(list(N = nrow(data)), data_response(bterms, data, check_response = check_response,
     not4stan = not4stan, new = new, old_sdata = control$old_sdata))
     if (!only_response) {
     ranef <- tidy_ranef(bterms, data, old_levels = control$old_levels, old_sdata = control$old_sdata)
     meef <- tidy_meef(bterms, data, old_levels = control$old_levels)
     args_eff <- nlist(x = bterms, data, prior, ranef, meef, cov_ranef, knots,
     not4stan, old_sdata = control$old_sdata)
     out <- c(out, do.call(data_effects, args_eff))
     }
     out$prior_only <- as.integer(identical(sample_prior, "only"))
     stanvars <- validate_stanvars(stanvars)
     if (is.stanvars(stanvars)) {
     inv_names <- intersect(names(stanvars), names(out))
     if (length(inv_names)) {
     stop2("Cannot overwrite existing variables: ", collapse_comma(inv_names))
     }
     out[names(stanvars)] <- lapply(stanvars, "[[", "sdata")
     }
     if (isTRUE(control$save_order)) {
     attr(out, "old_order") <- attr(data, "old_order")
     }
     structure(out, class = "standata")
     })(formula = structure(list(formula = count ~ Age + (1 | gr(patient, by = gender)),
     pforms = structure(list(mu2 = mu2 ~ Age), .Names = "mu2"), pfix = list(), resp = "count",
     family = structure(list(family = "mixture", link = "identity", mix = list(structure(list(
     family = "gaussian", link = "identity", linkfun = function (mu)
     link(mu, link = slink), linkinv = function (eta)
     ilink(eta, link = slink), dpars = c("mu", "sigma"), type = "real", ybounds = c(-Inf,
     Inf), closed = c(NA, NA), ad = c("weights", "se", "cens", "trunc", "mi"),
     specials = "autocor"), .Names = c("family", "link", "linkfun", "linkinv",
     "dpars", "type", "ybounds", "closed", "ad", "specials"), class = c("brmsfamily",
     "family")), structure(list(family = "exponential", link = "log", linkfun = function (mu)
     link(mu, link = slink), linkinv = function (eta)
     ilink(eta, link = slink), dpars = "mu", type = "real", ybounds = c(0, Inf), closed = c(FALSE,
     NA), ad = c("weights", "cens", "trunc", "mi"), specials = "transeta"), .Names = c("family",
     "link", "linkfun", "linkinv", "dpars", "type", "ybounds", "closed", "ad", "specials"
     ), class = c("brmsfamily", "family"))), order = "none"), .Names = c("family",
     "link", "mix", "order"), class = c("mixfamily", "brmsfamily", "family")), autocor = structure(list(), class = c("cor_empty",
     "cor_brms")), mecor = TRUE), .Names = c("formula", "pforms", "pfix", "resp",
     "family", "autocor", "mecor"), class = c("brmsformula", "bform")), data = structure(list(
     count = c(14L, 21L, 21L, 16L, 22L, 17L, 24L, 17L, 17L, 12L, 20L, 24L, 19L, 17L,
     23L, 17L, 20L, 17L, 20L, 19L, 23L, 17L, 15L, 23L, 24L, 35L, 27L, 13L, 26L, 15L,
     25L, 17L, 15L, 14L, 17L, 22L, 20L, 16L, 15L, 28L, 22L, 31L, 19L, 17L, 17L, 14L,
     19L, 21L, 25L, 29L, 19L, 21L, 20L, 20L, 16L, 16L, 33L, 20L, 20L, 16L, 19L, 23L,
     23L, 22L, 18L, 19L, 14L, 18L, 31L, 17L, 30L, 25L, 24L, 22L, 21L, 20L, 23L, 22L,
     18L, 29L, 17L, 20L, 21L, 19L, 19L, 17L, 19L, 18L, 19L, 20L, 23L, 16L, 19L, 19L,
     16L, 19L, 20L, 23L, 21L, 17L, 17L, 20L, 33L, 18L, 11L, 20L, 18L, 19L, 23L, 17L,
     22L, 21L, 27L, 21L, 22L, 21L, 18L, 20L, 27L, 16L, 23L, 22L, 18L, 16L, 18L, 16L,
     15L, 19L, 21L, 22L, 27L, 19L, 18L, 26L, 27L, 20L, 18L, 11L, 12L, 14L, 27L, 22L,
     23L, 20L, 18L, 28L, 16L, 28L, 25L, 17L, 14L, 30L, 21L, 26L, 20L, 18L, 19L, 23L,
     16L, 21L, 23L, 28L, 24L, 20L, 15L, 25L, 14L, 12L, 17L, 19L, 17L, 26L, 21L, 25L,
     20L, 20L, 21L, 11L, 33L, 23L, 16L, 12L, 18L, 15L, 18L, 20L, 17L, 18L, 20L, 22L,
     20L, 21L, 15L, 22L, 15L, 26L, 21L, 21L, 21L, 21L, 24L, 22L, 22L, 14L, 27L, 21L,
     23L, 13L, 24L, 18L, 20L, 12L, 16L, 18L, 14L, 21L, 20L, 21L, 16L, 24L, 29L, 17L,
     15L, 19L, 21L, 15L, 24L, 24L, 21L, 13L, 16L, 18L, 19L, 24L, 29L, 14L), Age = c(0.45344675558955,
     0.515410849100596, -1.16395023282441, -0.937743376681319, 0.152347654725241,
     -0.281439223792983, -0.810624371131412, -0.266400655561554, 0.852246789038166,
     -1.41776055713248, -0.308979706199335, 0.425672808701975, -0.0398116914911732,
     -1.64594201898624, 0.936577082331917, 1.48721204653766, 1.60767667745622, 0.250893744637267,
     0.272454067431696, 0.151120397835553, 0.972148262845829, 1.00919767461536, -0.414270986076424,
     -0.885750295902445, 1.45433503960248, -0.368401509778208, 1.19897700932785, 0.85857279129482,
     0.486899829486885, -0.12527496668046, 0.0218001786366695, -1.83427457779305,
     1.53076518296909, 1.64020757062729, -1.65152757583031, 0.0301909317630092, -0.569073609790872,
     0.610966061213216, 1.50856768900047, -0.67724858172127, 1.00127286222824, 1.23559803737651,
     1.64678333547692, -1.22505623464341, -0.543198952827159, -0.44553541605053, -1.9167749987803,
     -0.0528137742633058, -0.0330211947986275, 0.0229248785448746, -1.35010686320641,
     0.113811588677316, 0.642987378208233, 0.249825197296058, -0.0853459836885707,
     -1.19303796064907, 0.356282686810803, 0.172087576644518, 1.97372864188582, -1.19054711512027,
     -0.889302769453446, -0.827772216986977, -1.28492962354055, -1.27572577571741,
     -2.5515137258786, 2.18791774683888, -0.402669219876226, 2.21595633668288, -2.25042387258164,
     0.103253708285337, 0.819019530197075, 0.867531285479854, 1.45796570320058, -1.28845863666195,
     -0.887796180641521, -3.13369995808798, 0.399934717710489, 0.424783268348672,
     0.656107670120149, 0.976750081918345, 1.20595407698, 1.38233486764073, 0.292553993771553,
     0.378996689455366, 0.195106148373049, 0.28069898192494, 0.184565208265105, -0.522969262859226,
     1.05836414940362, -1.46032492037081, 0.0269141400185939, -0.758262165486903,
     -0.352524669710462, -1.58457956897182, -0.553440569784362, 0.491812863604194,
     -1.88318389628993, -0.967118505538357, -1.0543856090554, 0.050837227090923, -0.629417112744721,
     0.924316787947288, 1.10143585050171, 1.13320919652301, -0.565994326413448, 0.175488291195354,
     -0.152562951735197, -0.201027284098198, -0.857357542563745, 0.449804227360598,
     -0.313668046187967, 0.86055240847413, -0.147304115800428, -0.322504326013132,
     -0.278551253551235, 0.804984394971709, -0.256557862947846, -0.106027782045305,
     0.853242333363048, 1.59438968914969, 0.45498283638342, -0.835716642310009, 0.314721239337338,
     0.214291606322232, -0.883144613924108, 1.38836823895975, 1.57378393709947, 0.57326436069633,
     1.99057681524775, -0.928682845284003, 0.371482908625141, -1.77187408647868, 1.72030111258072,
     -0.247534044217241, -0.216269720531311, 1.39224353083729, 2.09536749444053, 0.0791333846972169,
     1.31007058639189, -0.521463931761034, -0.880147136903953, -1.36589200183303,
     0.195888104256897, -0.669565834143609, 0.103535552782471, 1.47893408156977, -1.7594676418151,
     -2.15688641404017, 0.663347217297412, -0.311537309737727, -0.446717394693444,
     0.339719529339608, 1.12367688242356, -0.22876884555024, -0.122069607807934, -1.9372877356011,
     -0.655485827986667, -0.53578198090703, -0.0719121864618582, -0.750105730003408,
     -1.40521469639207, 2.10663910374229, 0.83306337133343, -0.111081896784211, -0.736744243092158,
     -0.648786930890289, 0.129568451880837, -1.03426394719344, 2.34821580897133, 0.270817612974725,
     0.0236286659597419, 0.0181035772221675, 0.224113043529505, 0.211004018490418,
     0.73074666263149, 0.0847811381994243, -1.15430061874769, -0.33886212929266, 1.66025649906944,
     0.918131834194581, -1.68556173334183, -0.059842894849279, 0.401287288421787,
     -0.0999552590508416, 0.818026626579207, -1.49244224737004, -0.742561852454392,
     -0.439439068071281, 0.54985856574768, 0.737970984861386, 0.494431480847877, -0.711694061618348,
     0.214145690616044, 1.51097429224047, 0.422312786437685, -0.667172230386497, 2.18681454568855,
     -0.929979960786568, 0.348013688277128, -1.28420745848875, -3.00942634973815,
     -0.467755990126433, -0.858176212788862, -0.0314226306356567, -0.381643184740578,
     -0.280192664614407, -1.24077596080931, 2.26024123694442, 1.1148425960005, 0.479082155770462,
     -0.484605885570993, 0.361765297282803, 1.06252110783168, -0.198514299870965,
     2.03102867175013, -0.320044208478049, 0.50836374848498, -0.322321693332168, 0.780634775586391,
     1.48344504649836, -0.665854117878145, -0.0581632048625474, -0.508618952033426,
     -0.640026576824838, 0.546517355456073, 0.0329007023975169, -1.64687663176852,
     0.801161945422651, 1.18046753142577, -0.612964286863616, -0.972300313108074,
     1.79137772032282, 0.809192900381366, 0.105157638138101, -1.07024130237152, 0.854941633799389
     ), patient = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L,
     14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L,
     30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L,
     46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 1L, 2L,
     3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L,
     20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L,
     36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L,
     52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L,
     11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L,
     27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L,
     43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L,
     59L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L,
     18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L,
     34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L,
     50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L), .Label = c("1", "2", "3",
     "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17",
     "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30",
     "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43",
     "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56",
     "57", "58", "59"), class = "factor"), gender = structure(c(2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
     2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
     1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), class = "factor", .Label = c("f",
     "m"), contrasts = structure(c(0, 1), .Dim = c(2L, 1L), .Dimnames = list(c("f",
     "m"), "m")))), .Names = c("count", "Age", "patient", "gender"), row.names = c(NA,
     236L), terms = count ~ count + Age + patient + gender, class = "data.frame", brmsframe = TRUE, valid = TRUE, original = TRUE),
     prior = structure(list(prior = c("", "", "normal(0, 1)", "", "normal(0, 10)",
     "normal(0, 1)", "student_t(3, 0, 10)", "", "", "student_t(3, 0, 10)", "", "logistic(0, 1)",
     "logistic(0, 1)"), class = c("b", "b", "b", "b", "Intercept", "Intercept", "sd",
     "sd", "sd", "sigma1", "theta", "theta1", "theta2"), coef = c("", "Age", "", "Age",
     "", "", "", "", "Intercept", "", "", "", ""), group = c("", "", "", "", "", "",
     "", "patient", "patient", "", "", "", ""), resp = c("", "", "", "", "", "", "",
     "", "", "", "", "", ""), dpar = c("mu1", "mu1", "mu2", "mu2", "mu1", "mu2", "mu1",
     "mu1", "mu1", "", "", "", ""), nlpar = c("", "", "", "", "", "", "", "", "",
     "", "", "", ""), bound = c("", "", "", "", "", "", "", "", "", "", "", "", ""
     )), .Names = c("prior", "class", "coef", "group", "resp", "dpar", "nlpar", "bound"
     ), special = structure(list(mu2 = list(), mu1 = list()), .Names = c("mu2", "mu1"
     )), row.names = c(NA, -13L), class = c("brmsprior", "data.frame"), sample_prior = "no", checked = TRUE),
     cov_ranef = NULL, sample_prior = "no", stanvars = NULL, knots = NULL, control = structure(list(
     not4stan = TRUE, save_order = TRUE), .Names = c("not4stan", "save_order")),
     resp = NULL, allow_new_levels = FALSE, check_response = TRUE)
     19: data_response(bterms, data, check_response = check_response, not4stan = not4stan,
     new = new, old_sdata = control$old_sdata)
     20: data_response.brmsterms(bterms, data, check_response = check_response, not4stan = not4stan,
     new = new, old_sdata = control$old_sdata)
     21: family_info(x$family, "closed")
     22: family_info.mixfamily(x$family, "closed")
     23: combine_family_info(out, y = y)
     24: ulapply(x[, 1], isFALSE)
     25: unlist(lapply(X, FUN, ...), recursive, use.names)
     26: lapply(X, FUN, ...)
     27: match.fun(FUN)
    
     -- 3. Error: self-defined functions appear in the Stan code (@tests.make_stancod
     could not find function "isFALSE"
     1: make_stancode(time | cens(censored) ~ age, data = kidney, family = inverse.gaussian) at testthat/tests.make_stancode.R:334
     2: stan_effects(bterms, data = data, prior = prior, ranef = ranef, meef = meef, sparse = sparse)
     3: stan_effects.brmsterms(bterms, data = data, prior = prior, ranef = ranef, meef = meef,
     sparse = sparse)
     4: stan_response(x, data = data)
     5: has_cens(bterms, data = data)
     6: eval_rhs(formula, data = data)
     7: eval(rhs(formula)[[2]], data, environment(formula))
     8: eval(rhs(formula)[[2]], data, environment(formula))
     9: resp_cens(censored)
     10: unname(ulapply(x, prepare_cens))
     11: ulapply(x, prepare_cens)
     12: unlist(lapply(X, FUN, ...), recursive, use.names)
     13: lapply(X, FUN, ...)
     14: FUN(X[[i]], ...)
    
     -- 4. Failure: invalid combinations of modeling options are detected (@tests.mak
     `make_stancode(y1 | cens(ci) ~ y2, data = data, autocor = cor_ar(cov = TRUE))` threw an error with unexpected message.
     Expected match: "Invalid addition arguments for this model"
     Actual message: "could not find function \"isFALSE\""
    
     -- 5. Failure: invalid combinations of modeling options are detected (@tests.mak
     `make_stancode(y1 | resp_se(wi) ~ y2, data = data, autocor = cor_ma())` threw an error with unexpected message.
     Expected match: "Please set cov = TRUE"
     Actual message: "could not find function \"isFALSE\""
    
     -- 6. Error: Stan code for multivariate models is correct (@tests.make_stancode.
     could not find function "isFALSE"
     1: make_stancode(bform, dat, prior = bprior) at testthat/tests.make_stancode.R:454
     2: stan_effects(bterms, data = data, prior = prior, ranef = ranef, meef = meef, sparse = sparse)
     3: stan_effects.mvbrmsterms(bterms, data = data, prior = prior, ranef = ranef, meef = meef,
     sparse = sparse)
     4: collapse_lists(ls = lapply(x$terms, stan_effects, prior = prior, rescor = x$rescor,
     ...))
     5: lapply(x$terms, stan_effects, prior = prior, rescor = x$rescor, ...)
     6: FUN(X[[i]], ...)
     7: stan_effects.brmsterms(X[[i]], ...)
     8: stan_response(x, data = data)
     9: has_cens(bterms, data = data)
     10: eval_rhs(formula, data = data)
     11: eval(rhs(formula)[[2]], data, environment(formula))
     12: eval(rhs(formula)[[2]], data, environment(formula))
     13: resp_cens(censi)
     14: unname(ulapply(x, prepare_cens))
     15: ulapply(x, prepare_cens)
     16: unlist(lapply(X, FUN, ...), recursive, use.names)
     17: lapply(X, FUN, ...)
     18: FUN(X[[i]], ...)
    
     -- 7. Error: known standard errors appear in the Stan code (@tests.make_stancode
     could not find function "isFALSE"
     1: make_stancode(time | se(age) ~ sex, data = kidney) at testthat/tests.make_stancode.R:701
     2: parse_bf(formula)
     3: parse_bf.brmsformula(formula)
     4: no_sigma(y)
    
     -- 8. Error: Stan code of response times models is correct (@tests.make_stancode
     could not find function "isFALSE"
     1: make_stancode(count | cens(cens) ~ Trt_c + (1 | patient), data = dat, family = exgaussian("inverse")) at testthat/tests.make_stancode.R:802
     2: stan_effects(bterms, data = data, prior = prior, ranef = ranef, meef = meef, sparse = sparse)
     3: stan_effects.brmsterms(bterms, data = data, prior = prior, ranef = ranef, meef = meef,
     sparse = sparse)
     4: stan_response(x, data = data)
     5: has_cens(bterms, data = data)
     6: eval_rhs(formula, data = data)
     7: eval(rhs(formula)[[2]], data, environment(formula))
     8: eval(rhs(formula)[[2]], data, environment(formula))
     9: resp_cens(cens)
     10: unname(ulapply(x, prepare_cens))
     11: ulapply(x, prepare_cens)
     12: unlist(lapply(X, FUN, ...), recursive, use.names)
     13: lapply(X, FUN, ...)
     14: FUN(X[[i]], ...)
    
     -- 9. Error: weighted, censored, and truncated likelihoods are correct (@tests.m
     could not find function "isFALSE"
     1: expect_match2(make_stancode(y | cens(x, y2) ~ 1, dat, poisson()), "target += poisson_lpmf(Y[n] | mu[n]);") at testthat/tests.make_stancode.R:896
     2: testthat::expect_match(object, regexp, fixed = TRUE, ..., all = all)
     3: quasi_label(enquo(object), label)
     4: eval_bare(get_expr(quo), get_env(quo))
     5: make_stancode(y | cens(x, y2) ~ 1, dat, poisson())
     6: stan_effects(bterms, data = data, prior = prior, ranef = ranef, meef = meef, sparse = sparse)
     7: stan_effects.brmsterms(bterms, data = data, prior = prior, ranef = ranef, meef = meef,
     sparse = sparse)
     8: stan_response(x, data = data)
     9: has_cens(bterms, data = data)
     10: eval_rhs(formula, data = data)
     11: eval(rhs(formula)[[2]], data, environment(formula))
     12: eval(rhs(formula)[[2]], data, environment(formula))
     13: resp_cens(x, y2)
     14: unname(ulapply(x, prepare_cens))
     15: ulapply(x, prepare_cens)
     16: unlist(lapply(X, FUN, ...), recursive, use.names)
     17: lapply(X, FUN, ...)
     18: FUN(X[[i]], ...)
    
     -- 10. Error: Stan code of quantile regression models is correct (@tests.make_st
     could not find function "isFALSE"
     1: make_stancode(y | cens(c) ~ x, data, family = asym_laplace()) at testthat/tests.make_stancode.R:1127
     2: stan_effects(bterms, data = data, prior = prior, ranef = ranef, meef = meef, sparse = sparse)
     3: stan_effects.brmsterms(bterms, data = data, prior = prior, ranef = ranef, meef = meef,
     sparse = sparse)
     4: stan_response(x, data = data)
     5: has_cens(bterms, data = data)
     6: eval_rhs(formula, data = data)
     7: eval(rhs(formula)[[2]], data, environment(formula))
     8: eval(rhs(formula)[[2]], data, environment(formula))
     9: resp_cens(c)
     10: unname(ulapply(x, prepare_cens))
     11: ulapply(x, prepare_cens)
     12: unlist(lapply(X, FUN, ...), recursive, use.names)
     13: lapply(X, FUN, ...)
     14: FUN(X[[i]], ...)
    
     -- 11. Error: Stan code of GEV models is correct (@tests.make_stancode.R#1149)
     could not find function "isFALSE"
     1: make_stancode(y | cens(c) ~ x, data, gen_extreme_value()) at testthat/tests.make_stancode.R:1149
     2: stan_effects(bterms, data = data, prior = prior, ranef = ranef, meef = meef, sparse = sparse)
     3: stan_effects.brmsterms(bterms, data = data, prior = prior, ranef = ranef, meef = meef,
     sparse = sparse)
     4: stan_response(x, data = data)
     5: has_cens(bterms, data = data)
     6: eval_rhs(formula, data = data)
     7: eval(rhs(formula)[[2]], data, environment(formula))
     8: eval(rhs(formula)[[2]], data, environment(formula))
     9: resp_cens(c)
     10: unname(ulapply(x, prepare_cens))
     11: ulapply(x, prepare_cens)
     12: unlist(lapply(X, FUN, ...), recursive, use.names)
     13: lapply(X, FUN, ...)
     14: FUN(X[[i]], ...)
    
     -- 12. Error: Stan code of mixture model is correct (@tests.make_stancode.R#1194
     could not find function "isFALSE"
     1: make_stancode(bf(abs(y) | se(c) ~ x), data = data, mixture(gaussian, student)) at testthat/tests.make_stancode.R:1194
     2: stan_llh(bterms, data = data)
     3: stan_llh.brmsterms(bterms, data = data)
     4: paste0(" ", stan_llh(family$family, bterms = family, ...))
     5: stan_llh(family$family, bterms = family, ...)
     6: stan_llh.mixfamily(family$family, bterms = family, ...)
     7: stan_llh(family$mix[[i]], sbterms, mix = i, ptheta = ptheta, ...)
     8: stan_llh.default(family$mix[[i]], sbterms, mix = i, ptheta = ptheta, ...)
     9: do.call(llh_fun, llh_args)
     10: stan_llh_gaussian(bterms = structure(list(formula = abs(y) | se(c) ~ x, family = structure(list(
     family = "gaussian", link = "identity", linkfun = function (mu)
     link(mu, link = slink), linkinv = function (eta)
     ilink(eta, link = slink), dpars = c("mu", "sigma"), type = "real", ybounds = c(-Inf,
     Inf), closed = c(NA, NA), ad = c("weights", "se", "cens", "trunc", "mi"), specials = "autocor"), .Names = c("family",
     "link", "linkfun", "linkinv", "dpars", "type", "ybounds", "closed", "ad", "specials"
     ), class = c("brmsfamily", "family")), autocor = NULL, mv = FALSE, rescor = FALSE,
     mecor = TRUE, respform = abs(y) ~ 1, resp = "", adforms = structure(list(se = ~resp_se(c)), .Names = "se"),
     dpars = structure(list(mu1 = structure(list(formula = ~x, fe = ~1 + x, re = structure(list(
     group = structure(integer(0), .Label = character(0), class = "factor"), gtype = structure(integer(0), .Label = character(0), class = "factor"),
     gn = numeric(0), id = numeric(0), type = structure(integer(0), .Label = character(0), class = "factor"),
     cor = logical(0), form = structure(integer(0), .Label = character(0), class = "factor")), .Names = c("group",
     "gtype", "gn", "id", "type", "cor", "form"), row.names = integer(0), class = "data.frame"),
     allvars = ~x, family = structure(list(family = "gaussian", link = "identity",
     linkfun = function (mu)
     link(mu, link = slink), linkinv = function (eta)
     ilink(eta, link = slink), dpars = c("mu", "sigma"), type = "real", ybounds = c(-Inf,
     Inf), closed = c(NA, NA), ad = c("weights", "se", "cens", "trunc", "mi"
     ), specials = "autocor"), .Names = c("family", "link", "linkfun", "linkinv",
     "dpars", "type", "ybounds", "closed", "ad", "specials"), class = c("brmsfamily",
     "family")), dpar = "mu1", resp = ""), .Names = c("formula", "fe", "re", "allvars",
     "family", "dpar", "resp"), class = "btl")), .Names = "mu1"), time = structure(list(
     allvars = ~1), .Names = "allvars"), allvars = abs(y) ~ y + c + x), .Names = c("formula",
     "family", "autocor", "mv", "rescor", "mecor", "respform", "resp", "adforms", "dpars",
     "time", "allvars"), class = "brmsterms"), resp = "", mix = 1L)
     11: stan_llh_add_se(p$sigma, bterms, reqn, resp)
     12: no_sigma(bterms)
    
     -- 13. Error: Stan code for skew_normal models is correct (@tests.make_stancode.
     could not find function "isFALSE"
     1: make_stancode(bf(y | se(x) ~ x, alpha ~ x), dat, skew_normal()) at testthat/tests.make_stancode.R:1366
     2: parse_bf(formula)
     3: parse_bf.brmsformula(formula)
     4: no_sigma(y)
    
     -- 14. Error: Stan code for missing value terms works correctly (@tests.make_sta
     could not find function "isFALSE"
     1: make_stancode(bform, dat) at testthat/tests.make_stancode.R:1413
     2: stan_effects(bterms, data = data, prior = prior, ranef = ranef, meef = meef, sparse = sparse)
     3: stan_effects.mvbrmsterms(bterms, data = data, prior = prior, ranef = ranef, meef = meef,
     sparse = sparse)
     4: collapse_lists(ls = lapply(x$terms, stan_effects, prior = prior, rescor = x$rescor,
     ...))
     5: lapply(x$terms, stan_effects, prior = prior, rescor = x$rescor, ...)
     6: FUN(X[[i]], ...)
     7: stan_effects.brmsterms(X[[i]], ...)
     8: stan_response(x, data = data)
     9: has_cens(bterms, data = data)
     10: eval_rhs(formula, data = data)
     11: eval(rhs(formula)[[2]], data, environment(formula))
     12: eval(rhs(formula)[[2]], data, environment(formula))
     13: resp_cens(z)
     14: unname(ulapply(x, prepare_cens))
     15: ulapply(x, prepare_cens)
     16: unlist(lapply(X, FUN, ...), recursive, use.names)
     17: lapply(X, FUN, ...)
     18: FUN(X[[i]], ...)
    
     -- 15. Error: make_standata returns correct data names for addition and cs varia
     could not find function "isFALSE"
     1: expect_equal(names(make_standata(y | se(w) ~ x, dat, gaussian())), c("N", "Y", "se",
     "K", "X", "sigma", "prior_only")) at testthat/tests.make_standata.R:48
     2: quasi_label(enquo(object), label)
     3: eval_bare(get_expr(quo), get_env(quo))
     4: make_standata(y | se(w) ~ x, dat, gaussian())
     5: parse_bf(formula)
     6: parse_bf.brmsformula(formula)
     7: no_sigma(y)
    
     -- 16. Error: make_standata returns correct values for addition terms (@tests.ma
     could not find function "isFALSE"
     1: expect_equivalent(make_standata(y | se(s) ~ 1, data = dat)$se, as.array(1:9)) at testthat/tests.make_standata.R:148
     2: quasi_label(enquo(object), label)
     3: eval_bare(get_expr(quo), get_env(quo))
     4: make_standata(y | se(s) ~ 1, data = dat)
     5: parse_bf(formula)
     6: parse_bf.brmsformula(formula)
     7: no_sigma(y)
    
     -- 17. Failure: make_standata rejects incorrect addition terms (@tests.make_stan
     `make_standata(y | se(s) ~ 1, data = dat)` threw an error with unexpected message.
     Expected match: "Standard errors must be non-negative"
     Actual message: "could not find function \"isFALSE\""
    
     -- 18. Error: make_standata handles multivariate models (@tests.make_standata.R#
     could not find function "isFALSE"
     1: make_standata(bform, dat, prior = bprior) at testthat/tests.make_standata.R:220
     2: data_response(bterms, data, check_response = check_response, not4stan = not4stan,
     new = new, old_sdata = control$old_sdata)
     3: data_response.mvbrmsterms(bterms, data, check_response = check_response, not4stan = not4stan,
     new = new, old_sdata = control$old_sdata)
     4: data_response(x$terms[[i]], old_sdata = od, ...)
     5: data_response.brmsterms(x$terms[[i]], old_sdata = od, ...)
     6: eval_rhs(x$adforms$cens, data = data)
     7: eval(rhs(formula)[[2]], data, environment(formula))
     8: eval(rhs(formula)[[2]], data, environment(formula))
     9: resp_cens(censi)
     10: unname(ulapply(x, prepare_cens))
     11: ulapply(x, prepare_cens)
     12: unlist(lapply(X, FUN, ...), recursive, use.names)
     13: lapply(X, FUN, ...)
     14: FUN(X[[i]], ...)
    
     -- 19. Error: make_standata includes data for mixture models (@tests.make_standa
     object 'isFALSE' not found
     1: make_standata(form, data) at testthat/tests.make_standata.R:608
     2: data_response(bterms, data, check_response = check_response, not4stan = not4stan,
     new = new, old_sdata = control$old_sdata)
     3: data_response.brmsterms(bterms, data, check_response = check_response, not4stan = not4stan,
     new = new, old_sdata = control$old_sdata)
     4: family_info(x$family, "closed")
     5: family_info.mixfamily(x$family, "closed")
     6: combine_family_info(out, y = y)
     7: ulapply(x[, 1], isFALSE)
     8: unlist(lapply(X, FUN, ...), recursive, use.names)
     9: lapply(X, FUN, ...)
     10: match.fun(FUN)
    
     == testthat results ===========================================================
     OK: 995 SKIPPED: 1 FAILED: 19
     1. Failure: brm produces expected errors (@tests.brm.R#17)
     2. Error: all S3 methods have reasonable ouputs (@tests.brmsfit-methods.R#235)
     3. Error: self-defined functions appear in the Stan code (@tests.make_stancode.R#334)
     4. Failure: invalid combinations of modeling options are detected (@tests.make_stancode.R#403)
     5. Failure: invalid combinations of modeling options are detected (@tests.make_stancode.R#411)
     6. Error: Stan code for multivariate models is correct (@tests.make_stancode.R#454)
     7. Error: known standard errors appear in the Stan code (@tests.make_stancode.R#701)
     8. Error: Stan code of response times models is correct (@tests.make_stancode.R#802)
     9. Error: weighted, censored, and truncated likelihoods are correct (@tests.make_stancode.R#896)
     1. ...
    
     Error: testthat unit tests failed
     Execution halted
Flavor: r-oldrel-windows-ix86+x86_64

Version: 2.2.0
Check: installed package size
Result: NOTE
     installed size is 5.8Mb
     sub-directories of 1Mb or more:
     R 2.6Mb
     doc 2.4Mb
Flavor: r-oldrel-osx-x86_64