Diagnostics

MCMCDiagnosticTools.discretediagMethod
discretediag(chains::Chains{<:Real}; sections, kwargs...)

Discrete diagnostic where method can be [:weiss, :hangartner, :DARBOOT, MCBOOT, :billinsgley, :billingsleyBOOT].

source
MCMCDiagnosticTools.rstarMethod
rstar(rng=Random.GLOBAL_RNG, classifier, chains::Chains; kwargs...)

Compute the $R^*$ convergence diagnostic of the MCMC chains with the classifier.

The keyword arguments supported here are the same as those in rstar for arrays of samples and chain indices.

Examples

julia> using MLJBase, MLJDecisionTreeInterface, Statistics

julia> chains = Chains(fill(4.0, 100, 2, 3));

One can compute the distribution of the $R^*$ statistic with the probabilistic classifier.

julia> distribution = rstar(DecisionTreeClassifier(), chains);

julia> isapprox(mean(distribution), 1; atol=0.1)
true

For deterministic classifiers, a single $R^*$ statistic is returned.

julia> decisiontree_deterministic = Pipeline(
           DecisionTreeClassifier();
           operation=predict_mode,
       );

julia> value = rstar(decisiontree_deterministic, chains);

julia> isapprox(value, 1; atol=0.2)
true
source
MCMCDiagnosticTools.essMethod
ess(chains::Chains; duration=compute_duration, kwargs...)

Estimate the effective sample size.

ESS per second options include duration=MCMCChains.compute_duration (the default) and duration=MCMCChains.wall_duration.

source
MCMCDiagnosticTools.ess_rhatMethod
ess_rhat(chains::Chains; duration=compute_duration, kwargs...)

Estimate the effective sample size and the $\widehat{R}$ diagnostic

ESS per second options include duration=MCMCChains.compute_duration (the default) and duration=MCMCChains.wall_duration.

source