Deborah.Miriam.CumulantsBundle
Deborah.Miriam.CumulantsBundle.compute_cumulants_bundle — Methodcompute_cumulants_bundle(
N_bs::Int,
blk_size::Int,
method::String,
V::Int,
trMi_all_bundle::Vector{Vector{Vector{T}}},
rw_bundle::ReweightingBundle.ReweightingSolverBundle,
jobid::Union{Nothing, String}=nothing;
rng_pool::Union{Nothing, SeedManager.RNGPool} = nothing,
idx_all::Union{Nothing, Vector{Vector{Int}}} = nothing,
idx_lb::Union{Nothing, Vector{Vector{Int}}} = nothing,
idx_bc::Union{Nothing, Vector{Vector{Int}}} = nothing,
idx_ul::Union{Nothing, Vector{Vector{Int}}} = nothing
) where T -> (
Vector{Vector{Float64}},
Vector{Vector{Float64}},
Vector{Vector{Float64}},
Dict{Symbol, Vector{Vector{Int}}}
)Compute bootstrap estimates of cumulants using multi-ensemble reweighting.
This function computes bootstrap-resampled cumulants (cond, sus, skew, kurt, bind) from multiple estimators, namely: OG (original), P1 (bias-corrected), P2 (weighted blend of LB and P1).
Each trace entry is reweighted by the corresponding weight field w from Deborah.Miriam.ReweightingBundle.ReweightingSolverBundle.
Arguments
N_bs::Int: Number of bootstrap resamples.blk_size::Int: Default block size for bootstrap resampling.method::String: Block-bootstrap scheme (case-sensitive):"nonoverlapping"— Nonoverlapping Block Bootstrap (NBB; resample disjoint blocks)."moving"— Moving Block Bootstrap (MBB; resample sliding windows)."circular"— Circular Block Bootstrap (CBB; sliding windows with wrap-around).
V::Int: Lattice volume (e.g., $N_S^3 \times N_T$).trMi_all_bundle::Vector{Vector{Vector{T}}}: Trace data bundle;trMi_all_bundle[i][j]is thej-th configuration in solveri.rw_bundle::ReweightingBundle.ReweightingSolverBundle: Solver bundle containing.wfields used for reweighting.jobid::Union{Nothing, String}: Optional logging context.rng_pool::Union{Nothing, SeedManager.RNGPool}: Optional RNG pool for deterministic sampling.idx_all: Optional bootstrap indices for original data.idx_lb: Optional bootstrap indices for labeled set.idx_bc: Optional indices for bias correction set.idx_ul: Optional indices for unlabeled set.
Returns
cumulants_OG_bs::Vector{Vector{Float64}}: Bootstrap cumulants from original data.cumulants_P1_bs::Vector{Vector{Float64}}: Cumulants usingP1estimator.cumulants_P2_bs::Vector{Vector{Float64}}: Cumulants usingP2estimator.idx_bundle::Dict{Symbol, Vector{Vector{Int}}}: Dictionary containing the bootstrap indices used.
Notes
- If
idx_*arguments are omitted, new bootstrap indices are generated.
Deborah.Miriam.CumulantsBundle.compute_cumulants_bundle_raw — Methodcompute_cumulants_bundle_raw(
N_bs::Int,
blk_size::Int,
method::String,
V::Int,
trMi_all_bundle::Vector{Vector{Vector{T}}},
ens_bundle::Ensemble.EnsembleArrayBundle{T},
ens_idx::Int,
jobid::Union{Nothing, String}=nothing;
rng_pool::Union{Nothing, SeedManager.RNGPool} = nothing,
idx_all::Union{Nothing, Vector{Vector{Int}}} = nothing,
idx_lb::Union{Nothing, Vector{Vector{Int}}} = nothing,
idx_bc::Union{Nothing, Vector{Vector{Int}}} = nothing,
idx_ul::Union{Nothing, Vector{Vector{Int}}} = nothing
) where T -> (
Vector{Vector{Float64}},
Vector{Vector{Float64}},
Vector{Vector{Float64}},
Dict{Symbol, Vector{Vector{Int}}}
)Compute bootstrap estimates of cumulants for single ensemble.
This function performs block bootstrap resampling and computes cumulants from structured subsets of trace data – original, labeled, bias-corrected, and unlabeled – extracted from a bundle of ensembles.
Arguments
N_bs::Int: Number of bootstrap resamples.blk_size::Int: Default block size for bootstrap resampling.method::String: Block-bootstrap scheme (case-sensitive):"nonoverlapping"— Nonoverlapping Block Bootstrap (NBB; resample disjoint blocks)."moving"— Moving Block Bootstrap (MBB; resample sliding windows)."circular"— Circular Block Bootstrap (CBB; sliding windows with wrap-around).
V::Int: Lattice volume (e.g., $N_S^3 \times N_T$).trMi_all_bundle::Vector{Vector{Vector{T}}}: Trace moment inputs;trMi_all_bundle[i][j]holds thej-th configuration of thei-th estimator.ens_bundle::Ensemble.EnsembleArrayBundle{T}: Bundle of ensemble data matching the structure oftrMi_all_bundle.ens_idx::Int: Index of the ensemble to process (same across all estimators).jobid::Union{Nothing, String}: Optional logging context.rng_pool::Union{Nothing, SeedManager.RNGPool}: Optional RNG pool for reproducible sampling.idx_all: Optional bootstrap indices for original data.idx_lb: Optional bootstrap indices for labeled set.idx_bc: Optional bootstrap indices for bias correction set.idx_ul: Optional bootstrap indices for unlabeled set.
Returns
cumulants_OG_bs::Vector{Vector{Float64}}: Bootstrap samples of cumulants from the original dataset.cumulants_P1_bs::Vector{Vector{Float64}}: Bootstrap samples using theP1estimator (bias-corrected).cumulants_P2_bs::Vector{Vector{Float64}}: Bootstrap samples using theP2estimator (weightedLB+P1).idx_bundle::Dict{Symbol, Vector{Vector{Int}}}: Bundle of bootstrap indices actually used for resampling.
Notes
- If index arguments are omitted, new bootstrap indices are generated and returned via
idx_bundle.
Deborah.Miriam.CumulantsBundle.compute_moments_bundle_raw — Methodcompute_moments_bundle_raw(
N_bs::Int,
blk_size::Int,
method::String,
trMi_all_bundle::Vector{Vector{Vector{T}}},
ens_bundle::Ensemble.EnsembleArrayBundle{T},
ens_idx::Int,
jobid::Union{Nothing, String}=nothing;
rng_pool::Union{Nothing, SeedManager.RNGPool} = nothing,
idx_all::Union{Nothing, Matrix{Int}} = nothing,
idx_lb ::Union{Nothing, Matrix{Int}} = nothing,
idx_bc ::Union{Nothing, Matrix{Int}} = nothing,
idx_ul ::Union{Nothing, Matrix{Int}} = nothing
) where T -> (
Vector{Vector{Float64}},
Vector{Vector{Float64}},
Vector{Vector{Float64}},
Dict{Symbol, Union{Nothing, Matrix{Int}}}
)Compute bootstrap estimates of moments $Q_{n} \; (n=1,2,3,4)$ for single ensemble. This mirrors the structure of compute_cumulants_bundle_raw but returns moment components instead of cumulants.
Arguments
N_bs::Int: Number of bootstrap resamples.blk_size::Int: Base block size for block bootstrap (per subset will be optimized).method::String: Bootstrap method identifier (e.g.,"moving","stationary").trMi_all_bundle::Vector{Vector{Vector{T}}}: For each array in the bundle, a vector of per-configuration trace vectors (e.g., length-5trMirows). Each innerVector{T}must be consumable byCumulants.calc_Q.ens_bundle::Ensemble.EnsembleArrayBundle{T}: Bundle containing the ensemble arrays.ens_idx::Int: Index of the target ensemble array insideens_bundle.jobid: Optional job identifier for logging.rng_pool::Union{Nothing, SeedManager.RNGPool}: Optional RNG pool (with fieldsrng,rng_lb,rng_bc,rng_ul); ifnothing, a new pool is created viaDeborah.Sarah.SeedManager.setup_rng_pool.idx_all,idx_lb,idx_bc,idx_ul: Optional bootstrap index plans for the subsets. If provided, they are used; otherwise plans are generated internally.
Returns
(moments_OG_bs, moments_P1_bs, moments_P2_bs, idx_bundle)where:moments_OG_bs::Vector{Vector{Float64}}=[Q1_ORG_bs, Q2_ORG_bs, Q3_ORG_bs, Q4_ORG_bs]moments_P1_bs::Vector{Vector{Float64}}=[Q1_P1_bs, Q2_P1_bs, Q3_P1_bs, Q4_P1_bs ]moments_P2_bs::Vector{Vector{Float64}}=[Q1_P2_bs, Q2_P2_bs, Q3_P2_bs, Q4_P2_bs ]EachQk_*_bsis a length-N_bsvector of bootstrap means.idx_bundle::Dict{Symbol, Union{Nothing, Matrix{Int}}}::all,:lb,:bc,:ul→ the index plans used for each subset (ornothing).
Notes
- Subset splitting uses
Deborah.Miriam.CumulantsBundleUtils.split_Q_fullon the tuple(Q1,Q2,Q3,Q4)per array. P1is constructed analogously to the cumulant pipeline:Y_P1 = (N_tr == N_lb) ? YP_UL : (YP_UL + (Y_BC - YP_BC)), applied component-wise toQ1,Q2,Q3,Q4.P2is the linear combination:Y_P2 = w_lb * Y_LB + w_ul * Y_P1withw_lb = N_lb/N_allandw_ul = N_ul/N_all.- If a subset is empty by construction (e.g.,
N_lb == 0), its bootstrap means are set to0.
Deborah.Miriam.CumulantsBundle.compute_traces_bundle_raw — Methodcompute_traces_bundle_raw(
N_bs::Int,
blk_size::Int,
method::String,
trMi_all_bundle::Vector{Vector{Vector{T}}},
ens_bundle::Ensemble.EnsembleArrayBundle{T},
ens_idx::Int,
jobid::Union{Nothing, String}=nothing;
rng_pool::Union{Nothing, SeedManager.RNGPool} = nothing,
idx_all::Union{Nothing, Matrix{Int}} = nothing,
idx_lb ::Union{Nothing, Matrix{Int}} = nothing,
idx_bc ::Union{Nothing, Matrix{Int}} = nothing,
idx_ul ::Union{Nothing, Matrix{Int}} = nothing
) where T -> (
Vector{Vector{Float64}},
Vector{Vector{Float64}},
Vector{Vector{Float64}},
Dict{Symbol, Union{Nothing, Matrix{Int}}}
)Compute bootstrap estimates of $\text{Tr} \, M^{-n} \; (n=1,2,3,4)$ for single ensemble. This mirrors compute_moments_bundle_raw but returns trace components instead of moments.
Arguments
N_bs::Int: Number of bootstrap resamples.blk_size::Int: Base block size for block bootstrap (per subset will be optimized).method::String: Bootstrap method identifier (e.g.,"moving","circular","nonoverlapping").trMi_all_bundle::Vector{Vector{Vector{T}}}: For each array in the bundle, a vector of per-configuration trace-moment rows (e.g., length-5trMi). Each innerVector{T}is processed byDeborah.Miriam.Cumulants.calc_traceto obtain $\text{Tr} \, M^{-n} \; (n=1,2,3,4)$.ens_bundle::Ensemble.EnsembleArrayBundle{T}: Bundle containing the ensemble arrays.ens_idx::Int: Index of the target ensemble array insideens_bundle.jobid: Optional job identifier for logging.rng_pool::Union{Nothing, SeedManager.RNGPool}: Optional RNG pool (with fieldsrng,rng_lb,rng_bc,rng_ul); ifnothing, a new pool is created viaDeborah.Sarah.SeedManager.setup_rng_pool.idx_all,idx_lb,idx_bc,idx_ul: Optional bootstrap index plans for the subsets. If provided, they are used; otherwise, plans are generated internally.
Returns
(traces_OG_bs, traces_P1_bs, traces_P2_bs, idx_bundle)where:traces_OG_bs::Vector{Vector{Float64}}=[trM1_ORG_bs, trM2_ORG_bs, trM3_ORG_bs, trM4_ORG_bs]traces_P1_bs::Vector{Vector{Float64}}=[trM1_P1_bs, trM2_P1_bs, trM3_P1_bs, trM4_P1_bs ]traces_P2_bs::Vector{Vector{Float64}}=[trM1_P2_bs, trM2_P2_bs, trM3_P2_bs, trM4_P2_bs ]EachtrMk_*_bsis a length-N_bsvector of bootstrap means.idx_bundle::Dict{Symbol, Union{Nothing, Matrix{Int}}}::all,:lb,:bc,:ul→ the index plans used for each subset (ornothing).
Notes
- Subset splitting follows the same tag logic as the cumulant/moment pipeline (
ORG/Y_LB/Y_BC/YP_BC/Y_UL/YP_UL). P1is constructed component-wise:Y_P1 = (N_tr == N_lb) ? YP_UL : (YP_UL + (Y_BC - YP_BC)).P2is the linear combination:Y_P2 = w_lb * Y_LB + w_ul * Y_P1, withw_lb = N_lb/N_allandw_ul = N_ul/N_all.- If a subset is empty by construction (e.g.,
N_lb == 0), its bootstrap means are set to0.