Skip to content

API

ChainsMakie.autocorplot Method
julia
autocorplot(chains)
autocorplot(chains, parameters)
autocorplot(matrix)

Plots the autocorrelations of the samples for each chain and parameter or for an iteration × chains matrix.

Specific attributes to autocorplot are:

  • lags = 0:20: The lags at which autocorrelations should be calculated.

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie, MCMCChains
chains = Chains(randn(300, 3, 3), [:A, :B, :C])
autocorplot(chains)
source
ChainsMakie.chainsbarplot Method
julia
chainsbarplot(matrix)

Plots a barplot of the distribution of parameter samples given an integer-valued iteration × chain matrix.

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie, MCMCChains
samples = reshape(repeat(1:4, 300 ÷ 4 * 3 * 3), (300, 3, 3))
chains = Chains(samples, [:A, :B, :C])
chainsbarplot(chains[:, :B, :])
source
ChainsMakie.chainsdensity Method
julia
chainsdensity(matrix)

Plots the density of the samples for an iteration × chain matrix.

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie, MCMCChains
chains = Chains(randn(300, 3, 3), [:A, :B, :C])
chainsdensity(chains[:, :B, :])
source
ChainsMakie.chainshist Method
julia
chainshist(matrix)

Plots the histogram of the samples for an iteration × chain matrix.

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie, MCMCChains
chains = Chains(randn(300, 3, 3), [:A, :B, :C])
chainshist(chains)
source
ChainsMakie.forestplot Method
julia
forestplot(chains)
forestplot(chains, parameters)
forestplot(vector_of_vectors)

Plots a summary of the samples in chains for each parameter by showing a point_summary and the central interval containing a specified coverage.

When passing a vector_of_vectors, each vector should contain the samples from all chains for one parameter.

Specific attributes to forestplot are:

  • ci = [0.95, 0.9]: The central intervals used to summarize the samples for each parameter.

  • point_summary = :median: The function used to calculate the point summary; must return a single number.

  • min_width = 4: The width of the lines showing the widest interval.

  • max_width = 8: The width of the lines showing the narrowest interval.

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie, MCMCChains
chains = Chains(randn(300, 3, 3), [:A, :B, :C])
forestplot(chains)
source
ChainsMakie.meanplot Method
julia
meanplot(chains)
meanplot(chains, parameters)
meanplot(matrix)

Plots the running average of the samples for each chain and parameter or for an iteration × chains matrix.

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie, MCMCChains
chains = Chains(randn(300, 3, 3), [:A, :B, :C])
meanplot(chains)
source
ChainsMakie.ridgeline Method
julia
ridgeline(chains)
ridgeline(chains, parameters)
ridgeline(vector_of_vectors)

Plots the densities of the samples for each parameter in a single axis by stacking them vertically.

When passing a vector_of_vectors, each vector should contain the samples from all chains for one parameter.

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie, MCMCChains
chains = Chains(randn(300, 3, 3), [:A, :B, :C])
ridgeline(chains)
source
ChainsMakie.traceplot Method
julia
traceplot(chains)
traceplot(chains, parameters)
traceplot(matrix)

Plots the sampled values per iteration for each chain and parameter or for an iteration × chains matrix.

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie, MCMCChains
chains = Chains(randn(300, 3, 3), [:A, :B, :C])
traceplot(chains)
source
ChainsMakie.trankplot Method
julia
trankplot(chains)
trankplot(chains, parameters)
trankplot(matrix)

Plots the binned ranks of sampled values for each chain and parameter or for an iteration × chains matrix.

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie, MCMCChains
chains = Chains(randn(300, 3, 3), [:A, :B, :C])
trankplot(chains)
source
Makie.barplot Method
julia
barplot(chains)
barplot(chains, parameters)

Plots integer-valued samples for each chain and parameter in chains.

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie, MCMCChains
samples = reshape(repeat(1:4, 300 ÷ 4 * 3 * 3), (300, 3, 3))
chains = Chains(samples, [:A, :B, :C])
barplot(chains)
source
Makie.density Method
julia
density(chains)
density(chains, parameters)

Plots the density of the samples for each chain and parameter.

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie, MCMCChains
chains = Chains(randn(300, 3, 3), [:A, :B, :C])
density(chains)
source
Makie.hist Method
julia
hist(chains)
hist(chains, parameters)

Plots the histogram of the samples for each chain and parameter.

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie, MCMCChains
chains = Chains(randn(300, 3, 3), [:A, :B, :C])
hist(chains)
source
Makie.plot Method
julia
plot(chains)
plot(chains, parameters)
plot(chains, functions...)
plot(chains, parameters, functions...)

Plots a multi-column summary of all parameters, showing traceplots and densities.

When also passing a vector of parameters as either strings or symbols, only those parameters will be visualized.

The kinds and number of summary plots can be fully customized by splatting several mutating functions.... Currently supported functions are:

  • autocorplot!

  • chainsdensity!

  • chainshist!

  • meanplot!

  • traceplot!

  • trankplot!

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie, MCMCChains
chains = Chains(randn(300, 3, 3), [:A, :B, :C])
plot(chains)
source
Makie.violin Method
julia
violin(chains)
violin(chains, parameters)

Plots a violin plot of the distribution of samples for each of the parameter in chains.

Attributes

WIP

Example

julia
using CairoMakie, ChainsMakie
import MCMCChains: Chains
chains = Chains(randn(300, 3, 3), [:A, :B, :C])
violin(chains)
source