Cover Image

PAPERBACK
$39.75



View/Hide Left Panel

FIGURE C.1 A simple event tree for two successive stages (events), each with two outcomes. For this example, each path through the tree represents a unique scenario with its own consequence distribution.

R code implementing this algorithm follows.

n <- 1000000
consq <- rep(0,n)

for (i in 1:n) {
  pa1 <- rbeta(1,2,2)
  pt1 <- rbeta(1,4,1)
  pt2 <- rbeta(1,3,2)

  s1p <- pa1*pt1
  s2p <- pa1*(1-pt1)
  s3p <- (1-pa1)*pt2
  s4p <- (1-pa1)*(1-pt2)

  scen <- rmultinom(1,1,c(s1p,s2p,s3p,s4p))
  if (scen[1] == 1) consq[i] <- rgamma(1,8000,2)
  if (scen[2] == 1) consq[i] <- rgamma(1,4500,1)
  if (scen[3] == 1) consq[i] <- rgamma(1,10000,2)
  if (scen[4] == 1) consq[i] <- rgamma(1,5500,1)
}

hist(consq,freq=F,main=””,xlim=c(3500,6000),
  xlab=”Consequence Distribution”,ylim=c(0,0.0035))
lines(density(consq))
quantile(consq,c(0.05,0.95))
mean(consq)


The National Academies | 500 Fifth St. N.W. | Washington, D.C. 20001
Copyright © National Academy of Sciences. All rights reserved.
Terms of Use and Privacy Statement