Skip to content

Commit 9090f87

Browse files
authored
Merge pull request #217 from stan-dev/case_study/sum-to-zero-vector
Case study/sum to zero vector
2 parents 7ce3982 + bbb2fcc commit 9090f87

File tree

2 files changed

+7045
-0
lines changed

2 files changed

+7045
-0
lines changed

learn-stan/case-studies.qmd

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,35 @@ aliases:
88

99
The case studies on this page are intended to reflect best practices in Bayesian methodology and Stan programming. We aim to keep them current with the latest version of the Stan language, but there may be times when case studies need updating to reflect the latest Stan features and syntax.
1010

11+
12+
## Volume 11 (2025)
13+
14+
### The Sum-to-Zero Constraint in Stan
15+
16+
The [`sum_to_zero_vector`](https://mc-stan.org/docs/reference-manual/transforms.html#zero-sum-vector)
17+
constrained parameter type was introduced in the [Stan 2.36 release](https://github.com/stan-dev/cmdstan/releases/tag/v2.36.0).
18+
This case study demonstrates the efficiency and robustness of this constrained type; how to adjust the marginal variances for a normal prior, and how to implement the sum-to-zero constraining transform as a Stan function, to extend its use beyond a simple vector.
19+
20+
<a href="case-studies/sum_to_zero_vector.html" target="_blank" rel="noopener noreferrer">View HTML</a>
21+
*(link opens in new tab)*
22+
23+
Author
24+
: Mitzi Morris
25+
26+
Keywords
27+
: sum-to-zero, group-level categorical predictors, spatial models
28+
29+
Source Repository
30+
: [example-models/jupyter/sum-to-zero](https://github.com/stan-dev/example-models/tree/master/jupyter/sum-to-zero){target="_blank"}
31+
(GitHub)
32+
33+
Dependencies
34+
: `cmdstanpy`, `numpy`, `pandas`, `geopandas`, `libpysal`, `plotnine`
35+
36+
License
37+
: BSD (3 clause), CC-BY
38+
39+
1140
## Volume 10 (2023)
1241

1342
### Instrumental Variables Analysis of Randomized Experiments with One-Sided Noncompliance

learn-stan/case-studies/sum_to_zero_vector.html

Lines changed: 7016 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)