Skip to content

Releases: TuringLang/MCMCChains.jl

v0.3.11

28 Jul 15:11
v0.3.11
6f973b1
Compare
Choose a tag to compare

v0.3.11 (2019-07-28)

Diff since v0.3.10

Closed issues:

  • Release 0.3.10 (#105)

Merged pull requests:

v0.3.10

21 May 18:08
v0.3.10
0e85958
Compare
Choose a tag to compare

v0.3.10 (2019-05-21)

Full Changelog

Closed issues:

  • lf_eps included as a parameter on Turing master (#101)
  • Release 0.3.9 (#100)

Merged pull requests:

v0.3.9

04 May 13:45
Compare
Choose a tag to compare
  • Corrected ESS calculation (#98, #86, #90)
  • Added Rhat to the summarystats output (#98)

v0.3.8

25 Apr 03:06
8ed0816
Compare
Choose a tag to compare
  • Fixed the size function (#92)
  • The show(chain) function now prints quantiles in addition to summary stats.
  • Fixed a bug where ChainDataFrame objects would not appear in Jupyter output cells.

DataFrames, hpd export.

16 Apr 17:06
Compare
Choose a tag to compare
  • Fixes a quantile issue
  • Exports the hpd function
  • Uses DataFrames for all statistics functions

Quantiles Hotfix

02 Apr 02:53
75185f6
Compare
Choose a tag to compare
  • Fixes an improperly specified quantile function (#76, #75)

Sampling, Arrays, and DataFrames

27 Mar 18:18
a9b69b4
Compare
Choose a tag to compare
  • You can now use the sampling API from StatsBase to pull random samples from your chain (#68)
  • Supports Array(chn) to create a simple Array object from a Chains object (#73)
  • Export your chain to a DataFrame (#73)

The README file contains more information on how to use the above features, but here's the relevant section:

Exporting Chains

A few utility export functions have been provided to convert Chains objects to either an Array or a DataFrame:

# Several examples of creating an Array object:
Array(chns)
Array(chns[:s])
Array(chns, [:parameters])
Array(chns, [:parameters, :internals])

# By default chains are appended. This can be disabled
# using the append_chains keyword argument:
Array(chns, append_chains=false)

# This will return an `Array{Array, 1}` object containing
# an Array for each chain.

# A final option is:
Array(chns, remove_missing_union=false)

# This will not convert the Array columns from a 
`Union{Missing, Real}` to a `Vector{Real}`.

Similarly, for DataFrames:

DataFrame(chns)
DataFrame(chns[:s])
DataFrame(chns, [:parameters])
DataFrame(chns, [:parameters, :internals])
DataFrame(chns, append_chains=false)
DataFrame(chns, remove_missing_union=false)

See also ?MCMCChains.DataFrame and ?MCMCChains.Array for more help.

Sampling Chains

MCMCChains overloads several sample() methods as defined in StatsBase:

# Sampling `n` samples from the chain `a`. Optionally
# weighting the samples using `wv`.
sample([rng], a, [wv::AbstractWeights], n::Integer)

# E.g. creating 10000 weighted samples:
c = kde(Array(chn[:s]))
chn_weighted_sample = sample(c.x, Weights(c.density), 100000)

# As above, but supports replacing and ordering.
sample([rng], a, [wv::AbstractWeights], n::Integer; replace=true, 
  ordered=false)

See also ?MCMCChains.sample for additional help.

Hotfix

10 Mar 21:53
e83df25
Compare
Choose a tag to compare
  • Removed restriction on Chains.value which required a Union{Missing, A} matrix.
  • Added lastindex functions
  • Fixed leftover indexing by string functions from #57.

Index changes and bug fixes

10 Mar 16:51
400aa57
Compare
Choose a tag to compare
  • Diagnostic functions now support section = :section_name as keyword arguments (#54)
  • Corner plots have been fixed to work with multiple chains (#55)
  • chn[:param] and chn[:, :param, :] now both return the same thing, a Chains object containing only :param.
  • Strings are now enforced as parameter names. Symbols no longer work as parameter names. (#57)
  • Added get_params, which packages all the parameters in a chain into a NamedTuple. Used like get_params(chn). (#57)
  • Added an overload on get accepting a keyword section, which can be a vector or a single symbol. Works like get(chn; section = :pooled) or get(chn; section = [:parameters, :pooled]). (#57)
  • All variants of get and get_params accept a keyword argument flatten, which can be true or false. If flatten=true, the tuple returned will have a flat structure. This is handy if you want to go straight to a dataframe, because flatten=false (the default) will clump variables with the same names together (as with "P[1]", "P[2]", "P[3]"). (#57)
  • Fixed bug where chains would not show if their length was less than 200 (c2d0827)
  • Fixed bug where chains would not show if they did not contain a :parameters section

Plot labl improvements

07 Mar 20:03
b106cc9
Compare
Choose a tag to compare
  • Fixed quantile deprecation warning
  • Supported label overriding for plot
  • Set default chain name to an integer