contingency {PRA}R Documentation

Contingency Calculation.

Description

Contingency Calculation.

Usage

contingency(sims, phigh = 0.95, pbase = 0.5)

Arguments

sims

List of results from a Monte Carlo simulation.

phigh

Percentile level for contingency calculation.

pbase

Base level for contingency calculation.

Value

The function returns the value of calculated contingency.

Examples

num_sims <- 10000
task_dists <- list(
  list(type = "normal", mean = 10, sd = 2),  # Task A: Normal distribution
  list(type = "triangular", a = 5, b = 10, c = 15),  # Task B: Triangular distribution
  list(type = "uniform", min = 8, max = 12)  # Task C: Uniform distribution
)
cor_mat <- matrix(c(
  1, 0.5, 0.3,
  0.5, 1, 0.4,
  0.3, 0.4, 1
), nrow = 3, byrow = TRUE)
results <- mcs(num_sims, task_dists, cor_mat)
contingency <- contingency(results, phigh = 0.95, pbase = 0.50)
cat("Contingency based on 95th percentile and 50th percentile:", contingency)

[Package PRA version 0.2.0 Index]