-
Notifications
You must be signed in to change notification settings - Fork 0
/
about_brms.Rmd
86 lines (85 loc) · 4.93 KB
/
about_brms.Rmd
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Package ‘brms’
October 23, 2018
Encoding UTF-8
Type Package
Title Bayesian Regression Models using 'Stan'
Version 2.6.0
Date 2018-10-22
Depends R (>= 3.2.0), Rcpp (>= 0.12.0), ggplot2 (>= 2.0.0), methods
Imports rstan (>= 2.17.2), loo (>= 2.0.0), Matrix (>= 1.1.1), mgcv (>=
1.8-13), rstantools (>= 1.3.0), bayesplot (>= 1.5.0), shinystan
(>= 2.4.0), bridgesampling (>= 0.3-0), matrixStats, nleqslv,
nlme, coda, abind, stats, utils, parallel, grDevices, backports
Suggests testthat (>= 0.9.1), RWiener, future, mice, spdep, mnormt,
lme4, MCMCglmm, ape, arm, statmod, digest, R.rsp, knitr,
rmarkdown
Description Fit Bayesian generalized (non-)linear multivariate multilevel models
using 'Stan' for full Bayesian inference. A wide range of distributions
and link functions are supported, allowing users to fit -- among others --
linear, robust linear, count data, survival, response times, ordinal,
zero-inflated, hurdle, and even self-defined mixture models all in a
multilevel context. Further modeling options include non-linear and
smooth terms, auto-correlation structures, censored data, meta-analytic
standard errors, and quite a few more. In addition, all parameters of the
response distribution can be predicted in order to perform distributional
regression. Prior specifications are flexible and explicitly encourage
users to apply prior distributions that actually reflect their beliefs.
Model fit can easily be assessed and compared with posterior predictive
checks and leave-one-out cross-validation. References: Bürkner (2017)
<doi:10.18637/jss.v080.i01>; Carpenter et al. (2017) <doi:10.18637/jss.v076.i01>.
LazyData true
NeedsCompilation no
License GPL (>= 3)
URL https://github.com/paul-buerkner/brms,
http://discourse.mc-stan.org
1
2 R topics documented:
BugReports https://github.com/paul-buerkner/brms/issues
VignetteBuilder knitr, R.rsp
RoxygenNote 6.1.0
Author Paul-Christian Bürkner [aut, cre]
Maintainer Paul-Christian Bürkner <[email protected]>
Repository CRAN
Date/Publication 2018-10-23 10:40:08 UTC
R topics documented:
brms-package Bayesian Regression Models using ’Stan’
#### Description
The brms package provides an interface to fit Bayesian generalized multivariate (non-)linear multilevel
models using Stan, which is a C++ package for obtaining full Bayesian inference (see
http://mc-stan.org/). The formula syntax is an extended version of the syntax applied in the
lme4 package to provide a familiar and simple interface for performing regression analyses.
#### Details
The main function of brms is brm, which uses formula syntax to specify a wide range of complex
Bayesian models (see brmsformula for #### Details). Based on the supplied formulas, data, and
additional information, it writes the Stan code on the fly via make_stancode, prepares the data via
make_standata, and fits the model using Stan.
Subsequently, a large number of post-processing methods can be applied: To get an overview on
the estimated parameters, summary or marginal_effects are perfectly suited. Detailed visual
analyses can be performed by applying the pp_check and stanplot methods, which both rely on
the bayesplot package. Model comparsions can be done via loo and waic, which make use of the
loo package as well as via bayes_factor which relies on the bridgesampling package. For a full
list of methods to apply, type methods(class = "brmsfit").
Because brms is based on Stan, a C++ compiler is required. The program Rtools (available on
https://cran.r-project.org/bin/windows/Rtools/) comes with a C++ compiler for Windows.
On Mac, you should use Xcode. For further instructions on how to get the compilers running,
see the prerequisites section at the RStan-Getting-Started page.
When comparing other packages fitting multilevel models to brms, keep in mind that the latter
needs to compile models before actually fitting them, which will require between 20 and 40 seconds
depending on your machine, operating system and overall model complexity.
Thus, fitting smaller models may be relatively slow as compilation time makes up the majority of
the whole running time. For larger / more complex models however, fitting my take several minutes
or even hours, so that the compilation time won’t make much of a difference for these models.
See vignette("brms_overview") and vignette("brms_multilevel") for a general introduction
and overview of brms. For a full list of available vignettes, type vignette(package = "brms").
References
Paul-Christian Buerkner (2017). brms: An R Package for Bayesian Multilevel Models Using Stan.
Journal of Statistical Software, 80(1), 1-28. doi:10.18637/jss.v080.i01
Paul-Christian Buerkner (in press). Advanced Bayesian Multilevel Modeling with the R Package
brms. The R Journal.
The Stan Development Team. Stan Modeling Language User’s Guide and Reference Manual.
http://mc-stan.org/users/documentation.
Stan Development Team (2018). RStan: the R interface to Stan. R package version 2.18.1. http:
//mc-stan.org
6 addition-terms
See Also
brm, brmsformula, brmsfamily, brmsfit