Nothing
## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
## ----setup--------------------------------------------------------------------
library(dist.structure)
library(algebraic.dist)
## -----------------------------------------------------------------------------
sys <- bridge_dist(replicate(5, exponential(1), simplify = FALSE))
min_paths(sys)
min_cuts(sys)
## -----------------------------------------------------------------------------
sapply(1:5, function(j) structural_importance(sys, j))
## -----------------------------------------------------------------------------
p <- 0.9
sapply(1:5, function(j) birnbaum_importance(sys, j, p))
## -----------------------------------------------------------------------------
t_vals <- c(0.1, 0.5, 1, 2)
sapply(t_vals, function(t) {
sapply(1:5, function(j) criticality_importance(sys, j, t))
})
## -----------------------------------------------------------------------------
t0 <- 1
sapply(1:5, function(j) vesely_fussell_importance(sys, j, t0))
## -----------------------------------------------------------------------------
# Build a comparison table at p = 0.9 and t s.t. S(t) = 0.9 for all components.
# For iid Exp(1), S(t) = 0.9 -> t = -log(0.9)
t_star <- -log(0.9)
tab <- data.frame(
j = 1:5,
structural = sapply(1:5, function(j) structural_importance(sys, j)),
birnbaum = sapply(1:5, function(j) birnbaum_importance(sys, j, 0.9)),
criticality = sapply(1:5, function(j) criticality_importance(sys, j, t_star)),
vesely_fussell = sapply(1:5, function(j) vesely_fussell_importance(sys, j, t_star))
)
tab
## -----------------------------------------------------------------------------
# Series: Birnbaum importance of j equals product of the OTHER p's.
series3 <- series_dist(replicate(3, exponential(1), simplify = FALSE))
p_vec <- c(0.9, 0.8, 0.7)
birnbaum_importance(series3, j = 1, p = p_vec)
prod(p_vec[-1])
## -----------------------------------------------------------------------------
# Parallel: Birnbaum importance of j equals product of the OTHER (1 - p_i).
parallel3 <- parallel_dist(replicate(3, exponential(1), simplify = FALSE))
birnbaum_importance(parallel3, j = 1, p = p_vec)
prod(1 - p_vec[-1])
## -----------------------------------------------------------------------------
# Series: Vesely-Fussell equals F_j / F_sys at time t, since each
# component forms its own min cut.
t0 <- 1
F_j_1 <- 1 - exp(-t0)
F_sys <- 1 - exp(-3 * t0) # Exp(sum(rates) = 3)
vesely_fussell_importance(series3, j = 1, t = t0)
F_j_1 / F_sys
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.