@@ -383,7 +383,7 @@ sigma ~ normal(0, 1);
383
383
```
384
384
The symbol $\sim$ is called tilde. Due to historical reasons, the
385
385
distribution statements used to be called "sampling statements" in
386
- Stan, but that term is not recommended anymore as it is less accurate
386
+ Stan, but that term is not recommended anymore as it is a less accurate
387
387
description.
388
388
389
389
In general, we can read $\sim$ as "is distributed as," and overall
@@ -420,7 +420,7 @@ density. You can think of each line as representing an additional
420
420
piece of information.
421
421
422
422
When the joint distribution is considered as a function of parameters
423
- (e.g. $\mu$, $\sigma$) given fixed data, it is proportional to
423
+ (e.g. $\mu$, $\sigma$) given fixed data, it is proportional to the
424
424
posterior distribution. In general, the posterior distribution is not
425
425
a normalized probability density function---that is, it will be
426
426
positive but will not in general integrate to 1---but the
@@ -432,11 +432,11 @@ terms in the model block. Equivalently, each $\sim$ statement
432
432
corresponds to a multiplicative factor in the unnormalized posterior
433
433
density.
434
434
435
- Distribution statement ` ... ~ ... ` accepts only distributions on the
436
- right side. These distributions can be built in or user defined
437
- distributions. The left side of a distribution statement may be data,
435
+ Distribution statements ( ` ~ ` ) accept only built-in or user-defined
436
+ distributions on the
437
+ right side. The left side of a distribution statement may be data,
438
438
parameter, or a complex expression, but the evaluated type needs to
439
- match one of the allowed type of the right hand side distribution (see
439
+ match one of the allowed types of the distribution on the right (see
440
440
more below).
441
441
442
442
In Stan, a distribution statement is merely a notational convenience
@@ -452,13 +452,13 @@ target += normal_lpdf(sigma | 0, 1);
452
452
```
453
453
454
454
Stan models can mix distribution statements and log probability
455
- increment statements. Although in the literature statistical models
456
- are usually defined with distributions, there are several cases due to
457
- computational efficiency (e.g. censored data model) or coding language
458
- limitations (e.g. mixture models in Stan), that we may want to code
459
- the log likelihood or parts of it directly, which is possible with log
460
- probability increment statements. See the discussion below about
461
- Jacobians.
455
+ increment statements. Although statistical models
456
+ are usually defined with distributions in the literature,
457
+ there are several scenarios in which we may want to code the log
458
+ likelihood or parts of it directly, for example, due to computational
459
+ efficiency (e.g. censored data model) or coding language limitations
460
+ (e.g. mixture models in Stan). This is possible with log probability
461
+ increment statements. See also the discussion below about Jacobians.
462
462
463
463
In general, a distribution statement of the form
464
464
0 commit comments