Skip to content

Commit 5846bc4

Browse files
authored
Merge pull request #175 from tpapp/tp/change-stack-ordering
change stacked ordering
2 parents 9253328 + 2a123ca commit 5846bc4

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Project.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DynamicHMC"
22
uuid = "bbc10e6e-7c05-544b-b16e-64fede858acb"
33
authors = ["Tamas K. Papp <tkpapp@gmail.com>"]
4-
version = "3.4.1"
4+
version = "3.4.2"
55

66
[deps]
77
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
@@ -16,12 +16,16 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1616
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1717
TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b"
1818

19+
[extras]
20+
MCMCDiagnosticTools = "be115224-59cd-429b-ad48-344e309966f0"
21+
1922
[compat]
2023
ArgCheck = "1, 2"
2124
DocStringExtensions = "0.8, 0.9"
2225
FillArrays = "0.13"
2326
LogDensityProblems = "1, 2"
2427
LogExpFunctions = "0.3"
28+
MCMCDiagnosticTools = "0.2"
2529
Parameters = "0.11, 0.12"
2630
ProgressMeter = "1"
2731
TensorCast = "0.4"

src/mcmc.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,15 @@ $(SIGNATURES)
561561
562562
Given a vector of `results`, each containing a property `posterior_matrix` (eg obtained from
563563
[`mcmc_with_warmup`](@ref) with the same sample length), return a lazy view as an array
564-
indexed by `[draw_index, parameter_index, chain_index]`.
564+
indexed by `[draw_index, chain_index, parameter_index]`.
565565
566566
This is useful as an input for eg `MCMCDiagnosticTools.ess_rhat`.
567+
568+
!!! note
569+
The ordering is not compatible with MCMCDiagnostictools version < 0.2.
567570
"""
568571
function stack_posterior_matrices(results)
569-
@cast _[i, j, k]:= results[k].posterior_matrix[j, i]
572+
@cast _[i, k, j]:= results[k].posterior_matrix[j, i]
570573
end
571574

572575
"""

test/test_mcmc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ end
7474
D, N, K = 5, 100, 7
7575
= multivariate_normal(ones(5))
7676
results = fill(mcmc_with_warmup(RNG, ℓ, N; reporter = NoProgressReport()), K)
77-
@test size(stack_posterior_matrices(results)) == (N, D, K)
77+
@test size(stack_posterior_matrices(results)) == (N, K, D)
7878
@test size(pool_posterior_matrices(results)) == (D, N * K)
7979
end
8080

0 commit comments

Comments
 (0)