weight_simulations
The RIFT.misc.weight_simulations module provides a centralized utility for aggregating results from multiple simulations. When RIFT performs multiple ILE (Inspiral-LAL-Engine) runs—either at the same intrinsic parameters with different draw counts or across different points in the intrinsic parameter space—the results must be combined into a single composite value.
The Weighted Average Framework
The core of the module is the AverageSimulationWeights function, which computes a set of weights $W_k$ such that a composite integral $I$ can be calculated as:
$$I = sum_{k} W_k I_k$$
where $I_k$ is the result of the $k$-th simulation.
Weighting Strategies
The module supports different strategies for determining the weights based on the weight_at_intrinsic parameter:
Variance-Minimizing (``sigma``): Weights are assigned proportional to the inverse of the variance: $$W_k propto frac{1}{sigma_k^2}$$ This is the statistically optimal approach for combining independent measurements with known uncertainties, ensuring that the most precise simulations have the greatest influence on the final result.
Uniform (``uniform``): Each simulation is assigned an equal weight ($W_k = 1/N$), treating all runs as equally reliable regardless of their individual variance.
Prior Volume Integration
To correctly account for the distribution of simulations across the parameter space, the module can incorporate prior volumes. If a prior_volume_list is provided (containing the pre-integrated prior volume $Delta P_k$ for each simulation), the weights are scaled accordingly:
$$W_{final} = W_{strategy} times Delta P_k$$
This ensures that simulations covering larger regions of the intrinsic prior volume contribute proportionally more to the composite result, effectively performing a discrete integration over the prior.
API Reference
- RIFT.misc.weight_simulations.AverageSimulationWeights(param_list, length_list, sigma_list, prior_volume_list=None, weight_at_intrinsic='sigma')
AverageSimulationWeights returns the factors W_k appearing in a simple average over N simulations, for example for the integral value
I = sum_k W_k I_k
- For backward compatibility, weights can be chosen that depend on
the number of draws for each simulation
the variance of each simulation
the parameter values of each simulation
priors, if the priors are provided as pre-integrated volumes (i.e., an array, one member per simulation). The user is assumed to have already identified volumes surrounding each simulation and integrated the prior accordingly. The user is responsible for the (in)accuracy of the resulting average, if the prior and likelihood vary significantly versus intrinsic parameters.
- Specific implementations and use cases include:
- single ILE run at fixed parameters, with different numbers of draws, either by variance-minimizing
I = (sum_k I_k /sigma_k^2) / sum_k 1/sigma_k^2
- or by a simple average over the N simulations
I = (sum_k I_k)/N N=# of simulations
multiple ILE runs at different parameters, accounting for an intrinsic prior volume Delta P_k for each simulation (normalized relative to the intrinsic prior: sum_k Delta P_k = (prior probability of lying in ellipsoid) << 1)
I =( sum_k I_k Delta P_k /sigma_k^2)/ sum_k 1/sigma_k^2