Documentation for AdaptEllipticalSliceSampler.jl

AdaptEllipticalSliceSampler.AGESSFunction
AGESS(log_posterior, n_MCMC, P; μ_0, Σ_0, init_x, t_dist, ν, burnin, ϵ, single_step_prop, β)

Performs adaptive generalized elliptical slice sampling.

Performs AGESS on a target distribution specified by log_posterior. The target distribution is of dimension P and n_MCMC iterations of Markov chain Monte Carlo will be performed using the AGESS transition scheme.

Arguments

  • log_posterior::Function: a function evaluating the posterior log pdf with only the state (or variables) as the input
  • n_MCMC::Integer: the number of iterations to run the Markov chain for
  • P::Integer: the dimension of the target distribution

Keyword Arguments

  • μ_0::Union{AbstractVector{<:AbstractFloat}, AbstractFloat} = 0.0: a vector (or number which will be multiplied by the one vector) containing the initial (or prior) mean of adaptive distribution
  • Σ_0::Union{AbstractMatrix{<:AbstractFloat}, AbstractFloat} = 1.0: a matrix (or number which will be multiplied by I) containing the initial (or prior) scale of adaptive distribution
  • init_x::Union{AbstractVector{<:AbstractFloat}, AbstractFloat} = 0.0: a vector (or number which will be multiplied by the one vector) containing the initial starting location of the Markov chain
  • t_dist::Bool = true: a Boolean variable indicating whether to use a t-distribution (true) or normal distribution (false) for elliptical slice sampling (Note: should almost always use t-distribution)
  • ν::AbstractFloat = 6.0: the degrees of freedom of the t-distribution
  • burnin::AbstractFloat = 0.25: the proportion of chain used for burnin
  • ϵ::AbstractFloat = 0.05: the proportion of non-adaptive transitions
  • single_step_prop::AbstractFloat = 0.05: the proportion of transitions where we perform one-dimensional updated (P >= 10)
  • β::AbstractFloat = 0.5: the rate at which the adaptation diminishes

Returns

output: a struct containing the following:

  • samps::AbstractMatrix{<:AbstractFloat}: a matrix containing the states of the Markov chain (n_MCMC x P)
  • l_pdf::AbstractVector{<:AbstractFloat}: a vector containing the posterior log pdf evaluated at each state of the Markov chain
  • params::struct: a struct containing the following:
    • log_posterior::Function: the user-specified function
    • μ_0::AbstractVector{<:AbstractFloat}: the user-specified initial mean
    • Σ_0::AbstractMatrix{<:AbstractFloat}: the user-specified initial scale
    • t_dist::Bool: the user-specified value
    • ν::AbstractFloat: the user-specified degrees of freedom
    • β::AbstractFloat: the user-specified β
    • single_step_prop::AbstractFloat: the user-specified value
    • burnin::AbstractFloat: the user-specified value
    • ϵ::AbstractFloat: the user-specified value
    • n_MCMC::Integer: the user-specified number of iterations
    • P::Integer: the user-specified dimension of target distribution
  • adapted_Σ::AbstractMatrix{<:AbstractFloat}: the adapted (learned) scale matrix
  • adapted_μ::AbstractVector{<:AbstractFloat}: the adapted (learned) mean vector

Examples

For examples, please view the Tutorials section of the documentation.

References

N. Marco and S. T. Tokdar. Adaptive generalized elliptical slice sampling. arXiv preprint arXiv:2605.21659, 2026.

source
AdaptEllipticalSliceSampler.AGESS_MCMC_paramsType
AGESS_MCMC_params(log_posterior, μ_0, Σ_0, t_dist, ν, β, single_step_prop, burnin, ϵ, n_MCMC, P)

A struct containing user-specified values.

Arguments

  • log_posterior::Function: the user-specified function
  • μ_0::AbstractVector{<:AbstractFloat}: the user-specified initial mean
  • Σ_0::AbstractMatrix{<:AbstractFloat}: the user-specified initial scale
  • t_dist::Bool: the user-specified value
  • ν::AbstractFloat: the user-specified degrees of freedom
  • β::AbstractFloat: the user-specified β
  • single_step_prop::AbstractFloat: the user-specified value
  • burnin::AbstractFloat: the user-specified value
  • ϵ::AbstractFloat: the user-specified value
  • n_MCMC::Integer: the user-specified number of iterations
  • P::Integer: the user-specified dimension of target distribution
source
AdaptEllipticalSliceSampler.AGESS_single_step!Function
AGESS_single_step!(x, z, params, ph, μ_adapt, Σ_chol_adapt, i)

Performs one iteration of adaptive generalized elliptical slice sampling.

Performs an in-place update of the Markov chain using AGESS. This function should only be used for custom (advanced) sampling schemes (see AGESS for general use). The matrix x contains the Markov chain, while z is an auxiliary variable for constructing the ellipse. ph is a vector used for intermediate calculations of same dimension of z (i.e. dimension of the target distribution). params contains all the information of the Markov chain, including log pdf of target distribution. μ_adapt and Σ_chol_adapt contain information about the mean and scale parameters of the adapted distribution, while i contains the current state of the Markov chain. The current state of X should be populated with the last state of the Markov chain.

Arguments

  • x::AbstractMatrix{<:AbstractFloat}: a matrix containing the Markov chain (n_MCMC x P)
  • z::AbstractVector{<:AbstractFloat}: a vector used to create the ellipse (dim = P)
  • log_posterior::Function: a function evaluating the log posterior pdf with a vector of parameters as the only input
  • t_dist::Bool: a Boolean containing whether to use the T-distribution to generate ellipses
  • ν::AbstractFloat: the user-specified degrees of freedom
  • P::Integer: the dimension of the target distribution
  • ph::AbstractVector{<:AbstractFloat}: a vector used for intermediate calculations (dim = P)
  • μ_adapt::AbstractVector{<:AbstractFloat}: a vector containing the mean parameter of adapted distribution (dim = P)
  • Σ_chol_adapt::LowerTriangular{<:AbstractFloat, <:AbstractMatrix{<:AbstractFloat}}: a lower triangular matrix containing the cholesky decomposition of the scale parameter of the adapted matrix
  • l_pdf::AbstractFloat: the log posterior density of current state
  • i::Integer: the iteration of the Markov chain

Examples

For examples, please view the Tutorials section of the documentation.

References

N. Marco and S. T. Tokdar. Adaptive generalized elliptical slice sampling. arXiv preprint arXiv:2605.21659, 2026.

source
AdaptEllipticalSliceSampler.AGESS_single_step_1d!Function
AGESS_single_step_1d!(x, params, μ_adapt, Σ_chol_adapt, i)

Performs one iteration of adaptive generalized elliptical slice sampling in each dimension.

Performs an in-place update of the Markov chain using one-dimensional AGESS updates. This function should only be used for custom (advanced) sampling schemes (see AGESS for general use). The matrix x contains the Markov chain. params contains all the information of the Markov chain, including log pdf of target distribution. μ_adapt and Σ_chol_adapt contain information about the mean and scale parameters of the adapted distribution, while i contains the current state of the Markov chain. The current state of X should be populated with the last state of the Markov chain.

Arguments

  • x::AbstractMatrix{<:AbstractFloat}: a matrix containing the Markov chain (n_MCMC x P)
  • log_posterior::Function: a function evaluating the log posterior pdf with a vector of parameters as the only input
  • t_dist::Bool: a Boolean containing whether to use the T-distribution to generate ellipses
  • ν::AbstractFloat: the user-specified degrees of freedom
  • P::Integer: the dimension of the target distribution
  • μ_adapt::AbstractVector{<:AbstractFloat}: a vector containing the mean parameter of adapted distribution (dim = P)
  • Σ_chol_adapt::LowerTriangular{<:AbstractFloat, <:AbstractMatrix{<:AbstractFloat}}: a lower triangular matrix containing the cholesky decomposition of the scale parameter of the adapted matrix
  • l_pdf::AbstractFloat: the log posterior density of current state
  • perm::AbstractVector{<:Integer}: a vector containing a placeholder for the permutation of indices
  • i::Integer: the iteration of the Markov chain

Examples

For examples, please view the Tutorials section of the documentation.

References

N. Marco and S. T. Tokdar. Adaptive generalized elliptical slice sampling. arXiv preprint arXiv:2605.21659, 2026.

source