Sensitivity Problems

Types of Sensitivity Problems in Fortuna.jl

Fortuna.jl districts two types of sensitivity problems:

TypeDescription
IUsed to find sensitivities w.r.t. to the parameters $\vec{\Theta}_{g}$ of the limit state function $g(\vec{X}, \vec{\Theta}_{g})$
IIUsed to find sensitivities w.r.t. to the parameters and/or moments $\vec{\Theta}_{f}$ of the random vector $\vec{X}(\vec{\Theta}_{f})$

Defining and Solving Sensitivity Problems of Type I

In general, 4 main "items" are always needed to fully define a sensitivity problem of type I and successfully solve it to find the associated sensitivity vectors of probability of failure $\vec{\nabla}_{\vec{\Theta}_{g}} P_{f}$ and reliability index $\vec{\nabla}_{\vec{\Theta}_{g}} \beta$ w.r.t. to the parameters of the limit state function $\vec{\Theta}_{g}$:

ItemDescription
$\vec{X}$Random vector
$\rho^{X}$Correlation matrix
$g(\vec{X}, \vec{\Theta}_{g})$Limit state function parametrized in terms of its parameters
$\vec{\Theta}_{g}$Parameters of the limit state function

Fortuna.jl package uses these 4 "items" to fully define sensitivity problems of type I using SensitivityProblem() type as shown in the example below.

# Define the random vector:
M₁ = randomvariable("Normal",  "M", [250,   250   * 0.3])
M₂ = randomvariable("Normal",  "M", [125,   125   * 0.3])
P  = randomvariable("Gumbel",  "M", [2500,  2500  * 0.2])
Y  = randomvariable("Weibull", "M", [40000, 40000 * 0.1])
X  = [M₁, M₂, P, Y]

# Define the correlation matrix:
ρˣ = [
    1.0 0.5 0.3 0.0
    0.5 1.0 0.3 0.0
    0.3 0.3 1.0 0.0
    0.0 0.0 0.0 1.0]

# Define the limit state function:
g(x::Vector, θ::Vector) = 1 - x[1] / (θ[1] * x[4]) - x[2] / (θ[2] * x[4]) - (x[3] / (θ[3] * x[4])) ^ 2

# Define parameters of the limit state function:
s₁ = 0.030
s₂ = 0.015
a  = 0.190
Θ  = [s₁, s₂, a]

# Define a sensitivity problem:
Problem = SensitivityProblemTypeI(X, ρˣ, g, Θ)

After defining a sensitivity problem of type I, Fortuna.jl allows to easily perform sensitivity analysis using a single solve() function as shown in the example below.

# Perform the sensitivity analysis:
Solution = solve(Problem)
println("∇β   = $(Solution.∇β)  ")
println("∇PoF = $(Solution.∇PoF)")
∇β   = [36.77263941724517, 73.54527883449035, 9.257376773214814]
∇PoF = [-0.7013033431894955, -1.402606686378991, -0.17655053820193523]

Defining and Solving Sensitivity Problems of Type II

Similar to sensitivity problem of type I, 4 main "items" are needed to fully define a sensitivity problem of type II and successfully solve it to find the associated sensitivity vectors of probability of failure $\vec{\nabla}_{\vec{\Theta}_{f}} P_{f}$ and reliability index $\vec{\nabla}_{\vec{\Theta}_{f}} \beta$ w.r.t. to the parameters and/or moments of the random vector $\vec{\Theta}_{f}$:

ItemDescription
$\vec{X}(\vec{\Theta}_{f})$Random vector with correlated non-normal marginals parameterized in terms of its parameters and/or moments
$\rho^{X}$Correlation matrix
$g(\vec{X})$Limit state function
$\vec{\Theta}_{f}$Parameters and/or moments of the random vector

Fortuna.jl package uses these 4 "items" to fully define sensitivity problems of type I using SensitivityProblem() type as shown in the example below.

# Define the random vector as a function of its parameters and moments:
function XFunction(Θ::Vector)
    M₁ = randomvariable("Normal",  "M", [Θ[1], Θ[2]])
    M₂ = randomvariable("Normal",  "M", [Θ[3], Θ[4]])
    P  = randomvariable("Gumbel",  "M", [Θ[5], Θ[6]])
    Y  = randomvariable("Weibull", "M", [Θ[7], Θ[8]])

    return [M₁, M₂, P, Y]
end

# Define the correlation matrix:
ρˣ = [
    1.0 0.5 0.3 0.0
    0.5 1.0 0.3 0.0
    0.3 0.3 1.0 0.0
    0.0 0.0 0.0 1.0]

# Define the parameters and moments of the random vector:
Θ = [
      250,   250 * 0.30,
      125,   125 * 0.30,
     2500,  2500 * 0.20,
    40000, 40000 * 0.10]

# Define the limit state function:
a            = 0.190
s₁           = 0.030
s₂           = 0.015
g(x::Vector) = 1 - x[1] / (s₁ * x[4]) - x[2] / (s₂ * x[4]) - (x[3] / (a * x[4])) ^ 2

# Define a sensitivity problem:
Problem  = SensitivityProblemTypeII(XFunction, ρˣ, g, Θ)

Similar to sensitivity problems of type I, sensitivity problems of type II are solved using the same solve() function as shown in the example below.

# Perform the sensitivity analysis:
Solution = solve(Problem)
println("∇β   = $(Solution.∇β)  ")
println("∇PoF = $(Solution.∇PoF)")
∇β   = [-0.003237735338077213, -0.003916604639974047, -0.0064754706761544, -0.007833209279948062, -0.0005458335615225447, -0.0007886353662089076, 0.0001236607538348522, -0.0002452925503621403]
∇PoF = [6.174793686121609e-5, 7.469488107174497e-5, 0.0001234958737224317, 0.00014938976214348934, 1.0409774973652596e-5, 1.5040329648472443e-5, -2.358375723365793e-6, 4.6780565212235696e-6]

API

Fortuna.solveMethod
solve(Problem::SensitivityProblemTypeI; diff::Symbol = :automatic)

Function used to solve sensitivity problems of type I (sensitivities w.r.t. the parameters of the limit state function).
If diff is:

  • :automatic, then the function will use automatic differentiation to compute gradients, jacobians, etc.
  • :numeric, then the function will use numeric differentiation to compute gradients, jacobians, etc.
Fortuna.solveMethod
solve(Problem::SensitivityProblemTypeII; diff::Symbol = :automatic)

Function used to solve sensitivity problems of type II (sensitivities w.r.t. the parameters of the random vector).
If diff is:

  • :automatic, then the function will use automatic differentiation to compute gradients, jacobians, etc.
  • :numeric, then the function will use numeric differentiation to compute gradients, jacobians, etc.
Fortuna.SensitivityProblemTypeIType
SensitivityProblemTypeI <: AbstractReliabilityProblem

Type used to define sensitivity problems of type I (sensitivities w.r.t. the parameters of the limit state function).

  • X::AbstractVector{<:UnivariateDistribution}: Random vector $\vec{X}$

  • ρˣ::AbstractMatrix{<:Real}: Correlation matrix $\rho^{X}$

  • g::Function: Limit state function $g(\vec{X}, \vec{\Theta})$

  • Θ::AbstractVector{<:Real}: Parameters of limit state function $\vec{\Theta}$

Fortuna.SensitivityProblemTypeIIType
SensitivityProblemTypeII <: AbstractReliabilityProblem

Type used to define sensitivity problems of type II (sensitivities w.r.t. the parameters of the random vector).

  • X::Function: Random vector $\vec{X}(\vec{\Theta})$

  • ρˣ::AbstractMatrix{<:Real}: Correlation matrix $\rho^{X}$

  • g::Function: Limit state function $g(\vec{X})$

  • Θ::AbstractVector{<:Real}: Parameters of limit state function $\vec{\Theta}$

Fortuna.SensitivityProblemCacheType
SensitivityProblemCache

Type used to store results of sensitivity analysis for problems of type I (sensitivities w.r.t. the parameters of the limit state function).

  • FORMSolution::iHLRFCache: Results of reliability analysis performed using First-Order Reliability Method (FORM)

  • ∇β::Vector{Float64}: Sensivity vector of reliability index $\vec{\nabla}_{\vec{\Theta}} \beta$

  • ∇PoF::Vector{Float64}: Sensivity vector of probability of failure $\vec{\nabla}_{\vec{\Theta}} P_{f}$