|
38 | 38 | #' \code{b_x1} and \code{b_x2} respectively. |
39 | 39 | #' The default prior for fixed and category specific effects is an |
40 | 40 | #' improper flat prior over the reals. Other common options are normal priors |
41 | | -#' or uniform priors over a finite interval. |
42 | | -#' If we want to have a normal prior with mean 0 and |
| 41 | +#' or student-t priors. If we want to have a normal prior with mean 0 and |
43 | 42 | #' standard deviation 5 for \code{x1}, |
44 | | -#' and a uniform prior between -10 and 10 for \code{x2}, |
| 43 | +#' and a unit student-t prior with 10 degrees of freedom for \code{x2}, |
45 | 44 | #' we can specify this via |
46 | 45 | #' \code{set_prior("normal(0,5)", class = "b", coef = "x1")} and \cr |
47 | | -#' \code{set_prior("uniform(-10,10)", class = "b", coef = "x2")}. |
| 46 | +#' \code{set_prior("student_t(10,0,1)", class = "b", coef = "x2")}. |
48 | 47 | #' To put the same prior on all fixed effects at once, |
49 | 48 | #' we may write as a shortcut \code{set_prior("<prior>", class = "b")}. |
50 | 49 | #' This also leads to faster sampling, because priors can be vectorized in this case. |
51 | | -#' Both ways of defining priors can be combined using for instance \cr |
52 | | -#' \code{set_prior("normal(0,10)", class = "b", coef = "Intercept")} and \cr |
53 | | -#' \code{set_prior("normal(0,2)", class = "b")} at the same time. |
54 | | -#' This will set a \code{normal(0,10)} prior on the Intercept and a \code{normal(0,2)} |
55 | | -#' prior on all other fixed effects. Note that the priors are no longer |
56 | | -#' vectorized in this case. |
| 50 | +#' Both ways of defining priors can be combined using for instance |
| 51 | +#' \code{set_prior("normal(0,2)", class = "b")} and \cr |
| 52 | +#' \code{set_prior("normal(0,10)", class = "b", coef = "Intercept")} |
| 53 | +#' at the same time. This will set a \code{normal(0,10)} prior on |
| 54 | +#' the Intercept and a \code{normal(0,2)} prior on all other fixed effects. |
| 55 | +#' The intercept can have a separate prior without breaking vectorization. |
| 56 | +#' However, this is not the case for other fixed effects. |
57 | 57 | #' |
58 | 58 | #' A special shrinkage prior to be applied on fixed effects is the horseshoe prior. |
59 | 59 | #' It is symmetric around zero with fat tails and an infinitely large spike |
|
69 | 69 | #' so that slightly higher values may often be a better option. |
70 | 70 | #' Generally, models with horseshoe priors a more likely than other models |
71 | 71 | #' to have divergent transitions so that increasing \code{adapt_delta} |
72 | | -#' from \code{0.95} to values closer to \code{1} will often be necessary. |
| 72 | +#' from \code{0.8} to values closer to \code{1} will often be necessary. |
73 | 73 | #' See the documentation of \code{\link[brms:brm]{brm}} for instructions |
74 | 74 | #' on how to increase \code{adapt_delta}. \cr |
75 | 75 | #' |
|
0 commit comments