# Task duration estimation using betaPERT distribution and Monte Carlo Analysis

July 8, 2015 Leave a comment

I have been researching this seemingly simple topic for many months. After reading many articles and browsing books and asking other experts I have a basic idea about this. Now I also find it ludicrous that our famed project managers in my companies do not seem to know this simple distribution after appearing for the PMP exams. Many managers here care not a coot for such technical items.

According to betaPERT

“The Beta-PERT methodology allows to parametrize a generalized Beta distribution based on expert opinion regarding a pessimistic estimate (minimum value), a most likely estimate (mode), and an optimistic estimate (maximum value).”

I will add more explanations later based on what I understand.

library(ggplot2) opt <- 50 # Optimistic estimate lik <- 100 # Likely estimate pes <- 500 # Pessimistic estimate lambda <- 4 # PERT weighting for likely # PERT estimate is then print( (opt + lambda*lik + pes)/(2 + lambda) ) # Mapping to the beta distribution s1 <- 1+lambda*(lik-opt)/(pes-opt) s2 <- 1+lambda*(pes-lik)/(pes-opt) # Generate 1000 samples from the beta distribution that is scaled to the PERT parameters persondays <- opt + (pes-opt) * rbeta(1000, s1, s2) # Look at the output png("D:/R/persondayssimulation.png") hist(persondays) dev.off() print( summary(persondays)) # Compare to the PERT estimate print( mean(persondays) ) gg <- ggplot(data.frame(persondays), aes(x = persondays)) gg <- gg + geom_histogram(aes(y = ..density..), color = "black", fill = "white", binwidth = 15) gg <- gg + geom_density(fill = "mediumvioletred", alpha = 0.5) gg <- gg + theme_bw() ggsave("D:\\R\\density.png", width=6, height=6, dpi=100)

The book I was asked to read to understand Monte Carlo analysis is Introducing Monte Carlo Methods with R

Credit should go to

for sending me a private mail about this.