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.ess — Function
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 moreBayesDensityCore.PosteriorSamplesobject(s) for which the effective sample size is computed. ThePosteriorSamplesobjects 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 toMCMCDiagnosticTools.ess.
MCMCDiagnosticTools.rhat — Function
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 moreBayesDensityCore.PosteriorSamplesobject(s) for which the R-hat (potential scale reduction factor) diagnostic is computed. ThePosteriorSamplesobjects 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 toMCMCDiagnosticTools.rhat.
MCMCDiagnosticTools.mcse — Function
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 moreBayesDensityCore.PosteriorSamplesobject(s) for which the Monte Carlo standard error is computed. ThePosteriorSamplesobjects 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 toMCMCDiagnosticTools.mcse.