Skip to content

Commit

Permalink
Merge pull request #253 from stan-dev/development
Browse files Browse the repository at this point in the history
New stan syntax and tags
  • Loading branch information
MansMeg authored Oct 15, 2023
2 parents 8bc65e6 + 4a916e8 commit ae1dce9
Show file tree
Hide file tree
Showing 377 changed files with 2,907 additions and 2,614 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/posteriordb_content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,14 @@ jobs:

- uses: r-lib/actions/setup-r@v2

- id: files
uses: jitterbit/get-changed-files@v1

- run: |
echo "${{ steps.files.outputs.added_modified }}" >> "added_modified.txt"
- name: Install curl
if: runner.os == 'Linux'
run: |
sudo apt-get install libcurl4-openssl-dev
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('DESCRIPTION') }}
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ authors:
given-names: Aki
title: "posteriordb: a set of posteriors for Bayesian inference and probabilistic programming"
version: 0.4
date-released: 2022-11-02
date-released: 2023-10-15
24 changes: 24 additions & 0 deletions doc/KEYWORDS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Posterior keywords
==================

Below are the definition of some of the keywords used. These are tags added to posterior that we __know__. Hence, there might exist posteriors that should have the keyword where it is currently missing. If you see this, please file an issue and we will fix it.

```easy```: Posteriors that can be computed with standard Stan settings (adapt delta = 0.8) without any divergent transitions for 10 000 draws and on average use less than 100 leapfrog steps per iteration.

```slow```: Posteriors that take more than 1h to run 1000 iterations/warmup on a standard CPU. The difficulties can be due to different reasons.

```arm book```: Posteriors that can be found in "Gelman, A., & Hill, J. (2006). Data analysis using regression and multilevel/hierarchical models. Cambridge University Press."

```pathfinder paper```: Posteriors used in "Zhang, L., Carpenter, B., Gelman, A., & Vehtari, A. (2022). Pathfinder: Parallel quasi-Newton variational inference. Journal of Machine Learning Research, 23(306), 1-49."

```bpa book```: Posteriors translated by Hiroki Itô from "Kéry, M., & Schaub, M. (2011). Bayesian population analysis using WinBUGS: a hierarchical perspective. Academic Press."

```stan benchmark```: Posteriors used in the Stan repository "Benchmark Models for Evaluating Algorithm Accuracy. https://github.com/stan-dev/stat_comp_benchmarks".

```stan case study```: Posteriors from "Stan cases studies. https://mc-stan.org/users/documentation/case-studies.html".

```warmup paper```: Posteriors used in "Bales, B., Pourzanjani, A., Vehtari, A., & Petzold, L. (2019). Selecting the metric in Hamiltonian monte carlo. arXiv preprint arXiv:1905.11916."

```bugs examples``` Posteriors from "BUGS example models and data. https://github.com/stan-dev/example-models/tree/master/bugs_examples".

```stan examples``` Posteriors from "Stan examples. https://github.com/stan-dev/example-models".
19 changes: 4 additions & 15 deletions doc/REFERENCE_POSTERIOR_DEFINITION.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ The purpose of the reference posterior definition is to define the criteria for

A reference posterior should have:
1. 10 000 draws per parameter in the model.
1. Each parameter should have an Rhat (see [arXiv](https://arxiv.org/abs/1903.08008)) below 1.01.
1. The effective sample size (bulk and tail) should fall within a probability bound of 0.95. See details below.
1. All Expected Fraction of Missing Information (E-FMI) is below 0.2
1. Efficient sample size (ESS) / iteration > 0.0001
1. An Rhat (see [Vehtari et al. (2021)](https://doi.org/10.1214/20-BA1221)) below 1.01 for all parameters.
1. Approximately independent draws, that is, all parameters have an autocorrelation at lag 1 that is less than 0.05 (see, e.g., [Vehtari et al. (2021)](https://doi.org/10.1214/20-BA1221))).
1. All Expected Fraction of Missing Information (E-FMI) is below 0.2 (see section 6.1 of [A Conceptual Introduction to Hamiltonian Monte Carlo](https://arxiv.org/abs/1701.02434))
1. No divergent transitions if HMC is used (see [Stan Reference Manual](https://mc-stan.org/docs/reference-manual/divergent-transitions.html))


Computing Reference Posteriors Draws
Expand All @@ -29,14 +29,3 @@ Check that:

If it is possible to compute the true posterior analytically, we can make draws from the posterior distribution directly.




Computing parameter ESS bounds
------

The variability of ESS estimate is relatively high, so to assert that we have a reasonable bound on the ESS values, we have simulated the distribution for ESS bulk and ESS tail (see [arXiv](https://arxiv.org/abs/1903.08008)) based on 10 000 normal draws.

We now check that the ESS bulk and tail is roughly within 4 SD from a NULL distribution (that is roughly ```sqrt(7 * S)``` where ```S``` is the total number of draws. This is a rough check for the ESS values, but far from perfect. In the long run, we want to check this with a hierarchical model instead.

See `ess_bounds()` in ```rpackage/R/utils_reference_posterior.R``` to see details for how bounds are chosen.
3 changes: 2 additions & 1 deletion posterior_database/models/info/2pl_latent_reg_irt.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-08-03",
"model_implementations": {
"stan": {
"model_code": "models/stan/2pl_latent_reg_irt.stan"
"model_code": "models/stan/2pl_latent_reg_irt.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/GLMM1_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-25",
"model_implementations": {
"stan": {
"model_code": "models/stan/GLMM1_model.stan"
"model_code": "models/stan/GLMM1_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/GLMM_Poisson_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-29",
"model_implementations": {
"stan": {
"model_code": "models/stan/GLMM_Poisson_model.stan"
"model_code": "models/stan/GLMM_Poisson_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/GLM_Binomial_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-07-01",
"model_implementations": {
"stan": {
"model_code": "models/stan/GLM_Binomial_model.stan"
"model_code": "models/stan/GLM_Binomial_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/GLM_Poisson_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-07-01",
"model_implementations": {
"stan": {
"model_code": "models/stan/GLM_Poisson_model.stan"
"model_code": "models/stan/GLM_Poisson_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/M0_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-24",
"model_implementations": {
"stan": {
"model_code": "models/stan/M0_model.stan"
"model_code": "models/stan/M0_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/Mb_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-25",
"model_implementations": {
"stan": {
"model_code": "models/stan/Mb_model.stan"
"model_code": "models/stan/Mb_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/Mh_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-25",
"model_implementations": {
"stan": {
"model_code": "models/stan/Mh_model.stan"
"model_code": "models/stan/Mh_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/Mt_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-25",
"model_implementations": {
"stan": {
"model_code": "models/stan/Mt_model.stan"
"model_code": "models/stan/Mt_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/Mtbh_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-25",
"model_implementations": {
"stan": {
"model_code": "models/stan/Mtbh_model.stan"
"model_code": "models/stan/Mtbh_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/Mth_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-25",
"model_implementations": {
"stan": {
"model_code": "models/stan/Mth_model.stan"
"model_code": "models/stan/Mth_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/Rate_1_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-30",
"model_implementations": {
"stan": {
"model_code": "models/stan/Rate_1_model.stan"
"model_code": "models/stan/Rate_1_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/Rate_2_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-30",
"model_implementations": {
"stan": {
"model_code": "models/stan/Rate_2_model.stan"
"model_code": "models/stan/Rate_2_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/Rate_3_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-30",
"model_implementations": {
"stan": {
"model_code": "models/stan/Rate_3_model.stan"
"model_code": "models/stan/Rate_3_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/Rate_4_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-30",
"model_implementations": {
"stan": {
"model_code": "models/stan/Rate_4_model.stan"
"model_code": "models/stan/Rate_4_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/Rate_5_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-30",
"model_implementations": {
"stan": {
"model_code": "models/stan/Rate_5_model.stan"
"model_code": "models/stan/Rate_5_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/Survey_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-06-30",
"model_implementations": {
"stan": {
"model_code": "models/stan/Survey_model.stan"
"model_code": "models/stan/Survey_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/accel_gp.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"urls": "https://github.com/bbbales2/cmdstan-warmup/blob/develop/examples/accel_gp/",
"model_implementations": {
"stan": {
"model_code": "models/stan/accel_gp.stan"
"model_code": "models/stan/accel_gp.stan",
"stan_version": ">=2.26.0"
}
},
"references": "bales2019selecting",
Expand Down
3 changes: 2 additions & 1 deletion posterior_database/models/info/accel_splines.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"urls": "https://github.com/bbbales2/cmdstan-warmup/blob/develop/examples/accel_splines/",
"model_implementations": {
"stan": {
"model_code": "models/stan/accel_splines.stan"
"model_code": "models/stan/accel_splines.stan",
"stan_version": ">=2.26.0"
}
},
"references": "bales2019selecting",
Expand Down
12 changes: 4 additions & 8 deletions posterior_database/models/info/arK.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@
"name": "arK",
"title": "Autoregressive-5 model",
"description": "An AR(5) time series model.",
"keywords": [
"time series",
"stan_benchmark"
],
"urls": [
"https://github.com/stan-dev/stat_comp_benchmarks/tree/master/benchmarks/arK"
],
"keywords": ["time series", "stan_benchmark"],
"urls": "https://github.com/stan-dev/stat_comp_benchmarks/tree/master/benchmarks/arK",
"prior": {
"keywords": []
},
"model_implementations": {
"stan": {
"model_code": "models/stan/arK.stan"
"model_code": "models/stan/arK.stan",
"stan_version": ">=2.26.0"
}
},
"added_by": "Mans Magnusson",
Expand Down
11 changes: 4 additions & 7 deletions posterior_database/models/info/arma11.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@
"name": "arma11",
"title": "Autoregressive Moving Average",
"description": "An ARMA(1, 1) time series model.",
"keywords": [
"stan_benchmark"
],
"keywords": "stan_benchmark",
"references": null,
"urls": [
"https://github.com/stan-dev/stat_comp_benchmarks/tree/master/benchmarks/arma"
],
"urls": "https://github.com/stan-dev/stat_comp_benchmarks/tree/master/benchmarks/arma",
"prior": {
"keywords": []
},
"model_implementations": {
"stan": {
"model_code": "models/stan/arma11.stan"
"model_code": "models/stan/arma11.stan",
"stan_version": ">=2.26.0"
}
},
"added_by": "Mans Magnusson",
Expand Down
3 changes: 2 additions & 1 deletion posterior_database/models/info/blr.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
},
"model_implementations": {
"stan": {
"model_code": "models/stan/blr.stan"
"model_code": "models/stan/blr.stan",
"stan_version": ">=2.26.0"
}
},
"added_by": "Mans Magnusson",
Expand Down
3 changes: 2 additions & 1 deletion posterior_database/models/info/bones_model.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-07-06",
"model_implementations": {
"stan": {
"model_code": "models/stan/bones_model.stan"
"model_code": "models/stan/bones_model.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/bym2_offset_only.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"added_date": "2021-08-03",
"model_implementations": {
"stan": {
"model_code": "models/stan/bym2_offset_only.stan"
"model_code": "models/stan/bym2_offset_only.stan",
"stan_version": ">=2.26.0"
}
}
}
3 changes: 2 additions & 1 deletion posterior_database/models/info/covid19imperial_v2.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"urls": "https://github.com/ImperialCollegeLondon/covid19model",
"model_implementations": {
"stan": {
"model_code": "models/stan/covid19imperial_v2.stan"
"model_code": "models/stan/covid19imperial_v2.stan",
"stan_version": ">=2.26.0"
}
},
"references": "flaxman2020report",
Expand Down
3 changes: 2 additions & 1 deletion posterior_database/models/info/covid19imperial_v3.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"urls": "https://github.com/ImperialCollegeLondon/covid19model",
"model_implementations": {
"stan": {
"model_code": "models/stan/covid19imperial_v3.stan"
"model_code": "models/stan/covid19imperial_v3.stan",
"stan_version": ">=2.26.0"
}
},
"references": null,
Expand Down
3 changes: 2 additions & 1 deletion posterior_database/models/info/diamonds.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"urls": "https://github.com/bbbales2/cmdstan-warmup/blob/develop/examples/diamonds",
"model_implementations": {
"stan": {
"model_code": "models/stan/diamonds.stan"
"model_code": "models/stan/diamonds.stan",
"stan_version": ">=2.26.0"
}
},
"references": "bales2019selecting",
Expand Down
3 changes: 2 additions & 1 deletion posterior_database/models/info/dogs.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"urls": "https://raw.githubusercontent.com/stan-dev/example-models/master/ARM/Ch.24/dogs.stan",
"model_implementations": {
"stan": {
"model_code": "models/stan/dogs.stan"
"model_code": "models/stan/dogs.stan",
"stan_version": ">=2.26.0"
}
},
"references": "gelman2006data",
Expand Down
Loading

0 comments on commit ae1dce9

Please sign in to comment.