# Two experts
# Expert 1 states P(X<30)=0.25, P(X<40)=0.5, P(X<50)=0.75
# Expert 2 states P(X<20)=0.25, P(X<25)=0.5, P(X<35)=0.75
# Both experts state 0<X<100.
v <- matrix(c(30, 40, 50, 20, 25, 35), 3, 2)
p <- c(0.25, 0.5, 0.75)
myfit <- fitdist(vals = v, probs = p, lower = 0, upper = 100)
# Plot both fitted densities, using the best fitted distribution
plotfit(myfit)
# Plot a fitted beta distribution for expert 2, and show 5th and 95th percentiles
plotfit(myfit, d = "beta", ql = 0.05, qu = 0.95, ex = 2)
# Use interactive plotting for for expert 2, and show 5th and 95th percentiles
plotfit(myfit, int = T, ex = 2)
# Plot a linear pool, giving double weight to expert 1
plotfit(myfit, lp = T, lpw = c(2,1))
# Use interactive plotting, giving double weight to expert 1, if a linear pool is displayed
plotfit(myfit, int = T, lpw = c(2,1))
# Plot a linear pool, giving double weight to expert 1,
# show 5th and 95th percentiles, supress plotting of individual distributions,
# and force use of Beta distributions
plotfit(myfit, d = "beta", lp = T, lpw = c(2,1), ql = 0.05, qu = 0.95, ind=FALSE )Run the code above in your browser using DataLab