Figures
Verification
Comparisons with R
- CmdStanR methods
- Posterior summaries
- LOO and PSIS
- Moment matching
- Model methods
- Stan functions
- Figures
- rvars and inits
- Metadata
On this page
Comparisons with other interfaces
Scope
Kernel density bandwidth and estimates, autocorrelations, ranks with ties, and interval quantiles. Identical inputs.
References
- Reference
- R 4.6.1 bw.nrd0(), dnorm(), acf(), and rank(), and bayesplot 1.16.0.9000 mcmc_intervals_data() with posterior 1.7.1
- Versions
- PHP 8.5.10, CmdStan 2.40.0, R 4.6.1, posterior 1.7.1, bayesplot 1.16.0.9000
Data
- Inputs
- 400 draws of an AR(1) series and 400 integers from 0 to 9, generated with seed 7; density evaluated at 41 points from −2 to 2.
Method
PHP generates the inputs with a fixed seed. R computes the reference values with stats functions and bayesplot's mcmc_intervals_data().
- Check
- Comparison with a reference implementation
- Recorded
- 2026-11-02, PHP 8.5.10, macOS 27.0.1 (arm64), commit 4ec6712
Tolerances
|x − r| ≤ 1e-14
Applies to: Bandwidth
|x − r| ≤ 1e-13
Applies to: Density estimates
|x − r| ≤ 1e-12
Applies to: Autocorrelations, ranks, and interval quantiles
x: package value; r: reference value. Absolute error: |x − r|. Relative error: |x − r| / max(|r|, 1). Max errors are over the values a row compares.
Results
5 comparisons: 5 pass, 0 fail, 0 skipped.
| Quantity | Criterion | Values | Max abs. error | Max rel. error | Status |
|---|---|---|---|---|---|
| density bandwidth | |x − r| ≤ 1e-14 | 1 | 5.0e-16 | 5.0e-16 | pass |
| density at 41 points | |x − r| ≤ 1e-13 | 41 | 6.7e-16 | 6.7e-16 | pass |
| autocorrelation, lags 0 to 20 | |x − r| ≤ 1e-12 | 21 | 5.0e-16 | 5.0e-16 | pass |
| ranks with ties | |x − r| ≤ 1e-12 | 400 | 0 | 0 | pass |
| interval quantiles | |x − r| ≤ 1e-12 | 10 | 2.4e-15 | 2.1e-15 | pass |
Reproduction
php verification/compatibility/run.php
- Raw record
- site/verifications/figures.json
- Full results
- verification/compatibility/results.json