Welcome to hypertransform’s documentation!
API Reference
- hypertransform.hypertransform.hypercubify(y, bounds=(0, 1))
Inverse of hypertriangulate. Maps from the hypertriangle to the hypercube.
The (unit) transformation is defined by:
\[x_i = 1 - [(1 - y_i)/(1 - y_{i-1})]^{n-i}\]- Parameters:
y (array) – The hypertriangle parameter values. The components of y are sorted in ascending order. Input shape = (num_dim,) or (num_points, num_dim). If input array is multi-dimensional, the function is vectorised along all except the last axis.
bounds (tuple) – Lower and upper bounds of parameter space. Default is to transform between the unit hypercube and unit hypertriangle with (0, 1).
- Returns:
x – The hypercube parameter values. The components of x are in no particular order.
- Return type:
array, shaped like x
- hypertransform.hypertransform.hypertriangulate(x, bounds=(0, 1))
Transform a vector of numbers from the hypercube to the hypertriangle.
The hypercube is the space the samplers usually work in; the components of x are in no particular order.
The hypertriangle is the space where the components are sorted into ascenting order, ( y0 < y1 < … < yn ).
The (unit) transformation is defined by:
\[y_j = 1 - \prod_{i=0}^{j} (1 - x_i)^{1/(n-i)}\]Example application. If we are analysing a number num_dim of DWD sources, all with identical priors. Then this function would be called on the array np.array([f_1, f_2, …, f_num_sources]) with bounds=(f_min, f_max).
- Parameters:
x (array) – The hypercube parameter values. The components of x are in no particular order. Input shape = (num_dim,) or (num_points, num_dim). If input array is multi-dimensional, the function is vectorised along all except the last axis.
bounds (tuple) – Lower and upper bounds of parameter space. Default is to transform between the unit hypercube and unit hypertriangle with (0, 1).
- Returns:
y – The hypertriangle parameter values The components of y are sorted in ascending order.
- Return type:
array, shaped like x