Demonstration 1

Colour coding:
                              # comments
                              > user commands
                              computer output

# view the example portfolio:

> portfolio

name needs finish sofar commit
1 accountant 20 8 15 y
2 architect 40 10 35 y
3 bizlogo 10 12 0 y
4 shopkeeper 20 15 12 y
5 mathwiz 20 20 5 y
6 doctor 40 25 0 n
7 mailsystem 20 40 0 n
8 athlete 20 40 0 n
9 mapreader 50 45 0 n
10 composer 60 60 0 n

# Interpretation of the columns:
# name: the name of project i .
# needs: estimated total time, in person-days, required for completion of project i  from start to finish.
# finish: deadline for project i , measured in number of days from now.
# sofar: amount of effort, in person-days, expended on project i  up to now.
# commit: whether or not the deadline for project i  is a firm commitment:
#                 `y' denotes a committed deadline, `n' denotes a deadline under consideration.



# Now apply the PROJMAN function to find the probability of portfolio success
# with the deadlines stated in the finish column of portfolio.

# The syntax is:
#
#                                projman(projdat, E, Ntimes, distname, dispersion)
#
# projdat is the portfolio information (here stored with name portfolio);
# E  is the number of employees available to work on the portfolio;
# Ntimes is the number of simulations to perform
#         (the default Ntimes=10000 gives maximum margin of error of 1% on all estimated probabilities);
# distname is the selected distribution name (must be in quotes);
# dispersion is the dispersion associated with the selected distribution, if required.

# distname should be one of:
# "pois" (Poisson), "norm" (Normal), "chisq"(Chi-squared), "gamma" (Gamma),
# "lnorm" (Lognormal), or "lnorm.med" (Lognormal, median specification).
# A dispersion value is required for the Normal, Gamma, and Lognormal options, but can be
# left blank for the Poisson and Chi-squared options.
# dispersion is the variance for the Normal option, the variance/(mean squared) for the Gamma
# and Lognormal options, and the variance/(median squared) for the Lognormal-median option.

# EXAMPLE:
# find the probability of portfolio success for the example data portfolio,
# for a company employing E=4 workers,
# assuming that the effort of each project is Gamma with common dispersion 0.4
# and mean given by the needs column in portfolio.
# Compile results from Ntimes=10000 simulations.

> projman(portfolio, E=4, Ntimes=10000, distname="gamma", dispersion=0.4)

Projects in order from earliest deadline to latest:

[1] accountant    architect    bizlogo    shopkeeper    mathwiz    doctor
[7] mailsystem    athlete    mapreader    composer

Starting Monte Carlo simulations... please wait:

name pc.fail pc.firstfail finish finish.95 finish.99
1 accountant 6.78 6.78 8 9 13
2 architect 36.10 29.95 10 21 29
3 bizlogo 39.40 5.47 12 24 32
4 shopkeeper 43.10 7.39 15 28 36
5 mathwiz 39.26 3.61 20 33 42
6 doctor 62.18 16.29 25 47 58
7 mailsystem 25.97 0.04 40 52 64
8 athlete 42.61 0.92 40 59 69
9 mapreader 66.11 8.79 45 75 88
10 composer 62.40 4.06 60 96 112

pc.success
16.7


# pc.success is the overall probability of portfolio success:
#           here, only 16.7% of the 10000 simulations were successful for all projects.

# The columns are interpreted as follows:
# pc.fail is the percentage of the 10000 simulations for which the deadline for project i  was missed.
# pc.firstfail is the percentage of simulations for which the deadline for project i  was the first to be missed.
# finish is the stated deadline for project i  from the portfolio data.
# finish.95 gives the deadline for project i  that would ensure 95% of the 10000 simulations
#           would meet the deadline for project i.
# finish.99 gives the deadline for project i  that would ensure 99% of the 10000 simulations
#           would meet the deadline for project i.

# finish.95 and finish.99 are included as guidelines, but are not used further
# because they don't take into account the interactions between projects.



# Now apply the SETDATES function to find a set of deadlines to achieve
# some stated level of portfolio success.

# The syntax is:
#
#                                setdates(projdat, E, Ntimes, distname, dispersion, psuccess)
#
# projdat, E, Ntimes, distname, and dispersion are as above.
# psuccess is the required probability of portfolio success: a number between 0 and 1 (default=0.9).

# Only projects with commit=`n' in the portfolio information will be given a modified deadline.

# The function works by finding the probability of failure on the set of committed projects,
# and sharing out any remaining allowed failure equally among the uncommitted projects.
# Thus deadlines on the uncommitted projects are selected so that pc.firstfail is about
# the same for each one.

# Note that setdates chooses a prioritization on projects so that:
#           (a) committed projects are ordered first, by their deadlines;
#           (b) uncommitted projects are ordered next, by their estimated size (the needs column in portfolio).
# A different prioritization of projects would produce different results.

# EXAMPLE:
# find a set of deadlines for the uncommitted projects in portfolio, to achieve an overall probability
# of portfolio success of 0.9, if possible.
# Continue to assume the Gamma distribution with dispersion 0.4.
# Store the result with name dates.

> dates <- setdates(portfolio, E=4, Ntimes=10000, distname="gamma", dispersion=0.4, psuccess=0.90)

Ordered projects:

[1] accountant    architect    bizlogo    shopkeeper    mathwiz    mailsystem
[7] athlete    doctor    mapreader    composer

Sorry: specified failure rate is already exceeded by commitments. Best success rate is 46.42 %

fail.ok (%): 0


# View the deadlines obtained:

> dates

accountant architect bizlogo shopkeeper mathwiz doctor mailsystem athlete mapreader composer
8.00000 10.00000 12.00000 15.00000 20.00000 80.15481 40.68966 50.67344 109.96637 124.09037

# Interpretation:
# It is not possible to achieve 90% success rate on this portfolio, with the assumed probability distribution,
# because the projects with committed deadlines already exceed the allowed 10% failure rate.
# The best possible success rate is about 46%, and this requires deadlines for all the currently
# uncommitted projects to be set so that each one has a 100% success rate (fail.ok=0%).

# The deadlines obtained (dates) are equal to the deadlines stated in portfolio for all committed
# projects (the first five), and are designed to ensure approximately 100% success for the five currently
# uncommitted projects.



# Now test the new deadlines in projman, to check that the success rate of about 46% applies:

> projman(portfolio, E=4, Ntimes=10000, distname="gamma", dispersion=0.4, newfinish=dates)

Projects in order from earliest deadline to latest:

[1] accountant    architect    bizlogo    shopkeeper    mathwiz    mailsystem
[7] athlete    doctor    mapreader    composer

Starting Monte Carlo simulations... please wait:

name pc.fail pc.firstfail finish finish.95 finish.99
1 accountant 6.81 6.81 8.00000 9 13
2 architect 37.05 30.76 10.00000 21 29
3 bizlogo 40.53 5.23 12.00000 24 31
4 shopkeeper 43.67 7.16 15.00000 28 36
5 mathwiz 39.70 3.80 20.00000 33 41
6 mailsystem 3.65 0.00 40.68966 39 47
7 athlete 1.71 0.01 50.67344 45 53
8 doctor 0.19 0.00 80.15481 58 68
9 mapreader 0.06 0.00 109.96637 75 88
10 composer 0.23 0.01 124.09037 96 111

pc.success
46.22

# The achieved success rate on the portfolio with new deadlines is about 46% as expected.
# The five uncomitted projects have pc.firstfail close to 0%, in accordance with fail.ok=0%.



# The same experiment can be repeated assuming that effort follows a Chi-squared distribution.
# No dispersion parameter is required.
# The Chi-squared distribution assumes less variability in the effort distribution
# than the Gamma distribution with dispersion 0.4,
# so we expect a higher probability of portfolio success under this model.

> projman(portfolio, E=4, Ntimes=10000, distname="chisq")


# This gives pc.success=41% roughly (compare with 16.7% under the Gamma model).
# Now check whether it is possible to achieve 90% success rate:

> dates2 <- setdates(portfolio, E=4, Ntimes=10000, distname="chisq", psuccess=0.90)

Ordered projects:

[1] accountant    architect    bizlogo    shopkeeper    mathwiz    mailsystem
[7] athlete    doctor    mapreader    composer

fail.ok (%): 1.086


# View the new deadlines obtained:

> dates2

accountant architect bizlogo shopkeeper mathwiz doctor mailsystem athlete mapreader composer
8.00000 10.00000 12.00000 15.00000 20.00000 41.24688 24.92981 30.27718 55.11012 71.26495


# Interpretation:
# We can select deadlines for the five uncommitted projects so that the overall success rate is about 90%.
# The selected deadlines will have pc.firstfail = 1% (approx) on each uncommitted project (fail.ok=1.086).


# Check the new deadlines in projman.func:

> projman(portfolio, E=4, Ntimes=10000, distname="chisq", newfinish=dates2)

Projects in order from earliest deadline to latest:

[1] accountant    architect    bizlogo    shopkeeper    mathwiz    mailsystem
[7] athlete    doctor    mapreader    composer

Starting Monte Carlo simulations... please wait:

name pc.fail pc.firstfail finish finish.95 finish.99
1 accountant 0.09 0.09 8.00000 4 6
2 architect 1.24 1.18 10.00000 8 10
3 bizlogo 2.75 1.63 12.00000 11 13
4 shopkeeper 2.64 0.99 15.00000 14 16
5 mathwiz 1.96 0.65 20.00000 18 21
6 mailsystem 3.08 1.00 24.92981 24 27
7 athlete 3.24 0.92 30.27718 29 32
8 doctor 3.60 1.21 41.24688 40 44
9 mapreader 3.58 1.30 55.11012 54 59
10 composer 3.47 1.00 71.26495 70 75

pc.success
90.03


# The achieved probability of portfolio success is about 90%, as expected.
# The deadlines on the uncommitted projects each have pc.firstfail close to 1%, as expected.


Last updated:  14th February 2003