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

computeBeta

Compute beta value

computeBins

Return an optimal amount of bins for a histogram

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

getBeta

Returns the beta value

getBins

Returns the amount on bins

getDistributionData

Returns data for the failure

getFailure

Returns the probability of failure

init_run

Derived classes call this at top of their run()

initializeVariables

Initialization of the simulation variables

run

setPoint

Set design point

showResults

Show results and plots

showResults()[source]#

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