PDMPFlux

Documentation for PDMPFlux.

using PDMPFlux

function U_Gauss(x::AbstractVector)
    return sum(x.^2) / 2
end

dim = 10
sampler = ForwardECMCAD(dim, U_Gauss)

N_sk, N, xinit, vinit = 1_000_000, 1_000_000, zeros(dim), ones(dim)
samples = sample(sampler, N_sk, N, xinit, vinit, seed=2025)

jointplot(samples)
Example block output
PDMPFlux.SpeedUpZigZagType
SpeedUpZigZag(dim::Int, ∇U::Function; grid_size::Int=10, tmax::Float64=1.0, 
    vectorized_bound::Bool=true, signed_bound::Bool=true, adaptive::Bool=true, kwargs...)

arguments for constructor

  • dim::Int: 空間の次元。
  • ∇U::Function: ポテンシャルエネルギー関数の勾配。
  • grid_size::Int: 空間を離散化するためのグリッドポイントの数。デフォルトは10。
  • tmax::Float64: グリッドのホライズン。デフォルトは1.0。0の場合、適応的なtmaxが使用されます。
  • vectorized_bound::Bool: 境界にベクトル化された戦略を使用するかどうか。デフォルトはtrue。
  • signed_bound::Bool: 符号付き境界戦略を使用するかどうか。デフォルトはtrue。
  • adaptive::Bool: 適応的なtmaxを使用するかどうか。デフォルトはtrue。
  • kwargs...: その他のキーワード引数。

attributes of a ZigZag construct

  • dim::Int: 空間の次元。
  • refresh_rate::Float64: リフレッシュレート。
  • ∇U::Function: ポテンシャルの勾配。
  • grid_size::Int: 空間を離散化するためのグリッドポイントの数。
  • tmax::Float64: グリッドのtmax。
  • adaptive::Bool: 適応的なtmaxを使用するかどうか。
  • vectorized_bound::Bool: ベクトル化された戦略を使用するかどうか。
  • signed_bound::Bool: 符号付き戦略を使用するかどうか。
  • flow::Function: インテグレータ関数。
  • rate::Array: プロセスのレート。
  • rate_vect::Array: ベクトル化されたレート。
  • signed_rate::Array: 符号付きレート。
  • signed_rate_vect::Array: ベクトル化され符号付きのレート。
  • velocity_jump::Function: 速度ジャンプ関数。
  • state: ZigZagサンプラーの状態。
source
PDMPFlux.StickyZigZagType
StickyZigZag(dim::Int, ∇U::Function; grid_size::Int=10, tmax::Float64=1.0, 
    vectorized_bound::Bool=true, signed_bound::Bool=true, adaptive::Bool=true, kwargs...)

arguments for constructor

  • dim::Int: dimension of the parameter space

  • ∇U::Function: gradient of the potential function (= negative log-likelihood function)

  • κ::Vector{Float64}: prior inclusion probability. default is fill(0.5, dim).

  • grid_size::Int: number of the grid points for discretization of the parameter space. default is 10.

  • tmax::Float64: グリッドのホライズン.デフォルトは1.0.0の場合、適応的なtmaxが使用されます.

  • vectorized_bound::Bool: 境界にベクトル化された戦略を使用するかどうか.デフォルトはtrue.

  • signed_bound::Bool: 符号付き境界戦略を使用するかどうか.デフォルトはtrue.

  • adaptive::Bool: 適応的なtmaxを使用するかどうか.デフォルトはtrue.

  • kwargs...: その他のキーワード引数.

attributes of a ZigZag construct

  • dim::Int: 空間の次元.
  • refresh_rate::Float64: リフレッシュレート.
  • ∇U::Function: ポテンシャルの勾配.
  • grid_size::Int: 空間を離散化するためのグリッドポイントの数.
  • tmax::Float64: グリッドのtmax.
  • adaptive::Bool: 適応的なtmaxを使用するかどうか.
  • vectorized_bound::Bool: ベクトル化された戦略を使用するかどうか.
  • signed_bound::Bool: 符号付き戦略を使用するかどうか.
  • flow::Function: インテグレータ関数.
  • rate::Array: プロセスのレート.
  • rate_vect::Array: ベクトル化されたレート.
  • signed_rate::Array: 符号付きレート.
  • signed_rate_vect::Array: ベクトル化され符号付きのレート.
  • velocity_jump::Function: 速度ジャンプ関数.
  • state: ZigZagサンプラーの状態.
source
PDMPFlux.ZigZagType
ZigZag(dim::Int, ∇U::Function; grid_size::Int=10, tmax::Float64=1.0, 
    vectorized_bound::Bool=true, signed_bound::Bool=true, adaptive::Bool=true, kwargs...)

arguments for constructor

  • dim::Int: 空間の次元。
  • ∇U::Function: ポテンシャルエネルギー関数の勾配。
  • grid_size::Int: 空間を離散化するためのグリッドポイントの数。デフォルトは10。
  • tmax::Float64: グリッドのホライズン。デフォルトは1.0。0の場合、適応的なtmaxが使用されます。
  • vectorized_bound::Bool: 境界にベクトル化された戦略を使用するかどうか。デフォルトはtrue。
  • signed_bound::Bool: 符号付き境界戦略を使用するかどうか。デフォルトはtrue。
  • adaptive::Bool: 適応的なtmaxを使用するかどうか。デフォルトはtrue。
  • kwargs...: その他のキーワード引数。

attributes of a ZigZag construct

  • dim::Int: 空間の次元。
  • refresh_rate::Float64: リフレッシュレート。
  • ∇U::Function: ポテンシャルの勾配。
  • grid_size::Int: 空間を離散化するためのグリッドポイントの数。
  • tmax::Float64: グリッドのtmax。
  • adaptive::Bool: 適応的なtmaxを使用するかどうか。
  • vectorized_bound::Bool: ベクトル化された戦略を使用するかどうか。
  • signed_bound::Bool: 符号付き戦略を使用するかどうか。
  • flow::Function: インテグレータ関数。
  • rate::Array: プロセスのレート。
  • rate_vect::Array: ベクトル化されたレート。
  • signed_rate::Array: 符号付きレート。
  • signed_rate_vect::Array: ベクトル化され符号付きのレート。
  • velocity_jump::Function: 速度ジャンプ関数。
  • state: ZigZagサンプラーの状態。
source
PDMPFlux.sampleMethod
sample():PDMPSampler からサンプルをするための関数.
sample_skeleton() と sample_from_skeleton() の wrapper.

Args:
    N_sk (Int): Number of skeleton points to generate.
    N_samples (Int): Number of final samples to generate from the skeleton.
    xinit (Array{Float64, 1}): Initial position.
    vinit (Array{Float64, 1}): Initial velocity.
    seed (Int): Seed for random number generation.
    verbose (Bool, optional): Whether to print progress information. Defaults to true.

Returns:
    Array{Float64, 2}: Array of samples generated from the PDMP model.
source
PDMPFlux.sample_from_skeletonMethod

スケルトンからサンプリングをし,各行ベクトルに次元毎の時系列が格納された Matrix{Float64} を返す.

Args: N (Int): The number of samples to generate. output (PdmpOutput): The PDMP output containing the trajectory information.

Returns: Array{Float64, 2}: The sampled points from the PDMP trajectory skeleton.

source
PDMPFlux.sample_skeletonMethod
sample_skeleton(): PDMP Samplers からスケルトンを抽出する.

Parameters:
- n_sk (Int): The number of skeleton samples to generate.
- xinit (Array{Float64, 1}): The initial position of the particles.
- vinit (Array{Float64, 1}): The initial velocity of the particles.
- seed (Int): The seed value for random number generation.
- verbose (Bool): Whether to display progress bar during sampling. Default is true.

Returns:
- output: The output state of the sampling process.
source