Internal API

Note

This is the documentation of AHMI's internal API, it is subject to change without deprecation.

Types

Functions and macros

Documentation

AHMI.DataSetType
DataSet{T<:AbstractFloat, I<:Integer}

AHMI-internal, not part of stable public API.

Holds the MCMC output. For construction use constructor: function DataSet{T<:Real}(data::Matrix{T}, logprob::Vector{T}, weights::Vector{T})

Variables

  • 'data' : An P x N array with N data points with P parameters.
  • 'logprob' : The logarithmic probability for each samples stored in an array
  • 'weights' : How often each sample occurred. Set to an array of ones if working directly on MCMC output
  • 'ids' : Array which is used to assign each sample to a batch, required for the cov. weighed uncertainty estimation
  • .sortids : an array of indices which stores the original ordering of the samples (the space partitioning tree reorders the samples), required to calculate an effective sample size.
  • 'N' : number of samples
  • 'P' : number of parameters
  • 'nsubsets' : the number of batches
  • 'iswhitened' : a boolean value which indicates whether the data set is iswhitened
  • 'isnew' : a boolean value which indicates whether the data set was swapped out with a different one (it is possible to redo the integration with a different sample set using previously generated hyper-rectangles)
  • 'partitioningtree' : The space partitioning tree, used to efficiently identify samples in a point cloud
  • 'startingIDs' : The Hyper-Rectangle Seed Samples are stored in this array
  • 'tolerance' : A threshold required for the hyper-rectangle creation process.
source
AHMI.HMIDataType
HMIData{T<:AbstractFloat, I<:Integer}

AHMI-internal, not part of stable public API.

Includes all the informations of the integration process, including a list of hyper-rectangles, the results of the whitening transformation, the starting ids, and the average number of points and volume of the created hyper-rectangles.

Variables

  • 'dataset1' : Data Set 1
  • 'dataset2' : Data Set 2
  • 'whiteningresult' : contains the whitening matrix and its determinant, required to scale the final integral estimate
  • 'volumelist1' : An array of integration volumes created using dataset1, but filled with samples from dataset2
  • 'volumelist2' : An array of integration volumes created using dataset2, but filled with samples from dataset1
  • 'cubelist1' : An array of small hyper-cubes created around seeding samples of dataset 1
  • 'cubelist2' : An array of small hyper-cubes created around seeding samples of dataset 2
  • 'iterations1' : The number of volume adapting iterations for the creating volumelist1
  • 'iterations2' : The number of volume adapting iterations for the creating volumelist2
  • 'rejectedrects1' : An array of ids, indicating which hyper-rectangles of volumelist1 were rejected due to trimming
  • 'rejectedrects2' : An array of ids, indicating which hyper-rectangles of volumelist2 were rejected due to trimming
  • 'integralestimates' : A dictionary containing the final integral estimates with uncertainty estimation using different uncertainty estimators. Also includes all intermediate results required for the integral estimate combination
source
AHMI.HMISettingsType
HMISettings

AHMI-internal, not part of stable public API.

holds the settings for the hm_integrate function. There are several default constructors available: HMIFastSettings() HMIStandardSettings() HMIPrecisionSettings()

#Variables

  • 'whitening_method::Symbol' : which whitening method to use
  • 'max_startingIDs::Integer' : influences how many starting ids are allowed to be generated
  • 'maxstartingIDsfraction::AbstractFloat' : how many points are considered as possible starting points as a fraction of total points available
  • 'rect_increase::AbstractFloat' : describes the procentual rectangle volume increase/decrease during hyperrectangle creation. Low values can increase the precision if enough points are available but can cause systematically wrong results if not enough points are available.
  • 'useallrects::Bool' : All rectangles are used for the integration process no matter how big their overlap is. If enabled the rectangles are weighted by their overlap.
  • 'useMultiThreading' : activate multithreading support.
  • 'warning_minstartingids' : the required minimum amount of starting samples
  • 'dotrimming' : determines whether the integral estimates are trimmed (1σ trim) before combining them into a final result (more robust)
  • 'uncertaintyestimators' : A dictionary of different uncertainty estimator functions. Currently three functions are available: hmcombineresultslegacy! (outdated, overestimates uncertainty significantly in higher dimensions), hmcombineresultscovweighted! (very fast) and hmcombineresults_analyticestimation! (recommended)

end

source
AHMI.IntegrationVolumeType
IntegrationVolume{T<:AbstractFloat, I<:Integer}

AHMI-internal, not part of stable public API.

Variables

  • 'pointcloud' : holds the point cloud of the integration volume
  • 'spatialvolume' : the boundaries of the integration volume
  • 'volume' : the volume

Hold the point cloud and the spatial volume for integration.

source
AHMI.PointCloudType
PointCloud{T<:AbstractFloat, I<:Integer}

AHMI-internal, not part of stable public API.

Stores the information of the points of an e.g. HyperRectVolume

Variables

  • 'maxLogProb' : The maximum log. probability of one of the points inside the hyper-rectangle
  • 'minLogProb' : The minimum log. probability of one of the points inside the hyper-rectangle
  • 'maxWeightProb' : the weighted max. log. probability
  • 'minWeightProb' : the weighted min. log. probability
  • 'probfactor' : The probability factor of the hyper-rectangle
  • 'probweightfactor' : The weighted probability factor
  • 'points' : The number of points inside the hyper-rectangle
  • 'pointIDs' : the IDs of the points inside the hyper-rectangle, might be empty because it is optional and costs performance
  • 'searchres' : used to boost performance
source
AHMI.SearchResultType
SearchResult{T<:AbstractFloat, I<:Integer}

AHMI-internal, not part of stable public API.

Stores the results of the space partitioning tree's search function

Variables

  • 'pointIDs' : the IDs of samples found, might be empty because it is optional
  • 'points' : The number of points found.
  • 'maxLogProb' : the maximum log. probability of the points found.
  • 'minLogProb' : the minimum log. probability of the points found.
  • 'maxWeightProb' : the weighted minimum log. probability found.
  • 'minWeightProb' : the weighted maximum log. probfactor found.
source
AHMI.WhiteningResultType
WhiteningResult{T<:AbstractFloat}

AHMI-internal, not part of stable public API.

Stores the information obtained during the Whitening Process

Variables

  • 'determinant' : The determinant of the whitening matrix
  • 'targetprobfactor' : The suggested target probability factor
  • 'whiteningmatrix' : The whitening matrix
  • 'meanvalue' : the mean vector of the input data
source
AHMI.create_hypercubeFunction
create_hypercube{T<:Real}(origin::Vector{T}, edgelength::T)::HyperRectVolume

AHMI-internal, not part of stable public API.

creates a hypercube shaped spatial volume

source
AHMI.create_hyperrectangleFunction
create_hyperrectangle(...)

AHMI-internal, not part of stable public API.

This function creates a hyper-rectangle around each starting sample. It starts by building a hyper-cube and subsequently adapts each face individually, thus turning the hyper-cube into a hyper-rectangle. The faces are adjusted in a way to match the shape of the distribution as best as possible.

source
AHMI.find_hypercube_centersFunction
find_hypercube_centers(dataset::DataSet{T, I}, whiteningresult::WhiteningResult, settings::HMISettings)::Vector{I}

AHMI-internal, not part of stable public API.

finds possible starting points for the hyperrectangle creation

source
AHMI.hm_initFunction
hm_init!(result, settings)

AHMI-internal, not part of stable public API.

Sets the global multithreading setting and ensures that a minimum number of samples, dependent on the number of dimensions, are provided.

source
AHMI.hm_integrate!Function
hm_integrate!(result, settings = HMIPrecisionSettings())

AHMI-internal, not part of stable public API.

This function starts the adaptive harmonic mean integration. See arXiv:1808.08051 for more details. It needs a HMIData struct as input, which holds the samples, in form of a dataset, the integration volumes and other properties, required for the integration, and the final result.

source
AHMI.hm_whiteningtransformation!Function
hm_whiteningtransformation!(result, settings)

AHMI-internal, not part of stable public API.

Applies a whitening transformation to the samples. A custom whitening method can be used by overriding settings.whitening_function!

source
AHMI.hyperrectangle_creationproccess!Function
hyperrectangle_creationproccess!(...)

AHMI-internal, not part of stable public API.

This function assigns each thread its own hyper-rectangle to build, if in multithreading-mode.

source
AHMI.modify_hypercube!Function
create_hypercube!{T<:Real}(origin::Vector{T}, edgelength::T)::HyperRectVolume

AHMI-internal, not part of stable public API.

resizes a hypercube shaped spatial volume

source
AHMI.modify_integrationvolume!Function
modify_integrationvolume!(intvol::IntegrationVolume{T, I}, dataset::DataSet{T, I}, spvol::HyperRectVolume{T}, searchpts::Bool = true)

AHMI-internal, not part of stable public API.

updates an integration volume with new boundaries. Recalculates the pointcloud and volume.

source
AHMI.reduced_volume_hmFunction
reduced_volume_hm!(log_prob, sample_weights, volume_size, n_total, weight_total, bias_correction==true)

Estimate reduced volume harmonic mean for given arguments. Includes bias corection by default. Note: Weights are expected to be frequency weights (i.e. counts).

source