-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrmsfamily.Rmd
94 lines (89 loc) · 5.2 KB
/
brmsfamily.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
---
title: "brms"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(brms)
```
brmsfamily Special Family Functions for brms Models
#### Description
Family objects provide a convenient way to specify the #### Details of the models used by many model fitting functions. The family functions presented here are for use with brms only and will **not** work with other model fitting functions such as glm or glmer. However, the standard family functions as described in family will work with brms. You can also specify custom families for use in brms with the custom_family function.
#### Usage
<pre><code>
brmsfamily(family, link = NULL, link_sigma = "log",
link_shape = "log", link_nu = "logm1", link_phi = "log",
link_kappa = "log", link_beta = "log", link_zi = "logit",
link_hu = "logit", link_zoi = "logit", link_coi = "logit",
link_disc = "log", link_bs = "log", link_ndt = "log",
link_bias = "logit", link_xi = "log1p", link_alpha = "identity",
link_quantile = "logit", threshold = c("flexible", "equidistant"))
student(link = "identity", link_sigma = "log", link_nu = "logm1")
bernoulli(link = "logit")
negbinomial(link = "log", link_shape = "log")
geometric(link = "log")
lognormal(link = "identity", link_sigma = "log")
shifted_lognormal(link = "identity", link_sigma = "log",
link_ndt = "log")
skew_normal(link = "identity", link_sigma = "log", link_alpha = "identity")
exponential(link = "log")
weibull(link = "log", link_shape = "log")
frechet(link = "log", link_nu = "logm1")
gen_extreme_value(link = "identity", link_sigma = "log",
link_xi = "log1p")
exgaussian(link = "identity", link_sigma = "log", link_beta = "log")
wiener(link = "identity", link_bs = "log", link_ndt = "log", link_bias = "logit")
Beta(link = "logit", link_phi = "log")
von_mises(link = "tan_half", link_kappa = "log")
asym_laplace(link = "identity", link_sigma = "log", link_quantile = "logit")
hurdle_poisson(link = "log")
hurdle_negbinomial(link = "log", link_shape = "log",link_hu = "logit")
hurdle_gamma(link = "log", link_shape = "log", link_hu = "logit")
hurdle_lognormal(link = "identity", link_sigma = "log", link_hu = "logit")
zero_inflated_beta(link = "logit", link_phi = "log", link_zi = "logit")
zero_one_inflated_beta(link = "logit", link_phi = "log", link_zoi = "logit", link_coi = "logit")
zero_inflated_poisson(link = "log", link_zi = "logit")
zero_inflated_negbinomial(link = "log", link_shape = "log", link_zi = "logit")
zero_inflated_binomial(link = "logit", link_zi = "logit")
categorical(link = "logit")
cumulative(link = "logit", link_disc = "log", threshold = c("flexible", "equidistant"))
sratio(link = "logit", link_disc = "log", threshold = c("flexible", "equidistant"))
cratio(link = "logit", link_disc = "log", threshold = c("flexible", "equidistant"))
acat(link = "logit", link_disc = "log", threshold = c("flexible", "equidistant"))
</code></pre>
#### Arguments
* family A character string naming the distribution of the response variable be used in the model. Currently, the following families are supported: gaussian, student, binomial, bernoulli, poisson, negbinomial, geometric, Gamma, skew_normal,
lognormal, shifted_lognormal, exgaussian, wiener, inverse.gaussian,
exponential, weibull, frechet, Beta, von_mises, asym_laplace, gen_extreme_#### Value,
categorical, cumulative, cratio, sratio, acat, hurdle_poisson, hurdle_negbinomial,
hurdle_gamma, hurdle_lognormal, zero_inflated_binomial, zero_inflated_beta,
zero_inflated_negbinomial, zero_inflated_poisson, and zero_one_inflated_beta.
* link A specification for the model link function. This can be a name/expression or character string. See the ’#### Details’ section for more information on link functions supported by each family.
* link_sigma Link of auxiliary parameter sigma if being predicted.
* link_shape Link of auxiliary parameter shape if being predicted.
* link_nu Link of auxiliary parameter nu if being predicted.
* link_phi Link of auxiliary parameter phi if being predicted.
* link_kappa Link of auxiliary parameter kappa if being predicted.
* link_beta Link of auxiliary parameter beta if being predicted.
* link_zi Link of auxiliary parameter zi if being predicted.
* link_hu Link of auxiliary parameter hu if being predicted.
* link_zoi Link of auxiliary parameter zoi if being predicted.
* link_coi Link of auxiliary parameter coi if being predicted.
* link_disc Link of auxiliary parameter disc if being predicted.
* link_bs Link of auxiliary parameter bs if being predicted.
* link_ndt Link of auxiliary parameter ndt if being predicted.
* link_bias Link of auxiliary parameter bias if being predicted.
* link_xi Link of auxiliary parameter xi if being predicted.
* link_alpha Link of auxiliary parameter alpha if being predicted.
* link_quantile Link of auxiliary parameter quantile if being predicted.
* threshold A character string indicating the type of thresholds (i.e. intercepts) used in an ordinal model. "flexible" provides the standard unstructured thresholds and "equidistant" restricts the distance between consecutive thresholds to the
same value.
#### Examples
```{r}
# create a family object
(fam1 <- student("log"))
# alternatively use the brmsfamily function
(fam2 <- brmsfamily("student", "log"))
# both leads to the same object
identical(fam1, fam2)
```