pystra.mc.ImportanceSampling#
- class ImportanceSampling(analysis_options=None, limit_state=None, stochastic_model=None)[source]#
Bases:
CrudeMonteCarlo
Importance Sampling
To decrease the number of simulations and the coefficient of variation, other methods can be performed. One commonly applied method is the Importance Sampling simulation method (IS).
- Attributes:
analysis_option (AnalysisOption): Option for the structural analysis
limit_state (LimitState): Information about the limit state
stochastic_model (StochasticModel): Information about the model
Methods
Compute beta value
Return an optimal amount of bins for a histogram
Compute Coefficient of Variation
Compute probability of failure
Evaluate limit-state function
Compute percent done
Compute random numbers
Collect result of sampling
Update summation
Compute transformation from u to x space
Returns the beta value
Returns the amount on bins
Returns data for the failure
Returns the probability of failure
Derived classes call this at top of their run()
Initialization of the simulation variables
run
Set design point
Show results and plots
- computeBeta()#
Compute beta value
- computeBins(samples)#
Return an optimal amount of bins for a histogram
- Returns:
bins (int): Returns amount on bins
- computeCoefficientOfVariation()#
Compute Coefficient of Variation
- computeFailureProbability()#
Compute probability of failure
- computeLimitState()#
Evaluate limit-state function
- computePercentDone()#
Compute percent done
- computeRandomNumbers()#
Compute random numbers
- computeResults()#
Collect result of sampling
- computeSumUpdate()#
Update summation
- computeTransformation()#
Compute transformation from u to x space
Note
TODO: this method takes a lot of time, find some better solution.
- getBeta()#
Returns the beta value
- Returns:
beta (float): Returns the beta value
- getBins()#
Returns the amount on bins
- Returns:
bins (int): Returns the amount on bins (histogram)
- getDistributionData()#
Returns data for the failure
- Returns:
all_G (float): Returns data from the distribution
- getFailure()#
Returns the probability of failure
- Returns:
Pf (float): Returns the probability of failure
- init_run()#
Derived classes call this at top of their run()
- initializeVariables()#
Initialization of the simulation variables
- setPoint(point=None)#
Set design point