Adaptive sampling implements importance sampling using multiple adaptation steps. The first step scales all designs by an initial blow up factor in standard-normal space. The objective of the scaling is to obtain a reasonable number of samples in the failure domain during the 1st step. Hence, the blow up factor should be chosen according to the failure probability pf the problem. While generating the samples one ignores samples which are further away than
max_allowed_sigma_
from the origin in standard normal space. The reason is that importance weights become inaccurate for samples being that far away.
After sampling the user-defined number of samples in a single step, the median and covariance matrix of the sampling density function of the next step will be determined according to the statistics of the samples lying in the failure domain. A modified eigenvalue decomposition of the covariance matrix ensures positive definiteness. Furthermore, if the C.O.V. of Pf is relatively large, the covariance matrix is scaled such that it is closer to the identity matrix.
The user defines the number of steps and the number of samples per step. If any of the solver calls fails, the corresponding sample is either ignored or (if one tells the algorithm to interpret the failed run as a failure event) is accounted to the failure domain.
Raises an exception
This class cannot be instantiated from Python
adapt()
Creates internally the next set of designs. This is called within the loop after Appraise and prepares the next call of get_next_designs.
appraise()
Performs a search step by the internal reliability algorithm. This is called after simulation and setting results and used inputs. The method reads all given information (and eventually performs one internal search step). After calling this method it should be possible to check the state of the iteration by is_terminated().
can_provide_probability_of_failure() → bool
Returns true when the probability of failure can be calculated.
finalize()
Finalizes the iteration. Does whatever is neccessary to finalize - delete pointers, collect data…
Returns the standard deviation of the estimator of the probability of failure. It should be called after finalize(). If this quantity does not make sense (i.e. in case of FORM), it returns zero.
Returns the ids for the next set of design vectors for which responses must be computed. This method is called at the begin of the iteration loop. It returns a reference to the internally stored set of infos of awaiting designs.
Returns some information for the next set of design vectors for which responses must be computed. This method is called at the begin of the iteration loop. It returns a reference to the internally stored set of infos of awaiting designs.
Returns the next set of design vectors for which responses must be computed. This method is called at the begin of the iteration loop. It returns a reference to the internally stored set of awaiting designs.
get_num_awaiting_designs() → int
get_num_computed_samples() → int
get_num_function_calls() → int
get_num_inputs() → int
get_num_safety_margins() → int
get_num_successfully_computed_samples() → int
get_probability_of_failure() → float
Returns the probability of failure.
get_reliability_index() → float
The default implementation calls GetProbabilityOfFailure and computes beta from that. It should be called after finalize().
(re)sets the algorithm using the given definition data (“settings”). It must be called at least once before starting the iteration loop. It may be called several times during the lifetime of an algorithm object (then clears old data, reallocates and resets).
is_converged() → bool
Returns true if the iteration loop has converged. This method returns true if the algorithm has terminated and converged.
is_terminated() → bool
Returns true if the iteration loop must be terminated. This method returns true if the algorithm has finished. If it either converged (or diverged or any other termination criterion is satisfied).
restart()
(re)sets the algorithm without touching the settings and maybe time-consuming pre-calculations. Initialize must be called at least once before.
Sets the success flags of the actually computed designs. It must be called before Appraise. The input argument tells the algorithm for which design point vector the external solver failed (or returned senseless results).
Sets the failure event flags of the actually computed designs without successful solver run. It must be called before Appraise. The input argument tells the algorithm for which design point vector the value success_info_[i]=false can be interpreted as a failure event.
class reliability.ReliabilityMonteCarlo
This algorithm implements Monte Carlo sampling.
The algorithm can be controlled either by a predefined number of samples, or by a desired accuracy (c.o.v.) of the estimator of Pf (or of (1-Pf) if Pf>0.5). In the latter case, the number of required samples will be selected by the algorithm during the iteration. The convergence test is carried out after each request of n parallel designs. If the desired accuracy can not be reached within the maximum allowed number of samples, the algorithm terminates without success.
If any of the solver requests fails (success_info=false for a specific design) the algorithm either ignores this design, or it counts it as a failure event.
__init__()
class reliability.SettingsARSMDS
Reliability algorithm settings for ARSM with Directional Sampling.