Skip to content

Commit 8786fc1

Browse files
authored
Merge pull request #788 from stan-dev/fix-terminology
Improve docs with respect to statistical terminology
2 parents 190a7c3 + 21bdbd9 commit 8786fc1

31 files changed

+244
-242
lines changed

src/functions-reference/binary_distributions.qmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ If $\theta \in [0,1]$, then for $y \in \{0,1\}$,
2121
\end{array} \right.
2222
\end{equation*}
2323

24-
### Sampling statement
24+
### Distribution statement
2525

2626
`y ~ ` **`bernoulli`**`(theta)`
2727

@@ -101,7 +101,7 @@ If $\alpha \in \mathbb{R}$, then for $y \in \{0,1\}$,
101101
\text{logit}^{-1}(\alpha) & \text{if } y = 0. \end{array} \right.
102102
\end{equation*}
103103

104-
### Sampling statement
104+
### Distribution statement
105105

106106
`y ~ ` **`bernoulli_logit`**`(alpha)`
107107

@@ -142,10 +142,10 @@ quantities blocks. For a description of argument and return types, see section
142142
## Bernoulli-logit generalized linear model (Logistic Regression) {#bernoulli-logit-glm}
143143

144144
Stan also supplies a single function for a generalized linear model
145-
with Bernoulli likelihood and logit link function, i.e. a function
145+
with Bernoulli distribution and logit link function, i.e. a function
146146
for a logistic regression. This provides a more efficient
147147
implementation of logistic regression than a manually written
148-
regression in terms of a Bernoulli likelihood and matrix
148+
regression in terms of a Bernoulli distribution and matrix
149149
multiplication.
150150

151151
### Probability mass function
@@ -160,7 +160,7 @@ n}\text{Bernoulli}(y_i~|~\text{logit}^{-1}(\alpha_i + x_i\cdot
160160
\sum_{1\leq j\leq m}x_{ij}\cdot \beta_j) & \text{if } y_i = 0.
161161
\end{array} \right. \end{align*}
162162

163-
### Sampling statement
163+
### Distribution statement
164164

165165
`y ~ ` **`bernoulli_logit_glm`**`(x, alpha, beta)`
166166

src/functions-reference/bounded_continuous_distributions.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ If $\alpha \in \mathbb{R}$ and $\beta \in (\alpha,\infty)$, then for
1818
$y \in [\alpha,\beta]$, \begin{equation*} \text{Uniform}(y|\alpha,\beta) =
1919
\frac{1}{\beta - \alpha} . \end{equation*}
2020

21-
### Sampling statement
21+
### Distribution statement
2222

2323
`y ~ ` **`uniform`**`(alpha, beta)`
2424

src/functions-reference/bounded_discrete_distributions.qmd

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Suppose $N \in \mathbb{N}$ and $\theta \in [0,1]$, and $n \in
2929
\begin{equation*} \frac{\partial}{\partial \theta} \log \text{Binomial}(n~|~N,\theta)
3030
= \frac{n}{\theta} - \frac{N - n}{1 - \theta} \end{equation*}
3131

32-
### Sampling statement
32+
### Distribution statement
3333

3434
`n ~ ` **`binomial`**`(N, theta)`
3535

@@ -120,7 +120,7 @@ Suppose $N \in \mathbb{N}$, $\alpha \in \mathbb{R}$, and $n \in
120120
\frac{n}{\text{logit}^{-1}(-\alpha)} - \frac{N -
121121
n}{\text{logit}^{-1}(\alpha)} \end{equation*}
122122

123-
### Sampling statement
123+
### Distribution statement
124124

125125
`n ~ ` **`binomial_logit`**`(N, alpha)`
126126

@@ -150,10 +150,10 @@ logit-scaled chance of success alpha dropping constant additive terms
150150
## Binomial-logit generalized linear model (Logistic Regression) {#binomial-logit-glm}
151151

152152
Stan also supplies a single function for a generalized linear model
153-
with binomial likelihood and logit link function, i.e., a function
153+
with binomial distribution and logit link function, i.e., a function
154154
for logistic regression with aggregated outcomes. This provides a more efficient
155155
implementation of logistic regression than a manually written
156-
regression in terms of a Binomial likelihood and matrix
156+
regression in terms of a binomial distribution and matrix
157157
multiplication.
158158

159159
### Probability mass function
@@ -165,7 +165,7 @@ Suppose $N \in \mathbb{N}$, $x\in \mathbb{R}^{n\cdot m}, \alpha \in \mathbb{R}^n
165165
&= \binom{N}{n} \left( \text{logit}^{-1}(\alpha_i + \sum_{1\leq j\leq m}x_{ij}\cdot \beta_j) \right)^{n} \left( 1 - \text{logit}^{-1}(\alpha_i + \sum_{1\leq j\leq m}x_{ij}\cdot \beta_j) \right)^{N - n}.
166166
\end{align*}
167167

168-
### Sampling statement
168+
### Distribution statement
169169

170170
`n ~ ` **`binomial_logit_glm`**`(N, x, alpha, beta)`
171171

@@ -286,7 +286,7 @@ If $N \in \mathbb{N}$, $\alpha \in \mathbb{R}^+$, and $\beta \in
286286
\mathbb{R}^+$ and $v \in \mathbb{R}^+$ by \begin{equation*} \mathrm{B}(u,v) =
287287
\frac{\Gamma(u) \ \Gamma(v)}{\Gamma(u + v)}. \end{equation*}
288288

289-
### Sampling statement
289+
### Distribution statement
290290

291291
`n ~ ` **`beta_binomial`**`(N, alpha, beta)`
292292

@@ -362,7 +362,7 @@ If $a \in \mathbb{N}$, $b \in \mathbb{N}$, and $N \in
362362
\begin{equation*} \text{Hypergeometric}(n~|~N,a,b) = \frac{\normalsize{\binom{a}{n}
363363
\binom{b}{N - n}}} {\normalsize{\binom{a + b}{N}}}. \end{equation*}
364364

365-
### Sampling statement
365+
### Distribution statement
366366

367367
`n ~ ` **`hypergeometric`**`(N, a, b)`
368368

@@ -411,7 +411,7 @@ distribution, \begin{equation*} \text{CategoricalLogit}(y~|~\beta) =
411411
\text{Categorical}(y~|~\text{softmax}(\beta)). \end{equation*}
412412
See [the definition of softmax](matrix_operations.qmd#softmax) for the definition of the softmax function.
413413

414-
### Sampling statement
414+
### Distribution statement
415415

416416
`y ~ ` **`categorical`**`(theta)`
417417

@@ -421,7 +421,7 @@ dropping constant additive terms.
421421
<!-- real; categorical ~; -->
422422
\index{{\tt \bfseries categorical }!sampling statement|hyperpage}
423423

424-
### Sampling statement
424+
### Distribution statement
425425

426426
`y ~ ` **`categorical_logit`**`(beta)`
427427

@@ -492,10 +492,10 @@ quantities blocks
492492
## Categorical logit generalized linear model (softmax regression) {#categorical-logit-glm}
493493

494494
Stan also supplies a single function for a generalized linear model
495-
with categorical likelihood and logit link function, i.e. a function
495+
with categorical distribution and logit link function, i.e. a function
496496
for a softmax regression. This provides a more efficient
497497
implementation of softmax regression than a manually written
498-
regression in terms of a Categorical likelihood and matrix
498+
regression in terms of a categorical distribution and matrix
499499
multiplication.
500500

501501
Note that the implementation does not put any restrictions on the coefficient
@@ -515,7 +515,7 @@ If $N,M,K \in \mathbb{N}$, $N,M,K > 0$, and if $x\in \mathbb{R}^{M\times K}, \al
515515
\end{equation*}
516516
See [the definition of softmax](matrix_operations.qmd#softmax) for the definition of the softmax function.
517517

518-
### Sampling statement
518+
### Distribution statement
519519

520520
`y ~ ` **`categorical_logit_glm`**`(x, alpha, beta)`
521521

@@ -604,7 +604,7 @@ If $l, u \in \mathbb{Z}$ are lower and upper bounds ($l \le u$), then for
604604
any integer $y \in \{l,\ldots,u\}$, \begin{equation*} \text{DiscreteRange}(y ~|~ l, u) =
605605
\frac{1}{u - l + 1}. \end{equation*}
606606

607-
### Sampling statement
607+
### Distribution statement
608608

609609
`y ~ ` **`discrete_range`**`(l, u)`
610610

@@ -688,7 +688,7 @@ subsumed into the general definition by setting $c_0 = -\infty$ and
688688
$c_K = +\infty$ with $\text{logit}^{-1}(-\infty) = 0$ and
689689
$\text{logit}^{-1}(\infty) = 1$.
690690

691-
### Sampling statement
691+
### Distribution statement
692692

693693
`k ~ ` **`ordered_logistic`**`(eta, c)`
694694

@@ -747,7 +747,7 @@ subsumed into the general definition by setting $c_0 = -\infty$ and
747747
$c_K = +\infty$ with $\text{logit}^{-1}(-\infty) = 0$ and
748748
$\text{logit}^{-1}(\infty) = 1$.
749749

750-
### Sampling statement
750+
### Distribution statement
751751

752752
`y ~ ` **`ordered_logistic_glm`**`(x, beta, c)`
753753

@@ -844,7 +844,7 @@ cases can be subsumed into the general definition by setting $c_0 =
844844
-\infty$ and $c_K = +\infty$ with $\Phi(-\infty) = 0$ and
845845
$\Phi(\infty) = 1$.
846846

847-
### Sampling statement
847+
### Distribution statement
848848

849849
`k ~ ` **`ordered_probit`**`(eta, c)`
850850

src/functions-reference/circular_distributions.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ For $\kappa = 0$, the Von Mises distribution corresponds to the
3636
circular uniform distribution with density $1 / (2 \pi)$ (independently
3737
of the values of $y$ or $\mu$).
3838

39-
### Sampling statement
39+
### Distribution statement
4040

4141
`y ~ ` **`von_mises`**`(mu, kappa)`
4242

src/functions-reference/continuous_distributions_on_0_1.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ is 0 and the log probability is $-\infty$. Similarly, the
2323
distribution requires strictly positive parameters, $\alpha, \beta >
2424
0$.
2525

26-
### Sampling statement
26+
### Distribution statement
2727

2828
`theta ~ ` **`beta`**`(alpha, beta)`
2929

@@ -104,7 +104,7 @@ is 0 and the log probability is $-\infty$. Similarly, the
104104
distribution requires $\mu \in (0, 1)$ and strictly positive
105105
parameter, $\kappa > 0$.
106106

107-
### Sampling statement
107+
### Distribution statement
108108

109109
`theta ~ ` **`beta_proportion`**`(mu, kappa)`
110110

src/functions-reference/correlation_matrix_distributions.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ much better computationally to work directly with the Cholesky factor
5454
of $\Sigma$, so this distribution should never be explicitly used in
5555
practice.
5656

57-
### Sampling statement
57+
### Distribution statement
5858

5959
`y ~ ` **`lkj_corr`**`(eta)`
6060

@@ -132,7 +132,7 @@ A lower triangular $L$ is a Cholesky factor for a correlation matrix
132132
if and only if $L_{k,k} > 0$ for $k \in 1{:}K$ and each row $L_k$ has
133133
unit Euclidean length.
134134

135-
### Sampling statement
135+
### Distribution statement
136136

137137
`L ~ ` **`lkj_corr_cholesky`**`(eta)`
138138

src/functions-reference/covariance_matrix_distributions.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Gamma function,
2929
\Gamma_K(x) = \frac{1}{\pi^{K(K-1)/4}} \ \prod_{k=1}^K \Gamma \left( x + \frac{1 - k}{2} \right) \!.
3030
\end{equation*}
3131

32-
### Sampling statement
32+
### Distribution statement
3333

3434
`W ~ ` **`wishart`**`(nu, Sigma)`
3535

@@ -143,7 +143,7 @@ for symmetric and positive-definite $W \in \mathbb{R}^{K \times K}$,
143143
\ \exp \! \left( - \frac{1}{2} \ \text{tr}(SW^{-1}) \right) \! .
144144
\end{equation*}
145145

146-
### Sampling statement
146+
### Distribution statement
147147

148148
`W ~ ` **`inv_wishart`**`(nu, Sigma)`
149149

src/functions-reference/distributions_over_unbounded_vectors.qmd

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ for $y \in \mathbb{R}^K$,
2424
\end{equation*}
2525
where $|\Sigma|$ is the absolute determinant of $\Sigma$.
2626

27-
### Sampling statement
27+
### Distribution statement
2828

2929
`y ~ ` **`multi_normal`**`(mu, Sigma)`
3030

@@ -158,7 +158,7 @@ If $K \in \mathbb{N}$, $\mu \in \mathbb{R}^K$, and $\Omega \in
158158
for $y \in \mathbb{R}^K$, \begin{equation*} \text{MultiNormalPrecision}(y|\mu,\Omega)
159159
= \text{MultiNormal}(y|\mu,\Omega^{-1}) \end{equation*}
160160

161-
### Sampling statement
161+
### Distribution statement
162162

163163
`y ~ ` **`multi_normal_prec`**`(mu, Omega)`
164164

@@ -251,7 +251,7 @@ must be strictly positive for $k \in 1{:}K$. If an $L$ is provided
251251
that is not the Cholesky factor of a positive-definite matrix, the
252252
probability functions will raise errors.
253253

254-
### Sampling statement
254+
### Distribution statement
255255

256256
`y ~ ` **`multi_normal_cholesky`**`(mu, L)`
257257

@@ -384,7 +384,7 @@ with multi-variate outputs where only the output dimensions share a
384384
kernel function but vary based on their scale. Note that this
385385
function does not take into account the mean prediction.
386386

387-
### Sampling statement
387+
### Distribution statement
388388

389389
`y ~ ` **`multi_gp`**`(Sigma, w)`
390390

@@ -429,7 +429,7 @@ factor of the kernel matrix, this distribution is also more efficient
429429
than $\text{MultiGP}()$. Note that this function does not take into
430430
account the mean prediction.
431431

432-
### Sampling statement
432+
### Distribution statement
433433

434434
`y ~ ` **`multi_gp_cholesky`**`(L, w)`
435435

@@ -472,7 +472,7 @@ K)/2\right)} {\Gamma(\nu/2)} \ \frac{1}{\sqrt{\left| \Sigma
472472
\Sigma^{-1} \, \left(y - \mu\right) \right)^{-(\nu + K)/2} \! .
473473
\end{array} \end{equation*}
474474

475-
### Sampling statement
475+
### Distribution statement
476476

477477
`y ~ ` **`multi_student_t`**`(nu, mu, Sigma)`
478478

@@ -608,7 +608,7 @@ L^{-T}L^{-1} \, \left(y - \mu\right) \right)^{-(\nu + K)/2} \! .
608608
\end{array}
609609
\end{equation*}
610610

611-
### Sampling statement
611+
### Distribution statement
612612

613613
`y ~ ` **`multi_student_t_cholesky`**`(nu, mu, L)`
614614

@@ -682,14 +682,14 @@ A Gaussian Dynamic Linear model is defined as follows, For $t \in 1,
682682
\\ \theta_{t} &\sim N(G \theta_{t - 1}, W) \\ \theta_{0} &\sim
683683
N(m_{0}, C_{0}) \end{aligned} \end{equation*} where $y$ is $n \times T$ matrix
684684
where rows are variables and columns are observations. These functions
685-
calculate the log-likelihood of the observations marginalizing over
685+
calculate the log-density of the observations marginalizing over
686686
the latent states ($p(y | F, G, V, W, m_{0}, C_{0})$). This
687-
log-likelihood is a system that is calculated using the Kalman Filter.
687+
log-density is a system that is calculated using the Kalman Filter.
688688
If $V$ is diagonal, then a more efficient algorithm which sequentially
689689
processes observations and avoids a matrix inversions can be used
690690
[@DurbinKoopman:2001 section 6.4].
691691

692-
### Sampling statement
692+
### Distribution statement
693693

694694
`y ~ ` **`gaussian_dlm_obs`**`(F, G, V, W, m0, C0)`
695695

src/functions-reference/multivariate_discrete_distributions.qmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ where the multinomial coefficient is defined by
2424
\binom{N}{y_1,\ldots,y_k} = \frac{N!}{\prod_{k=1}^K y_k!}.
2525
\end{equation*}
2626

27-
### Sampling statement
27+
### Distribution statement
2828

2929
`y ~ ` **`multinomial`**`(theta)`
3030

@@ -85,7 +85,7 @@ where the multinomial coefficient is defined by
8585
\binom{N}{y_1,\ldots,y_k} = \frac{N!}{\prod_{k=1}^K y_k!}.
8686
\end{equation*}
8787

88-
### Sampling statement
88+
### Distribution statement
8989

9090
`y ~ ` **`multinomial_logit`**`(gamma)`
9191

@@ -141,7 +141,7 @@ distribution is defined as
141141
\end{equation*}
142142
where $\alpha_0$ is defined as $\alpha_0 = \sum_{k=1}^K \alpha_k$.
143143

144-
### Sampling statement
144+
### Distribution statement
145145

146146
`y ~ ` **`dirichlet_multinomial`**`(alpha)`
147147

0 commit comments

Comments
 (0)