paul-buerkner / brms

Compare e1c44ce ... +0 ... 70dc9e7


@@ -485,12 +485,8 @@
Loading
485 485
    )
486 486
  }
487 487
  if (!is.null(special$lasso)) {
488 -
    str_add(out$par) <- glue(
489 -
      "  vector[K{ct}{sp}] b{sp};  // population-level effects\n"
490 -
    )
491 -
    str_add(out$pll_args) <- glue(", vector b{sp}")
492 488
    str_add(out$model_prior) <- glue(
493 -
      "{tp}double_exponential_lpdf(b{sp} | 0, lasso_scale{p} * lasso_inv_lambda{p});\n"
489 +
      "{tp}double_exponential_lpdf(b{suffix}{sp} | 0, lasso_scale{p} * lasso_inv_lambda{p});\n"
494 490
    )
495 491
  }
496 492
  out

@@ -320,11 +320,14 @@
Loading
320 320
      b_comment <- "population-level effects"
321 321
      if (has_special_b_prior) {
322 322
        stopif_prior_bound(prior, class = "b", ls = px)
323 +
        b_def <- glue("  {b_type} b{p};  // {b_comment}\n")
323 324
        if (assign_b_tpar) {
324 325
          # only some special priors assign b in transformed parameters
325 -
          str_add(out$tpar_def) <- glue("  {b_type} b{p};  // {b_comment}\n")
326 -
          str_add(out$pll_args) <- glue(", vector b{p}")
326 +
          str_add(out$tpar_def) <- b_def
327 +
        } else {
328 +
          str_add(out$par) <- b_def
327 329
        }
330 +
        str_add(out$pll_args) <- glue(", vector b{p}")
328 331
      } else {
329 332
        str_add_list(out) <- stan_prior(
330 333
          prior, class = "b", coef = fixef, type = b_type,
@@ -338,11 +341,14 @@
Loading
338 341
      b_suffix <- "Q"
339 342
      b_comment <- "regression coefficients at QR scale"
340 343
      if (has_special_b_prior) {
344 +
        bQ_def <- glue("  {b_type} bQ{p};  // {b_comment}\n")
341 345
        if (assign_b_tpar) {
342 346
          # only some special priors assign b in transformed parameters
343 -
          str_add(out$tpar_def) <- glue("  {b_type} bQ{p};  // {b_comment}\n")
344 -
          str_add(out$pll_args) <- glue(", vector bQ{p}")
347 +
          str_add(out$tpar_def) <- bQ_def
348 +
        } else {
349 +
          str_add(out$par) <- bQ_def
345 350
        }
351 +
        str_add(out$pll_args) <- glue(", vector bQ{p}")
346 352
      } else {
347 353
        str_add_list(out) <- stan_prior(
348 354
          prior, class = "b", coef = fixef, type = b_type,
@@ -983,13 +989,17 @@
Loading
983 989
  # prepare special effects coefficients
984 990
  if (stan_has_special_b_prior(bterms, prior)) {
985 991
    stopif_prior_bound(prior, class = "b", ls = px)
992 +
    bsp_def <- glue(
993 +
      "  // special effects coefficients\n",
994 +
      "  vector[Ksp{p}] bsp{p};\n"
995 +
    )
986 996
    if (stan_assign_b_tpar(bterms, prior)) {
987 997
      # only some special priors assign b in transformed parameters
988 -
      str_add(out$tpar_def) <- glue(
989 -
        "  // special effects coefficients\n",
990 -
        "  vector[Ksp{p}] bsp{p};\n"
991 -
      )
998 +
      str_add(out$tpar_def) <- bsp_def
999 +
    } else {
1000 +
      str_add(out$par) <- bsp_def
992 1001
    }
1002 +
    str_add(out$pll_args) <- glue(", vector bsp{p}")
993 1003
  } else {
994 1004
    str_add_list(out) <- stan_prior(
995 1005
      prior, class = "b", coef = spef$coef,

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R -<.01% 82.26%
Project Totals (70 files) 82.26%
Loading