-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.Rmd
820 lines (777 loc) · 22.1 KB
/
Main.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
mmc Multi-Membership Covariates
#### Description
Specify covarariates that vary over different levels of multi-membership grouping factors thus requiring
special treatment. This function is almost solely useful, when called in combination with
mm. Outside of multi-membership terms it will behave very much like cbind.
#### Usage
<pre><code>
mmc(...)
</code></pre>
#### Arguments
... One or more terms containing covariates corresponding to the grouping levels
specified in mm.
#### Value
A matrix with covariates as columns.
See Also
mm
#### Examples
```{r}
## Not run:
# simulate some data
dat <- data.frame(
y = rnorm(100), x1 = rnorm(100), x2 = rnorm(100),
g1 = sample(1:10, 100, TRUE), g2 = sample(1:10, 100, TRUE)
)
# multi-membership model with level specific covariatevalues
dat$xc <- (dat$x1 + dat$x2) / 2
fit <- brm(y ~ xc + (1 + mmc(x1, x2) | mm(g1, g2)), data = dat)
summary(fit)
mo 109
## End(Not run)
```
MultiNormal The Multivariate Normal Distribution
#### Description
Density function and random generation for the multivariate normal distribution with mean vector
mu and covariance matrix Sigma.
#### Usage
<pre><code>
dmulti_normal(x, mu, Sigma, log = FALSE, check = FALSE)
rmulti_normal(n, mu, Sigma, check = FALSE)
</code></pre>
#### Arguments
* ``x``: Vector or matrix of quantiles. If x is a matrix, each row is taken to be a quantile.
mu Mean vector with length equal to the number of dimensions.
Sigma Covariance matrix.
log Logical; If TRUE,values are returned on the log scale.
check Logical; Indicates whether several input checks should be performed. Defaults
to FALSE to improve efficiency.
n Number of samples to draw from the distribution.
#### Details
See the Stan user’s manual http://mc-stan.org/documentation/ for #### Details on the parameterization
nsamples.brmsfit Number of Posterior Samples
#### Description
Extract the number of posterior samples stored in a fitted Bayesian model.
#### Usage
<pre><code>
## S3 method for class 'brmsfit'
nsamples(x, subset = NULL, incl_warmup = FALSE, ...)
nsamples(x, ...)
</code></pre>
#### Arguments
x An R object
subset An optional integer vector defining a subset of samples to be considered.
incl_warmup A flag indicating whether to also count warmup / burn-in samples.
* `` ... ``: Further arguments passed to or from other methods.
#### Details
Currently there are methods for brmsfit objects.
134 print.brmsprior
print.brmsfit Print a summary for a fitted model represented by a brmsfit object
#### Description
Print a summary for a fitted model represented by a brmsfit object
#### Usage
<pre><code>
## S3 method for class 'brmsfit'
print(x, digits = 2, ...)
</code></pre>
#### Arguments
x An object of class brmsfit
digits The number of significant digits for printing out the summary; defaults to 2. The
effective sample size is always rounded to integers.
* ``...``: Additional arguments
that would be passed to method summary of brmsfit.
Author(s)
Paul-Christian Buerkner <[email protected]>
print.brmsprior Print method for brmsprior objects
#### Description
Print method for brmsprior objects
#### Usage
<pre><code>
## S3 method for class 'brmsprior'
print(x, show_df, ...)
</code></pre>
#### Arguments
x An object of class brmsprior.
show_df Logical; Print priors as a single data.frame (TRUE) or as a sequence of sampling
statements (FALSE)?
... Currently ignored.
stancode.brmsfit Extract Stan model code
#### Description
Extract Stan model code
#### Usage
<pre><code>
## S3 method for class 'brmsfit'
stancode(object, version = TRUE, ...)
stancode(object, ...)
</code></pre>
#### Arguments
object An object of class brmsfit
version Logical; indicates if the first line containing the brms version number should be
included. Defaults to TRUE.
... Currently ignored
#### Value
Stan model code for further processing.
standata.brmsfit 151
standata.brmsfit Extract Data passed to Stan
#### Description
Extract all data that was used by Stan to fit the model
#### Usage
<pre><code>
## S3 method for class 'brmsfit'
standata(object, newdata = NULL, re_formula = NULL,
incl_autocor = TRUE, new_objects = list(), internal = FALSE,
control = list(), ...)
standata(object, ...)
</code></pre>
#### Arguments
object An object of class brmsfit.
newdata An optional data.frame for which to evaluate predictions. If NULL (default), the
original data of the model is used.
re_formula formula containing group-level effects to be considered in the prediction. If
NULL (default), include all group-level effects; if NA, include no group-level effects.
incl_autocor A flag indicating if ARMA autocorrelation parameters should be included in the
predictions. Defaults to TRUE. Setting it to FALSE will not affect other correlation
structures such as cor_bsts, or cor_fixed.
new_objects A named list of objects containing new data, which cannot be passed via argument
newdata. Currently, only required for objects passed to cor_sar and
cor_fixed.
internal Logical, indicates if the data should be prepared for internal use in other postprocessing
methods.
control A named list currently for internal
usage only.
... More Arguments passed to make_standata.
#### Value
A named list containing the data originally passed to Stan.
summary.brmsfit Create a summary of a fitted model represented by a brmsfit object
#### Description
Create a summary of a fitted model represented by a brmsfit object
#### Usage
<pre><code>
## S3 method for class 'brmsfit'
summary(object, priors = FALSE, prob = 0.95,
mc_se = FALSE, use_cache = TRUE, ...)
</code></pre>
#### Arguments
object An object of class brmsfit
priors Logical; Indicating if priors should be included in the summary. Default is
FALSE.
prob Avalue between 0 and 1 indicating the desired probability to be covered by the
uncertainty intervals. The default is 0.95.
mc_se Logical; Indicating if the uncertainty caused by the MCMC sampling should be
shown in the summary. Defaults to FALSE.
use_cache Logical; Indicating if summary results should be cached for future use by rstan.
Defaults to TRUE. For models fitted with earlier versions of brms, it may be necessary
to set use_cache to FALSE in order to get the summary method working
correctly.
... Other potential </code></pre>
#### Arguments
Author(s)
Paul-Christian Buerkner <[email protected]>
156 theme_black
theme_black Black Theme for ggplot2 Graphics
#### Description
A black theme for ggplot graphics inspired by a blog post of Jon Lefcheck (https://jonlefcheck.
net/2013/03/11/black-theme-for-ggplot2-2/).
#### Usage
<pre><code>
theme_black(base_size = 12, base_family = "")
</code></pre>
#### Arguments
base_size base font size
base_family base font family
#### Details
When using theme_black in plots powered by the bayesplot package such as pp_check or stanplot,
I recommend using the "viridisC" color scheme (see examples).
#### Value
A theme object used in ggplot2 graphics.
#### Examples
```{r}
## Not run:
# change default ggplot theme
theme_set(theme_black())
# change default bayesplot color scheme
bayesplot::color_scheme_set("viridisC")
# fit a simple model
fit <- brm(count ~ log_Age_c + log_Base4_c * Trt + (1|patient),
data = epilepsy, family = poisson(), chains = 2)
summary(fit)
# create various plots
plot(marginal_effects(fit), ask = FALSE)
pp_check(fit)
stanplot(fit, type = "hex", pars = c("b_Intercept", "b_Trt1"))
## End(Not run)
```
theme_default 157
theme_default Default bayesplot Theme for ggplot2 Graphics
#### Description
This theme is imported from the bayesplot package. See theme_default for a complete documentation.
</code></pre>
#### Arguments
base_size base font size
base_family base font family
#### Value
A theme object used in ggplot2 graphics.
vcov.brmsfit 161
vcov.brmsfit Covariance and Correlation Matrix of Population-Level Effects
#### Description
Get a point estimate of the covariance or correlation matrix of population-level parameters
#### Usage
<pre><code>
## S3 method for class 'brmsfit'
vcov(object, correlation = FALSE, pars = NULL, ...)
</code></pre>
#### Arguments
object An object of class brmsfit.
correlation Logical; if FALSE (the default), compute the covariance matrix, if TRUE, compute
the correlation matrix.
pars Optional names of coefficients to extract. By default, all coefficients are extracted.
... Currently ignored.
#### Details
Estimates are obtained by calculating the maximum likelihood covariances (correlations) of the
posterior samples.
#### Value
covariance or correlation matrix of population-level parameters
#### Examples
```{r}
## Not run:
fit <- brm(count ~ log_Age_c + log_Base4_c * Trt_c + (1+Trt_c|visit),
data = epilepsy, family = gaussian(), chains = 2)
vcov(fit)
## End(Not run)
```
waic.brmsfit Compute the WAIC
#### Description
Compute the widely applicable information criterion (WAIC) based on the posterior likelihood
using the loo package. for more details see waic
#### Usage
<pre><code>
## S3 method for class 'brmsfit'
waic(x, ..., compare = TRUE, resp = NULL,
pointwise = FALSE, model_names = NULL)
waic.brmsfit 163
</code></pre>
#### Arguments
x A fitted model object.
... More fitted model objects or further arguments passed to the underlying postprocessing
functions.
compare A flag indicating if the information criteria of the models should be compared
to each other via compare_ic.
* `` resp``: Optional names of response variables. If specified, predictions are performed
only for the specified response variables.
pointwise A flag indicating whether to compute the full log-likelihood matrix at once or
separately for each observation. The latter approach is usually considerably
slower but requires much less working memory. Accordingly, if one runs into
memory issues, pointwise = TRUE is the way to go.
model_names If NULL (the default) will use model names derived from deparsing the call. Otherwise
will use the passed values as model names.
#### Details
When comparing models fitted to the same data, the smaller the WAIC, the better the fit. For
brmsfit objects, WAIC is an alias of waic. Use method add_ic to store information criteria in the
fitted model object for later
#### Usage
<pre><code>.
#### Value
If just one object is provided, an object of class ic. If multiple objects are provided, an object of
class iclist.
Author(s)
Paul-Christian Buerkner <[email protected]>
References
Vehtari, A., Gelman, A., & Gabry J. (2016). Practical Bayesian model evaluation using leaveone-
out cross-validation and WAIC. In Statistics and Computing, doi:10.1007/s11222-016-9696-4.
arXiv preprint arXiv:1507.04544.
Gelman, A., Hwang, J., & Vehtari, A. (2014). Understanding predictive information criteria for
Bayesian models. Statistics and Computing, 24, 997-1016.
Watanabe, S. (2010). Asymptotic equivalence of Bayes cross validation and widely applicable
information criterion in singular learning theory. The Journal of Machine Learning Research, 11,
3571-3594.
#### Examples
```{r}
## Not run:
# model with population-level effects only
fit1 <- brm(rating ~ treat + period + carry,
data = inhaler, family = "gaussian")
164 Wiener
waic(fit1)
# model with an additional varying intercept for subjects
fit2 <- brm(rating ~ treat + period + carry + (1|subject),
data = inhaler, family = "gaussian")
# compare both models
waic(fit1, fit2)
## End(Not run)
```
Index
Topic datasets
epilepsy, 56
inhaler, 74
kidney, 82
acat (brmsfamily), 21
add_ic, 8, 42, 89, 163
add_ic<- (add_ic), 8
add_loo (add_ic), 8
add_waic (add_ic), 8
addition-terms, 6
as.array.brmsfit
(posterior_samples.brmsfit),
121
as.data.frame, 121
as.data.frame.brmsfit
(posterior_samples.brmsfit),
121
as.matrix.brmsfit, 120
as.matrix.brmsfit
(posterior_samples.brmsfit),
121
as.mcmc (as.mcmc.brmsfit), 9
as.mcmc.brmsfit, 9
asym_laplace (brmsfamily), 21
AsymLaplace, 10
autocor, 11
bayes_factor, 5, 14, 125
bayes_factor (bayes_factor.brmsfit), 11
bayes_factor.brmsfit, 11
bayes_R2, 26
bayes_R2 (bayes_R2.brmsfit), 12
bayes_R2.brmsfit, 12
bayesplot, 5, 128
bernoulli (brmsfamily), 21
Beta (brmsfamily), 21
bf (brmsformula), 26
bf-helpers (brmsformula-helpers), 34
binomial, 25
bridge_sampler, 11, 12, 26, 125
bridge_sampler
(bridge_sampler.brmsfit), 14
bridge_sampler.brmsfit, 14
bridge_sampler.stanfit, 14
bridgesampling:bayes_factor, 12
bridgesampling:bridge_sampler, 14
bridgesampling:post_prob, 125
brm, 5–7, 15, 25–27, 39, 51, 70, 106, 117, 146,
147, 157
brm_multiple, 29, 37
brms, 19, 25, 26
brms (brms-package), 5
brms-package, 5
brmsfamily, 6, 16, 18, 19, 21, 25, 26, 32, 38,
53, 54, 65, 94, 96, 105, 116
brmsfit, 6, 19
brmsfit (brmsfit-class), 25
brmsfit-class, 25
brmsformula, 5–7, 16, 18, 19, 24–26, 26, 34,
36, 38, 52, 65, 67, 68, 94, 96, 103,
104, 106, 107, 109, 113, 116, 117,
142, 144, 157
brmsformula-helpers, 34
brmshypothesis, 36, 73
brmsprior, 26
brmsprior (set_prior), 143
brmsprior-class (set_prior), 143
cat, 18, 95
categorical (brmsfamily), 21
cbind, 108
coef.brmsfit, 40, 72
combine_models, 39, 41
compare, 42
compare_ic, 41, 80, 88, 163
control_params
(control_params.brmsfit), 42
control_params.brmsfit, 42
cor_ar, 43, 45, 47
166
INDEX 167
cor_arma, 44, 44, 46, 47, 51
cor_arma-class (cor_arma), 44
cor_arr, 45, 45, 47
cor_brms, 16, 26, 38, 46, 65, 94, 96, 116
cor_brms-class (cor_brms), 46
cor_bsts, 47, 47, 59, 151, 159
cor_bsts-class (cor_bsts), 47
cor_car, 47, 48
cor_errorsar (cor_sar), 51
cor_fixed, 47, 49, 59, 60, 151, 159
cor_icar (cor_car), 48
cor_lagsar (cor_sar), 51
cor_ma, 45, 47, 50
cor_sar, 47, 51, 60, 151
cov_fixed (cor_fixed), 49
cratio (brmsfamily), 21
cs, 52
cse (cs), 52
cumulative (brmsfamily), 21
custom_family, 21, 53
customfamily, 25
customfamily (custom_family), 53
dasym_laplace (AsymLaplace), 10
density, 55
density_ratio, 55
dexgaussian (ExGaussian), 57
dfrechet (Frechet), 63
dgen_extreme_#### Value (GenExtreme#### Value), 64
dhurdle_gamma (Hurdle), 71
dhurdle_lognormal (Hurdle), 71
dhurdle_negbinomial (Hurdle), 71
dhurdle_poisson (Hurdle), 71
diagnostic-quantities
(log_posterior.brmsfit), 87
dinv_gaussian (InvGaussian), 75
dmulti_normal (MultiNormal), 111
dmulti_student_t (MultiStudentT), 112
dshifted_lnorm (Shifted_Lognormal), 148
dskew_normal (SkewNormal), 149
dstudent_t (StudentT), 154
dvon_mises (VonMises), 162
dwiener (Wiener), 164
dzero_inflated_beta (ZeroInflated), 165
dzero_inflated_binomial (ZeroInflated),
165
dzero_inflated_negbinomial
(ZeroInflated), 165
dzero_inflated_poisson (ZeroInflated),
165
E_loo, 91
environment, 54
epilepsy, 56
ExGaussian, 57
exgaussian (brmsfamily), 21
exponential (brmsfamily), 21
expose_functions
(expose_functions.brmsfit), 58
expose_functions.brmsfit, 58
expose_stan_functions, 58
expp1, 58
extract_draws, 61, 86, 129, 132, 140
extract_draws (extract_draws.brmsfit),
59
extract_draws.brmsfit, 59
family, 21, 25
fitted, 13, 54, 91, 92, 99, 130
fitted.brmsfit, 60
fixef (fixef.brmsfit), 62
fixef.brmsfit, 40, 62
formula, 16, 38, 65, 94, 96, 116
Frechet, 63
frechet (brmsfamily), 21
future, 17
gam, 28
gamm, 16, 28, 38, 96, 146
Gamma, 25
gen_extreme_#### Value (brmsfamily), 21
GenExtreme#### Value, 64
geom_contour, 99
geom_errorbar, 99
geom_jitter, 99
geom_point, 99
geom_raster, 99
geom_rug, 99
geom_smooth, 99
geometric (brmsfamily), 21
get_prior, 16, 18, 38, 65, 94, 96, 147
ggplot, 100, 152
ggtheme, 37, 100, 118
gp, 28, 66, 146
gr, 68
gtable, 118
horseshoe, 69, 145
168 INDEX
Hurdle, 71
hurdle_gamma (brmsfamily), 21
hurdle_lognormal (brmsfamily), 21
hurdle_negbinomial (brmsfamily), 21
hurdle_poisson (brmsfamily), 21
hypothesis, 16, 36–38, 95, 96
hypothesis (hypothesis.brmsfit), 72
hypothesis.brmsfit, 72
inhaler, 74
inv_logit_scaled, 76
InvGaussian, 75
is.brmsfit, 76
is.brmsfit_multiple, 77
is.brmsformula, 77
is.brmsprior, 77
is.brmsterms, 78
is.cor_arma (is.cor_brms), 78
is.cor_brms, 78
is.cor_bsts (is.cor_brms), 78
is.cor_car (is.cor_brms), 78
is.cor_fixed (is.cor_brms), 78
is.cor_sar (is.cor_brms), 78
is.mvbrmsformula, 79
is.mvbrmsterms, 79
kfold, 139
kfold (kfold.brmsfit), 80
kfold-helpers, 81
kfold.brmsfit, 80
kidney, 82
lasso, 83, 145
launch_shinystan, 84, 152
launch_shinystan
(launch_shinystan.brmsfit), 84
launch_shinystan.brmsfit, 84
lf (brmsformula-helpers), 34
log_lik, 54, 91, 92
log_lik (log_lik.brmsfit), 86
log_lik.brmsfit, 86
log_posterior (log_posterior.brmsfit),
87
log_posterior.brmsfit, 87
logit_scaled, 85
logLik.brmsfit (log_lik.brmsfit), 86
logm1, 85
lognormal (brmsfamily), 21
LOO (loo.brmsfit), 88
loo, 5, 26, 41, 42, 81, 86, 88, 138, 139
loo (loo.brmsfit), 88
LOO.brmsfit (loo.brmsfit), 88
loo.brmsfit, 88
loo::kfold_split_balanced, 81
loo::kfold_split_stratified, 81
loo::loo_model_weights, 90
loo_linpred (loo_predict.brmsfit), 91
loo_model_weights, 110, 119, 126
loo_model_weights
(loo_model_weights.brmsfit), 90
loo_model_weights.brmsfit, 90
loo_predict (loo_predict.brmsfit), 91
loo_predict.brmsfit, 91
loo_predictive_interval
(loo_predict.brmsfit), 91
loo_R2 (loo_R2.brmsfit), 92
loo_R2.brmsfit, 92
make_conditions, 93, 98, 142
make_stancode, 5, 94
make_standata, 5, 95, 151
marginal_effects, 5, 93, 102, 142
marginal_effects
(marginal_effects.brmsfit), 97
marginal_effects.brmsfit, 97
marginal_smooths
(marginal_smooths.brmsfit), 101
marginal_smooths.brmsfit, 101
MCMC, 117
mcmc_combo, 118
mcmc_pairs, 115
me, 35, 103
mgcv::s, 142
mgcv::t2, 142
mi, 29, 104
mixture, 32, 105
mm, 28, 107, 108
mmc, 107, 108
mo, 109
model_weights, 119, 126, 127
model_weights (model_weights.brmsfit),
110
model_weights.brmsfit, 110
mono (mo), 109
monotonic (mo), 109
MultiNormal, 111
MultiStudentT, 112
mvbf, 32
INDEX 169
mvbf (mvbrmsformula), 112
mvbrmsformula, 16, 33, 36, 38, 65, 94, 96,
112, 116, 117
neff_ratio (log_posterior.brmsfit), 87
negbinomial (brmsfamily), 21
ngrps (ngrps.brmsfit), 113
ngrps.brmsfit, 113
nlf (brmsformula-helpers), 34
nsamples (nsamples.brmsfit), 114
nsamples.brmsfit, 114
nuts_params (log_posterior.brmsfit), 87
pairs, 114
pairs.brmsfit, 114
par.names (parnames), 115
pareto_k_ids, 88, 138
parnames, 72, 115
parse_bf, 78, 79, 116
pasym_laplace (AsymLaplace), 10
pexgaussian (ExGaussian), 57
pfrechet (Frechet), 63
pgen_extreme_#### Value (GenExtreme#### Value), 64
phurdle_gamma (Hurdle), 71
phurdle_lognormal (Hurdle), 71
phurdle_negbinomial (Hurdle), 71
phurdle_poisson (Hurdle), 71
pinv_gaussian (InvGaussian), 75
plan, 18
plot.brmsfit, 117
plot.brmshypothesis (brmshypothesis), 36
plot.brmsMarginalEffects
(marginal_effects.brmsfit), 97
post_prob, 12, 14, 110, 119, 126
post_prob (post_prob.brmsfit), 124
post_prob.brmsfit, 124
posterior.samples
(posterior_samples.brmsfit),
121
posterior_average, 127
posterior_average
(posterior_average.brmsfit),
118
posterior_average.brmsfit, 118
posterior_interval
(posterior_interval.brmsfit),
120
posterior_interval.brmsfit, 120
posterior_linpred, 61
posterior_linpred (fitted.brmsfit), 60
posterior_predict, 133
posterior_predict (predict.brmsfit), 130
posterior_samples
(posterior_samples.brmsfit),
121
posterior_samples.brmsfit, 121
posterior_summary
(posterior_summary.brmsfit),
122
posterior_summary.brmsfit, 122
posterior_table, 123
pp_average, 119
pp_average (pp_average.brmsfit), 125
pp_average.brmsfit, 125
pp_check, 5
pp_check (pp_check.brmsfit), 127
pp_check.brmsfit, 127
pp_mixture (pp_mixture.brmsfit), 128
pp_mixture.brmsfit, 128
PPC, 127, 128
predict, 54, 60, 91, 99
predict.brmsfit, 128, 130
predictive_error (residuals.brmsfit),
139
predictive_interval
(predictive_interval.brmsfit),
133
predictive_interval.brmsfit, 133
print.brmsfit, 134
print.brmshypothesis (brmshypothesis),
36
print.brmsprior, 134
print.brmssummary (print.brmsfit), 134
print.default, 37
prior (set_prior), 143
prior_ (set_prior), 143
prior_samples (prior_samples.brmsfit),
135
prior_samples.brmsfit, 135
prior_string (set_prior), 143
prior_summary (prior_summary.brmsfit),
136
prior_summary.brmsfit, 136
pshifted_lnorm (Shifted_Lognormal), 148
psis, 91
pskew_normal (SkewNormal), 149
pstudent_t (StudentT), 154
170 INDEX
pvon_mises (VonMises), 162
pzero_inflated_beta (ZeroInflated), 165
pzero_inflated_binomial (ZeroInflated),
165
pzero_inflated_negbinomial
(ZeroInflated), 165
pzero_inflated_poisson (ZeroInflated),
165
qasym_laplace (AsymLaplace), 10
qfrechet (Frechet), 63
qshifted_lnorm (Shifted_Lognormal), 148
qskew_normal (SkewNormal), 149
qstudent_t (StudentT), 154
ranef (ranef.brmsfit), 137
ranef.brmsfit, 40, 72, 137
rasym_laplace (AsymLaplace), 10
reloo, 81, 88, 138
residuals.brmsfit, 139
resp_cat (addition-terms), 6
resp_cens (addition-terms), 6
resp_dec (addition-terms), 6
resp_mi (addition-terms), 6
resp_se (addition-terms), 6
resp_trials (addition-terms), 6
resp_trunc (addition-terms), 6
resp_weights (addition-terms), 6
restructure, 141
rexgaussian (ExGaussian), 57
rfrechet (Frechet), 63
rgen_extreme_#### Value (GenExtreme#### Value), 64
rhat (log_posterior.brmsfit), 87
rinv_gaussian (InvGaussian), 75
rmulti_normal (MultiNormal), 111
rmulti_student_t (MultiStudentT), 112
rows2labels, 93, 141
rshifted_lnorm (Shifted_Lognormal), 148
rskew_normal (SkewNormal), 149
rstudent_t (StudentT), 154
runApp, 84
rvon_mises (VonMises), 162
rwiener (Wiener), 164
s, 28, 142
sampling, 18
saveRDS, 8, 18, 39
scale_colour_gradient, 100
scale_colour_grey, 100
set.seed, 72, 119, 126
set_mecor (brmsformula-helpers), 34
set_nl (brmsformula-helpers), 34
set_prior, 16, 18, 30, 31, 38, 65, 70, 84, 94,
96, 106, 143
set_rescor (brmsformula-helpers), 34
Shifted_Lognormal, 148
shifted_lognormal (brmsfamily), 21
skew_normal (brmsfamily), 21
SkewNormal, 149
sratio (brmsfamily), 21
Stan, 5
stan, 17, 19, 43
stan_model, 18
stancode (stancode.brmsfit), 150
stancode.brmsfit, 150
standata (standata.brmsfit), 151
standata.brmsfit, 151
stanfit, 26
stanplot, 5
stanplot (stanplot.brmsfit), 152
stanplot.brmsfit, 152
stanvar, 16, 38, 53, 54, 95, 96, 153
stanvars, 26
stanvars (stanvar), 153
student (brmsfamily), 21
StudentT, 154
summary, 5
summary.brmsfit, 155
t2, 28
t2 (s), 142
TDist, 155
theme, 37, 100, 118
theme_black, 156
theme_default, 37, 100, 118, 157, 157
update, 17
update.brmsfit, 138, 157
update.formula, 157
update_adterms, 158
validate_newdata, 60, 159
VarCorr, 160
VarCorr (VarCorr.brmsfit), 160
VarCorr.brmsfit, 160
vb, 18
vcov.brmsfit, 161
Vectorize, 58
INDEX 171
von_mises (brmsfamily), 21
VonMises, 162
WAIC, 41, 42
WAIC (waic.brmsfit), 162
waic, 5, 26, 86, 162
waic (waic.brmsfit), 162
WAIC.brmsfit (waic.brmsfit), 162
waic.brmsfit, 162
weibull (brmsfamily), 21
Wiener, 164
wiener (brmsfamily), 21
wienerdist, 164
zero_inflated_beta (brmsfamily), 21
zero_inflated_binomial (brmsfamily), 21
zero_inflated_negbinomial (brmsfamily),
21
zero_inflated_poisson (brmsfamily), 21
zero_one_inflated_beta (brmsfamily), 21
ZeroInflated, 165