Skip to content

Commit 0e17907

Browse files
committed
sampling statement -> distribution statement in other files
1 parent dea5b72 commit 0e17907

File tree

5 files changed

+30
-23
lines changed

5 files changed

+30
-23
lines changed

src/reference-manual/blocks.qmd

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Log-probability modifying functions to blocks where the log
9393
probability accumulator is in scope (transformed parameters and
9494
model); such functions are suffixed with `_lp`.
9595

96-
Density functions defined in the program may be used in sampling
96+
Density functions defined in the program may be used in distribution
9797
statements.
9898

9999

@@ -393,8 +393,9 @@ in the `transformed data` block.
393393

394394
The statements in the transformed data block are designed to be
395395
executed once and have a deterministic result. Therefore, log
396-
probability is not accumulated and sampling statements may not be
397-
used.
396+
probability is not accumulated and
397+
[statements.qmd#distribution-statements.section](distribution statements)
398+
may not be used.
398399

399400

400401
### Variable constraint checking {-}
@@ -528,7 +529,7 @@ no well-defined way to have them be both flexible and easy to
528529
validate.
529530

530531
The statements in the model block typically define the model. This is
531-
the block in which probability (sampling notation) statements are
532+
the block in which probability (distribution notation) statements are
532533
allowed. These are typically used when programming in the BUGS idiom
533534
to define the probability model.
534535

src/reference-manual/expressions.qmd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,9 @@ model {
13391339
}
13401340
```
13411341

1342-
Algebraically, the sampling statement in the model could be reduced to
1342+
Algebraically,
1343+
[statements.qmd#distribution-statements.section](the distribution statement)
1344+
in the model could be reduced to
13431345

13441346
```stan
13451347
x ~ normal(0, 1);

src/reference-manual/removals.qmd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ Replace `foo_ccdf_log(y, ...)` with `foo_lccdf(y | ...)`.
123123

124124
## User-defined function with `_log` suffix
125125

126-
*Removed*: A user-defined function ending in `_log` can be no longer be used in
127-
sampling statements.
126+
*Removed*: A user-defined function ending in `_log` can be no longer be
127+
used in
128+
[statements.qmd#distribution-statements.section](distribution statements).
128129

129130
*Replacement*: Replace the `_log` suffix with `_lpdf` for density
130131
functions or `_lpmf` for mass functions in the user-defined function.

src/reference-manual/user-functions.qmd

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ arguments to produce an expression, which has a value when executed.
9595
### Functions as statements {-}
9696

9797
Functions with void return types may be applied to arguments and used
98-
as statements. These act like sampling statements or print
98+
as [statements.qmd](statements).
99+
These act like distribution statements or print
99100
statements. Such uses are only appropriate for functions that act
100101
through side effects, such as incrementing the log probability
101102
accumulator, printing, or raising exceptions.
@@ -147,12 +148,12 @@ for containers, so an array of `int` may be assigned to an array of
147148
`real` of the same shape. And we can also promote `vector` to
148149
`complex_vector` and similarly for row vectors and matrices.
149150

150-
### Probability functions in sampling statements {-}
151+
### Probability functions in distribution statements {-}
151152

152-
Functions whose name ends in `_lpdf` or `_lpmf` (density
153+
Functions whose name ends in `_lpdf` or `_lpmf` (log density
153154
and mass functions) may be used as probability functions and may be
154-
used in place of parameterized distributions on the right-hand-side of
155-
sampling statements.
155+
used in place of parameterized distributions on the right side of
156+
[statements.qmd#distribution-statements.section](distribution statements).
156157

157158

158159
### Restrictions on placement {-}
@@ -292,28 +293,30 @@ a function elsewhere results in a compile-time error.
292293

293294
### Log probability access in functions {-}
294295

295-
Functions that include sampling statements or log probability
296-
increment statements must have a name that ends in `_lp`.
297-
Attempts to use sampling statements or increment log probability
296+
Functions that include
297+
[statements.qmd#distribution-statements.section](distribution statements) or
298+
[statements.qmd#increment-log-prob.section](log probability increment statements)
299+
must have a name that ends in `_lp`.
300+
Attempts to use distribution statements or increment log probability
298301
statements in other functions lead to a compile-time error.
299302

300-
Like the target log density increment statement and sampling
303+
Like the target log density increment statement and distribution
301304
statements, user-defined functions with names that end in `_lp`
302305
may only be used in blocks where the log probability accumulator is
303306
accessible, namely the transformed parameters and model blocks. An
304307
attempt to use such a function elsewhere results in a compile-time
305308
error.
306309

307310

308-
### Defining probability functions for sampling statements {-}
311+
### Defining probability functions for distribution statements {-}
309312

310313
Functions whose names end in `_lpdf` and `_lpmf` (density
311-
and mass functions) can be used as probability functions in sampling
314+
and mass functions) can be used as probability functions in distribution
312315
statements. As with the built-in functions, the first argument will
313-
appear on the left of the sampling statement operator (`~`) in
314-
the sampling statement and the other arguments follow. For example,
316+
appear on the left of the distribution statement operator (`~`) in
317+
the distribution statement and the other arguments follow. For example,
315318
suppose a function returning the log of the density of `y` given
316-
parameter `theta` allows the use of the sampling statement is
319+
parameter `theta` allows the use of the distribution statement is
317320
defined as follows.
318321

319322
```stan
@@ -335,7 +338,7 @@ The `_lupdf` and `_lupmf` forms of the user-defined functions will
335338
instead allow other unnormalized density functions to drop additive
336339
constants.
337340

338-
The sampling shorthand
341+
The distribution statement shorthand
339342

340343
```stan
341344
z ~ foo(phi);

src/stan-users-guide/truncation-censoring.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ order for this model to not concentrate `L` strongly around
142142
`min(y)` and `U` strongly around `max(y)`.
143143

144144

145-
## Censored data
145+
## Censored data {#censored.section}
146146

147147
Censoring hides values from points that are too large, too small, or
148148
both. Unlike with truncated data, the number of data points that were

0 commit comments

Comments
 (0)