Skip to content

Commit 809009e

Browse files
committed
Update PosteriorStats doctests for changed example data
1 parent 0caf702 commit 809009e

File tree

4 files changed

+38
-38
lines changed

4 files changed

+38
-38
lines changed

ext/InferenceObjectsPosteriorStatsExt/loo.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ julia> idata = load_example_data("centered_eight");
2020
julia> loo(idata)
2121
PSISLOOResult with estimates
2222
elpd elpd_mcse p p_mcse
23-
-31 1.4 0.9 0.34
23+
-31 1.4 0.9 0.33
2424
2525
and PSISResult with 500 draws, 4 chains, and 8 parameters
2626
Pareto shape (k) diagnostic values:
2727
Count Min. ESS
28-
(-Inf, 0.5] good 6 (75.0%) 135
29-
(0.5, 0.7] okay 2 (25.0%) 421
28+
(-Inf, 0.5] good 4 (50.0%) 270
29+
(0.5, 0.7] okay 4 (50.0%) 307
3030
```
3131
"""
3232
function PosteriorStats.loo(

ext/InferenceObjectsPosteriorStatsExt/loo_pit.jl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ julia> loo_pit(idata, loo_result.psis_result.log_weights; y_name=:obs)
3131
├────────────────────────────────────────────┴─────────────────────────── dims ┐
3232
↓ school Categorical{String} [Choate, Deerfield, …, St. Paul's, Mt. Hermon] Unordered
3333
└──────────────────────────────────────────────────────────────────────────────┘
34-
"Choate" 0.943511
35-
"Deerfield" 0.63797
36-
"Phillips Andover" 0.316697
37-
"Phillips Exeter" 0.582252
38-
"Hotchkiss" 0.295321
39-
"Lawrenceville" 0.403318
40-
"St. Paul's" 0.902508
41-
"Mt. Hermon" 0.655275
34+
"Choate" 0.942759
35+
"Deerfield" 0.641057
36+
"Phillips Andover" 0.32729
37+
"Phillips Exeter" 0.581451
38+
"Hotchkiss" 0.288523
39+
"Lawrenceville" 0.393741
40+
"St. Paul's" 0.886175
41+
"Mt. Hermon" 0.638821
4242
```
4343
"""
4444
function PosteriorStats.loo_pit(
@@ -91,14 +91,14 @@ julia> loo_pit(idata; y_name=:obs)
9191
├────────────────────────────────────────────┴─────────────────────────── dims ┐
9292
↓ school Categorical{String} [Choate, Deerfield, …, St. Paul's, Mt. Hermon] Unordered
9393
└──────────────────────────────────────────────────────────────────────────────┘
94-
"Choate" 0.943511
95-
"Deerfield" 0.63797
96-
"Phillips Andover" 0.316697
97-
"Phillips Exeter" 0.582252
98-
"Hotchkiss" 0.295321
99-
"Lawrenceville" 0.403318
100-
"St. Paul's" 0.902508
101-
"Mt. Hermon" 0.655275
94+
"Choate" 0.942759
95+
"Deerfield" 0.641057
96+
"Phillips Andover" 0.32729
97+
"Phillips Exeter" 0.581451
98+
"Hotchkiss" 0.288523
99+
"Lawrenceville" 0.393741
100+
"St. Paul's" 0.886175
101+
"Mt. Hermon" 0.638821
102102
```
103103
"""
104104
function PosteriorStats.loo_pit(

ext/InferenceObjectsPosteriorStatsExt/summarize.jl

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ julia> data = load_example_data("centered_eight");
3434
julia> summarize(data)
3535
SummaryStats
3636
mean std hdi_3% hdi_97% mcse_mean mcse_std ess ⋯
37-
mu 4.5 3.5 -1.62 10.7 0.23 0.11
38-
theta[Choate] 6.5 5.9 -4.56 17.1 0.30 0.29
39-
theta[Deerfield] 5.0 4.9 -4.31 14.3 0.23 0.17
40-
theta[Phillips Andover] 3.9 5.7 -7.77 13.7 0.23 0.28
41-
theta[Phillips Exeter] 4.9 5.0 -4.49 14.7 0.26 0.17
42-
theta[Hotchkiss] 3.7 5.0 -6.47 11.7 0.25 0.16
43-
theta[Lawrenceville] 4.0 5.2 -7.04 12.2 0.22 0.22
44-
theta[St. Paul's] 6.6 5.1 -3.09 16.3 0.30 0.19
45-
theta[Mt. Hermon] 4.8 5.7 -5.86 16.0 0.26 0.25
46-
tau 4.1 3.1 0.896 9.67 0.26 0.17
37+
mu 4.2 3.3 -1.61 10.3 0.21 0.088
38+
theta[Choate] 6.4 5.9 -3.68 17.9 0.25 0.20
39+
theta[Deerfield] 5.0 4.9 -4.98 13.4 0.21 0.15
40+
theta[Phillips Andover] 3.4 5.4 -7.54 12.9 0.23 0.17
41+
theta[Phillips Exeter] 4.8 5.2 -5.11 14.1 0.21 0.21
42+
theta[Hotchkiss] 3.5 4.8 -6.12 12.0 0.25 0.15
43+
theta[Lawrenceville] 3.7 5.2 -6.50 12.7 0.22 0.21
44+
theta[St. Paul's] 6.5 5.2 -2.67 16.9 0.22 0.15
45+
theta[Mt. Hermon] 4.8 5.7 -5.97 15.4 0.24 0.23
46+
tau 4.3 3.0 0.715 9.41 0.22 0.14
4747
3 columns omitted
4848
```
4949
@@ -54,14 +54,14 @@ parameters:
5454
julia> summarize(data.posterior[(:theta,)], (:mean, :std) => mean_and_std, median, mad)
5555
SummaryStats
5656
mean std median mad
57-
theta[Choate] 6.46 5.87 6.08 4.64
58-
theta[Deerfield] 5.03 4.88 5.01 4.96
59-
theta[Phillips Andover] 3.94 5.69 4.23 4.67
60-
theta[Phillips Exeter] 4.87 5.01 5.02 4.82
61-
theta[Hotchkiss] 3.67 4.96 3.89 4.70
62-
theta[Lawrenceville] 3.97 5.19 4.14 4.64
63-
theta[St. Paul's] 6.58 5.11 6.07 4.47
64-
theta[Mt. Hermon] 4.77 5.74 4.71 4.95
57+
theta[Choate] 6.42 5.85 5.80 4.95
58+
theta[Deerfield] 4.95 4.91 5.02 4.68
59+
theta[Phillips Andover] 3.42 5.43 3.74 4.84
60+
theta[Phillips Exeter] 4.75 5.25 4.69 4.84
61+
theta[Hotchkiss] 3.45 4.78 3.62 4.55
62+
theta[Lawrenceville] 3.66 5.23 3.90 4.88
63+
theta[St. Paul's] 6.51 5.24 6.09 4.57
64+
theta[Mt. Hermon] 4.82 5.70 4.65 4.89
6565
```
6666
"""
6767
function PosteriorStats.summarize(

ext/InferenceObjectsPosteriorStatsExt/waic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ julia> idata = load_example_data("centered_eight");
2020
julia> waic(idata)
2121
WAICResult with estimates
2222
elpd elpd_mcse p p_mcse
23-
-31 1.4 0.9 0.33
23+
-31 1.4 0.9 0.32
2424
```
2525
"""
2626
function PosteriorStats.waic(

0 commit comments

Comments
 (0)