matflow.subset_simulation.subset_simulation#
Module containing functions to run a subset simulation on a simple toy model, used as a validation of the MatFlow implementation.
Functions
Adjoint (transpose-Jacobian action) for transformation = lambda x: np.cumsum(x, axis=-1). |
|
Return a string representation of a distribution. |
|
Estimate the coefficient of variation at a given conditional level of the subset simulation. |
|
Generate one conditional Subset Simulation level using MMH. |
|
Generate one conditional level using adaptive conditional sampling (aka adaptive subset infinity). |
|
Generate one conditional level using conditional sampling (aka subset infinity). |
|
Generate one conditional level using fixed-subchain RST. |
|
Delayed-acceptance modified Metropolis algorithm for subset simulation. |
|
Proposal must be a symmetric distribution centred on zero. |
|
|
|
Analytic failure threshold for a 'weakest-link' (series-system) toy model: the system response is the maximum over dimension iid standard normal components, so P(max(X) <= y) = Phi(y)**dimension, giving an exact threshold for a target failure probability. |
|
Note temperature should be of a similar order of magnitude to g_coarse and threshold. |
|
Partition dimension fine grid points into contiguous blocks of block_size (the last block may be smaller), representing a coarser mesh voxelisation. |
|
Run a convergence test on the toy model subset simulation, for either number of samples per level, N, or number of repeats, R. |
|
Estimate failure probability using Subset Simulation. |
|
x is within the failure domain if the return is greater than zero. |
|
Coarse-grain x (..., dimension) by averaging within each block defined by group_idx, broadcasting each block's mean back over its fine positions (so fine and coarse fields live in the same space). |
|
Analytic gradient of weakest_link_performance_coarse (i.e. |
|
'Coarse mesh' weakest-link performance: as weakest_link_performance_fine, but evaluated on a block-averaged (coarser-voxelised) version of the field. |
|
'Fine mesh' weakest-link performance: the system fails if the peak local response (max over all dimension fine grid points) exceeds y_star -- e.g. |