MCMCDiagnosticTools extension API

This page documents the MCMCDiagnosticTools package extension of BayesDensityCore.

For an example-based introduction to the MCMC diagnostics offered as part of BayesDensity.jl, see the diagnostics example.

MCMCDiagnosticTools.essFunction
MCMCDiagnosticTools.ess(
    ps::PosteriorSamples...;
    [grid::Union{Real, AbstractVector{<:Real}}],
    kwargs...
) -> AbstractVector{<:Real}

Compute the effective sample size for the posterior samples of the density $f$, evaluated at each point in grid. Returns a vector of length length(grid).

Arguments

  • ps: One or more BayesDensityCore.PosteriorSamples object(s) for which the effective sample size is computed. The PosteriorSamples objects must be obtained from the same model object and must have the same number of samples.

Keyword arguments

  • grid: The grid of values for which the posterior density is evaluated. Defaults to the 5 evenly spaced points lying between the end points of [BayesDensityCore.default_grid_points]
  • kwargs...: Additional keyword arguments passed to MCMCDiagnosticTools.ess.
source
MCMCDiagnosticTools.rhatFunction
MCMCDiagnosticTools.rhat(
    ps::PosteriorSamples...;
    [grid::Union{Real, AbstractVector{<:Real}}],
    kwargs...
) -> AbstractVector{<:Real}

Compute the R-hat (potential scale reduction factor) diagnostic for the posterior samples of the density $f$, evaluated at each point in grid. Returns a vector of length length(grid).

Arguments

  • ps: One or more BayesDensityCore.PosteriorSamples object(s) for which the R-hat (potential scale reduction factor) diagnostic is computed. The PosteriorSamples objects must be obtained from the same model object and must have the same number of samples.

Keyword arguments

  • grid: The grid of values for which the posterior density is evaluated. Defaults to the 5 evenly spaced points lying between the end points of [BayesDensityCore.default_grid_points]
  • kwargs...: Additional keyword arguments passed to MCMCDiagnosticTools.rhat.
source
MCMCDiagnosticTools.mcseFunction
MCMCDiagnosticTools.mcse(
    ps::PosteriorSamples...;
    [grid::Union{Real, AbstractVector{<:Real}}],
    kwargs...
) -> AbstractVector{<:Real}

Compute the Monte Carlo standard error for the posterior samples of the density $f$, evaluated at each point in grid. Returns a vector of length length(grid).

Arguments

  • ps: One or more BayesDensityCore.PosteriorSamples object(s) for which the Monte Carlo standard error is computed. The PosteriorSamples objects must be obtained from the same model object and must have the same number of samples.

Keyword arguments

  • grid: The grid of values for which the posterior density is evaluated. Defaults to the 5 evenly spaced points lying between the end points of [BayesDensityCore.default_grid_points]
  • kwargs...: Additional keyword arguments passed to MCMCDiagnosticTools.mcse.
source