File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,16 @@ type Chain
1313end
1414Chain () = Chain (0 , Vector {Sample} ())
1515
16+ function Base. show (io:: IO , ch1:: Chain )
17+ # Print chain weight and weighted means of samples in chain
18+ if length (ch1. value) == 0
19+ print (io, " Empty Chain, weight $(ch1. weight) " )
20+ else
21+ chain_mean = [i => mean (ch1, i, x -> x) for i in keys (ch1. value[1 ]. value)]
22+ print (io, " Chain, model evidence (log) $(ch1. weight) and means $(chain_mean) " )
23+ end
24+ end
25+
1626function Base. getindex (c:: Chain , v:: Symbol )
1727 # This strange implementation is mostly to keep backward compatability.
1828 # Needs some refactoring a better format for storing results is available.
5464# tests
5565# tr = Turing.sampler.particles[1]
5666# tr = Chain(Turing.sampler.particles)
57-
You can’t perform that action at this time.
0 commit comments