Appendix C — Quick Reference

A compact reference to every exported function in the PRA package. Arguments marked * are required; all others have defaults.

C.1 Monte Carlo Simulation

Function Key Arguments Returns Chapter
mcs(num_sims*, task_dists*, cor_mat) num_sims number of simulations; task_dists list of distribution specs; optional correlation matrix S3 object of class mcs with $simulations matrix, $total_distribution, percentiles Chapter 2
print.mcs(x) x an mcs object Console summary of P50/P80/P95 and task means Chapter 2

Distribution spec format (used by mcs(), sensitivity(), smm()):

list(type = "normal",     mean = 10, sd = 2)
list(type = "triangular", a = 5, b = 10, c = 15)   # a=min, b=mode, c=max
list(type = "uniform",    min = 8, max = 12)

C.2 Second Moment Method

Function Key Arguments Returns Chapter
smm(mean*, var*, cor_mat) Numeric vectors of task means and variances; optional correlation matrix S3 object of class smm with $total_mean, $total_var, $total_sd Chapter 3
print.smm(x) x an smm object Console summary of total mean, SD, and 95% CI Chapter 3

C.3 Sensitivity Analysis

Function Key Arguments Returns Chapter
sensitivity(task_dists*, cor_mat) Same distribution specs as mcs(); optional correlation matrix Named numeric vector of sensitivity indices (one per task) Chapter 4

C.4 Contingency & Correlation

Function Key Arguments Returns Chapter
contingency(mcs_result*, phigh, pbase) mcs_result from mcs(); phigh target percentile (default 0.95); pbase base percentile (default 0.50) Numeric contingency reserve (phigh quantile minus pbase quantile) Chapter 2
cor_matrix(num_samples, num_vars, dists*) dists list of sampling functions function(n) ...; num_samples (default 100); num_vars (default 5) Numeric correlation matrix Chapter 4

C.5 Earned Value Management

All EVM functions accept numeric scalars or vectors as noted.

Function Key Arguments Returns Chapter
pv(bac*, schedule*, time_period*) Budget at completion; cumulative schedule proportions; current period (1-based) Planned Value Chapter 5
ev(bac*, actual_per_complete*) Budget at completion; fraction complete (0–1) Earned Value Chapter 5
ac(actual_costs*, time_period*, cumulative) Vector of actual costs per period; current period; whether actual_costs is already cumulative (default TRUE) Actual Cost Chapter 5
sv(ev*, pv*) Earned Value; Planned Value Schedule Variance (EV − PV) Chapter 5
cv(ev*, ac*) Earned Value; Actual Cost Cost Variance (EV − AC) Chapter 5
spi(ev*, pv*) Earned Value; Planned Value Schedule Performance Index (EV / PV) Chapter 5
cpi(ev*, ac*) Earned Value; Actual Cost Cost Performance Index (EV / AC) Chapter 5
eac(bac*, method, cpi, ac, ev, spi) BAC; method = “typical” / “atypical” / “combined” (default “typical”); cpi required for typical; ac/ev required for atypical; cpi/ac/ev/spi required for combined Estimate at Completion Chapter 5
etc(bac*, ev*, cpi) Budget at Completion; Earned Value; Cost Performance Index Estimate to Complete Chapter 5
tcpi(bac*, ev*, ac*, target, eac) BAC, EV, AC; target = “bac” or “eac” (default “bac”); eac required when target = "eac" To-Complete Performance Index Chapter 5
vac(bac*, eac*) Budget at Completion; Estimate at Completion Variance at Completion (BAC − EAC) Chapter 5

C.6 Bayesian Risk

Function Key Arguments Returns Chapter
risk_prob(causes*, given*, not_given*) Vectors of prior probabilities, likelihoods if cause present/absent Prior risk probability (scalar) Chapter 6
risk_post_prob(causes*, given*, not_given*, observed*) Same as above plus observed vector (1 = observed, 0 = not, NA = unknown) Posterior risk probability after observations Chapter 6

C.7 Learning Curves

Function Key Arguments Returns Chapter
fit_sigmoidal(data*, x_col*, y_col*, model_type*) data a data frame; x_col/y_col column names as strings; model_type = “logistic” / “gompertz” / “pearl” Fitted nls model object Chapter 7
predict_sigmoidal(fit*, x_range*, model_type*, conf_level) Object from fit_sigmoidal(); new x values; model type; optional confidence level Data frame of predictions (with confidence bounds if conf_level set) Chapter 7
plot_sigmoidal(fit*, data*, x_col*, y_col*, model_type*, conf_level) Object from fit_sigmoidal(); original data frame and column names; model type; optional confidence level Plot of fitted curve with confidence band Chapter 7

C.8 Design Structure Matrices

Function Key Arguments Returns Chapter
parent_dsm(S*) Resource-Task matrix S (resources × tasks, binary) S3 object of class dsm ($type is "parent"); $matrix is tasks × tasks Chapter 9
grandparent_dsm(S*, R*) Resource-Task matrix S; Risk-Resource matrix R (risks × resources, binary) S3 object of class dsm ($type is "grandparent"); $matrix is tasks × tasks Chapter 9

Both constructors return an object of class dsm, which has print(), summary() and plot() methods.


C.9 Probabilistic Networks

Function Key Arguments Returns Chapter
prob_net(nodes*, links*, distributions*) Data frames of nodes (id, label, group) and links (source, target, value); named list of distributions Graph object (list of nodes, links, distributions) Chapter 8
prob_net_sim(graph*, num_samples) Graph from prob_net(); number of simulations (default 10 000) Named list of sample vectors, one per node Chapter 8
prob_net_learn(graph*, observations*, num_samples) Graph; named list of clamped observations e.g. list(B = "No"); sample count Named list of sample vectors with upstream nodes clamped Chapter 8
prob_net_update(graph*, remove_links, update_distributions) Graph; data frame of edges to remove; named list of replacement distributions Modified graph object Chapter 8

Node distribution types (used in distributions list):

list(type = "discrete",     values = c(1, 0), probs = c(0.7, 0.3))
list(type = "normal",       mean = 50000, sd = 10000)
list(type = "conditional",  condition = "A",
     true_dist  = list(type = "normal", mean = 80000, sd = 20000),
     false_dist = list(type = "normal", mean = 50000, sd = 10000))
list(type = "aggregate",    nodes = c("F", "G", "H"))

C.10 Agentic Framework

Function Key Arguments Returns Chapter
pra_tools() None List of ellmer tool definitions wrapping the PRA functions Chapter 12
pra_mcp_server() None Starts MCP server; register with claude mcp add Chapter 12