Decision Making Under Uncertainty
Extracted from: ICSE’ 2002 Tutorial on Software Economics
Hakan Erdogmus
Warren Harrison
2
Economic Analysis and Decision Making
• Economic Analysis of Software Engineering is driven by the need to make decisions
• Common problems encountered by decision-makers include:– decision deferral– inability to defend the decision– inconsistent judgement
• Traditional software engineering decision-making is based on technical outcomes
3
Components of a Decision
• Choice involves selecting the “best” alternative under consideration
• A decision has four components:– Actions– States of Nature– Outcomes– Choice Criterion
4
Components of a Decision: Actions
• Actions are alternative things you can do in response to the decision
• Properties of candidate actions:– mutually exclusive– enumerable– initial level of objectivity need not be great, but must
come to pass eventually – start out with subjective description, refine later
5
Components of a Decision:States of Nature
• External events that can affect the efficacy of the alternatives – we can’t control them!
• Events that will certainly occur or events that have no impact on the alternatives should not be considered.
• States of nature are mutually exclusive.• Initial level of objectivity need not be great, but
must come to pass eventually.
6
An Example
• A new income tax package is being planned.• The product needs an installation feature.• We can either license a commercial installation
package or we can build our own.• To develop our own will cost $10,000.• To license a commercial package will entail a
$1.00/unit royalty,but no up front costs.
7
Technical Evaluation
• The effort required to develop the interface software versus the effort required to custom develop all the code
• The maintainability of the COTS software• The reliability of the COTS software• The quality and reliability of vendor support
from NASA Software Management
Guidebook, NASA-GB-001-96More on COTS in Segment 5!
8
Economic Evaluation
• Breakeven Analysis• Expected Cost to Build• Expected Cost to License• Discounted Cash Flow• Buying Options
9
Breakeven Analysis
010000200003000040000
050
00
1000
0
1500
0
2000
0
2500
0
3000
0
3500
0
Sales in Units
Co
st o
f L
icen
se
Dec
isio
n
Build
License
• $10,000 fixed cost vs. $1/unit variable cost• at 10,000 units Building breaks even
10
Outcomes
• For each action, what will the outcome be for each state of nature?– Action: License– Action: Build Our Own– State of Nature: We sell less than 10,000 units– State of Nature: We sell more than 10,000 units– Outcomes: ...
11
Outcome Basis
• The outcome is based on the cost of the action and the benefit of the action– Costs
• Build our own – cost of development• License commercial package – royalty
– Benefits• Product gets installed – does not matter which choice
12
The Decision Matrix
Sales Build License 1,000 units 10,000 1,000 5,000 units 10,000 5,000 10,000 units 10,000 10,000 20,000 units 10,000 20,000 25,000 units 10,000 25,000 30,000 units 10,000 30,000 50,000 units 10,000 50,000 75,000 units 10,000 75,000 100,000 units 10,000 100,000
13
The Decision Matrix
Sales Build License 1,000 units 30% 10,000 1,000 5,000 units 25% 10,000 5,000 10,000 units 20% 10,000 10,000 20,000 units 10% 10,000 20,000 25,000 units 10% 10,000 25,000 30,000 units 2% 10,000 30,000 50,000 units 1% 10,000 50,000 75,000 units 1% 10,000 75,000 100,000 units 1% 10,000 100,000
14
The Decision Matrix
Sales Build License 1,000 units 30% 10,000 1,000/300 5,000 units 25% 10,000 5,000/1,250 10,000 units 20% 10,000 10,000/2,000 20,000 units 10% 10,000 20,000/2,000 25,000 units 10% 10,000 25,000/2,500 30,000 units 2% 10,000 30,000/600 50,000 units 1% 10,000 50,000/500 75,000 units 1% 10,000 75,000/750 100,000 units 1% 10,000 100,000/1,000 Expected Cost $10,000 $10,900
15
Choice Criterion
• Rules we might use to decide which action to choose:– pick the action with the lowest cost for the most likely
state of nature– pick the action that never results in the highest cost– pick the action with the lowest expected cost
16
Expected Cost
• Viability of expected cost is dependent on the assessment of the likelihood of each state of nature
• Garbage-in Garbage-out!• Information is not free – how much is it worth?• How can we measure the worth of more accurate
information?
17
Time Value of MoneyMoney Received or Spent in the Future
• We must spend the money now to build• Royalties are paid out in the future • If we invest the $10,000 rather than spending it
on creating an installation feature at 10%:– 2003: $1,000 interest $11,000– 2004: $1,100 interest $12,100– 2005: $1,210 interest $13,310– 2006: $1,331 interest $14,641
18
A Dollar in the Future is Not Equalto a Dollar Today
Foregone interest: $10,000 today, in a year at 10% interest is $11,000
Risk: the longer before an investment starts paying off, the more likely conditions can change
Liquidity: people value the flexibility to use their funds whenever they want – the longer funds are tied up, the less utility a person receives
Time Value of Money =Opportunity Cost (foregone benefits)+ Risk+ Inflation + Liquidity
19
Present Value and Discounting
• Today’s value of a sum of N periods in the future:
Present Value = (Future Value) / (1 + k)N
Where– k: discount rate per period– N: number of periods
• To fairly compare $10,000 spent today against royalties to be paid out in one year we must discount the cost of the royalties
• Apply to benefits in a similar fashion
20
Net Present Value
• Evaluating Investment Opportunities:
• NPV = Investment – PV(income stream)• Use “cost of capital” as the discount rate• NPV Decision Rule: If NPV > 0 then invest
• Internal Rate of Return (IRR) – the discount rate that drives the NPV to zero …
21
Build vs. License ExampleThe Decision Matrix Revisited
Sales Build PV(License) 1,000 units 30% 10,000 909/272 5,000 units 25% 10,000 4,545/1,136 10,000 units 20% 10,000 9,090/1,818 20,000 units 10% 10,000 18,181/1,818 25,000 units 10% 10,000 22,727/2,272 30,000 units 2% 10,000 27,272/545 50,000 units 1% 10,000 45,454/454 75,000 units 1% 10,000 68,181/682 100,000 units 1% 10,000 90,909/909 Expected Cost $10,000 $9,906
22
Keeping Our Options Open
• It is financially desirable to build our own installation feature if sales rise above 10,000 units
• We can insert “hooks” into the application that will allow us to quickly add our own installation feature if sales turn out to be high.
• Should we invest in adding “hooks”? How much can we afford to invest?
23
Handling Uncertainty
• Models for evaluating process and project management choices under uncertainty:– Should we buy or build?
…Decision Tree Analysis illustrated
– Why are iterative processes viable?… Real Options Analysis illustrated
– Should we implement this feature now?… More options thinking
– Should we develop a prototype?– Should we invest in infrastructure (product line,
framework, component libraries)?
24
Sales Build License 1,000 units 30% 10,000 1,000 5,000 units 25% 10,000 5,000 10,000 units 20% 10,000 10,000 20,000 units 10% 10,000 20,000 25,000 units 10% 10,000 25,000 30,000 units 2% 10,000 30,000 50,000 units 1% 10,000 50,000 75,000 units 1% 10,000 75,000 100,000 units 1% 10,000 100,000
Build vs. License Example RevisitedHow Much to Invest to Add the “Hooks”?
LOW = .75
MED = .22
HIGH = .03
• ½ of projected sales in Q2; rest in Q4
• Decision to build taken at Q2 after based upon Q2 sales figures
25
Build vs. License Example RevisitedConditional Sales Projections and Probabilities
Sales E[Q2 sales] E[Q4 sales] 1,000 units 30% 500 ( = 40%) 5,000 units 25% 2,367 ( = 75%) 2,500 ( = 33%) 10,000 units 20% 5,000 ( = 27%) 20,000 units 10% 10,000 ( = 45%) 25,000 units 10% 11,591 ( = 22%) 12,500 ( = 45%) 30,000 units 2% 15,000 ( = 10%) 50,000 units 1% 25,000 ( = 33%) 75,000 units 1% 37,500 ( = 3%) 37,500 ( = 33%) 100,000 units 1% 50,000 ( = 33%)
LOW
MED
HIGH
Q4 sales projections based on Q2 sales
26
Q0
Build vs. License Decision
Decision Tree for Option to Build
Q2 Q4Build
License
Add Hooks;Start withLicensing
License
License
Build
Build
High:25K < units
Med:10K < units 25K
Low:units 10K
High: . 50K units
Med: 37.5 units
Low: . 25K units
High: 15K units
Med: 12.5K units
Low: 10K units
High: 5K units
Med: 2.5K units
Low: .5K units
.33
.33
.33
.1
.45
.45
.27
.33
.40
.03
.22
.75State Node
Prob.of State
Action Node
Descriptionof State
ActionTime
27
Decision Tree AnalysisCaluculating Cost of Option to Build
B: $10K
L: $37.5K
L: $35.6KPV
B: $10K
L: $11.6K
L: $11KPV
B: $10K
L: $2.4K
L: 2.3KPV
+ $37.5K
+ $11.6K
+ $2.4K
$9.6K
.33
.33
.33
.27
.33
.40
.03
.22
.75
.1
.45
.45
50K
37.5K
25K
15K
12.5K
10K
5K
2.5K
.5K
Q2Q4
PV$9.2K
Q0
E[license cost for Q2]
Fold back DT using dynamic programming
28
Decision Tree AnalysisDT for Cost of “Licensing All the Way”
L: $37.5K
L: $35.6KPV
L: $11.6K
L: $11KPV
L: $2.4K
L: 2.3KPV
+ $37.5K
+ $11.6K
+ $2.4K
$10.6K
.33
.33
.33
.27
.33
.40
.03
.22
.75
.1
.45
.45
50K
37.5K
25K
15K
12.5K
10K
5K
2.5K
.5K
Q4
PV$10.2K
Q0
Q2
E[license cost for Q2]
29
Build vs. Buy DecisionHow Much to Invest to Add the “Hooks”?
Up to this amount can be invested now to add the hooks to match the min cost alternative; otherwise build now!
Alternative E(Cost) Min Cost Difference
A. Build now 10 0B. License all the way 10.2 -0.2C. Option to build 9.2 0.8
10
$K
30
Build vs. Buy Decision… from an Options Perspective
Small investment:Add hooks toacquire the optionto build installationfeature later
Large investment:Build feature
Uncertainty partiallyresolved
High sales:Build feature
Low sales: Continue licensing
Receive benefit:Cost savingsNo license cost
Q4
Q0 Q2
A Real Option
ExpirationDate
Exercise Price
UnderlyingAsset
(uncertain)
OptionValue
31
What is an Option?
• An option is a future discretionary action with an uncertain benefit.
• Financial Options– option contracts written on financial
securities (stocks, commodity prices, exchange rates)
• Real Options– options defined on uncertain benefits
of a real asset, for example future cash flows of a project
CALL OPTION
This contractgives you theright to buyone unit ofXYZ stock
for $15on or beforeJan 5, 2000.
32
Options in Software Development
• Developing a prototype before the full application to resolve technical and user uncertainty.
• Development of a framework for a future product line to allow cost-efficient generation of multiple applications.
• Development of a flexible architecture that accepts components for future extensibility and easy replacement of functionality.
• Waiting to see whether Java gains acceptance before migrating a stable application to Java.
Reusable, flexible architectures:See also Segment IV
33
Why Are Options Valuable?Call Option
Exercise price = $45Current Price = $50
75
35
6 months to expiration
If stock falls to $35
$35 – $45 = –$10 Payoffs atexpiration
Option valueat expiration
If stock rises to $75
$75 – $45 = $30
$30.00Option Exercised
$0.00Option Forgone
Option Pricing: How much should I pay to acquire this option now?
Rational
Exercise
34
Value of an Option Dependson Five Factors
InterestRates
1
Volatility ofUnderlying Asset
2 Time toExpiration
3
4
The exercise price is not paid until expiration. Until then, that money can be earning interest!
The larger the difference between the exercise price and current asset value, the more the asset value has to move to surpass it.
The more time passes, the more chance for the asset value to wander up or down.
The more volatile the asset is, the more likely its value to move up or down over time.
Present Valueof Underlying
Asset
ExercisePrice
RationalExerciseRegion
5
inversely proportionalto factor
proportional to factor
35
Flexibility, Value & Iterative Processes
Why tighter iterations and frequent releases?
Less focus on planningTighter iterations
More frequent releasesScrumDSDM
Crystal Extreme Programming
Feature-Driven DevelopmentAdaptive Software Development
Agile Modeling
Spiral
36
Waterfall: Delivers complete system. Realizes value late.
Value Realization Models:Waterfall vs. Iterative
Develop Rework
End Deploy
Deploy DeployDeployDeploy DeployDeploy Deploy
Iterative: Delivers incomplete system. Maximizes value by delivering early and frequently.
PV =
PV = + + + + +$ $ $ $ $ $
$
$ =
Late Benefit
Sum of Incremental Benefits
37
Black Hole:Large Investment, Single Release
Largeinvestment
Receivebenefit(uncertain)
Release
• Uncertainty resolved at the end• No learning
Projectcancelled!
38
Small Investments, Small Releases
Smallinvestment
Release
Receivebenefit
• Uncertainty resolved gradually in multiple stages• Learning benefits
Multiple options: stop, continue, modify?
Stop => preserve value from previous stages
Each subsequentrelease is anoption on the previous release!
Release
Release
Release
39
Value in the Black Hole
• No schedule slips
• Benefit is uncertain
• Cost and Expected Benefit already in PV terms (already discounted with a risk- adjusted discount rate)
Net Present Value rule says: Don’t do it!
Benefit is uncertain because business, technology, customer/user requirements, or market may change!
Single-State ProjectCost 110Expected Benefit 100NPV –10
40
Alternative:Two-Stage Project with Learning
Release 1 (R1) Release 2 (R2) Overall
FlexibilityPurpose
Uncertainty
Mandatory Learning
More uncertain
OptionalCompletion
Less uncertain
Cost 55 55 110
Benefit(uncertain)
50 R1outcome
?
Volatility(per release)
40% ? ?
Duration(months)
2 2
4
Risk-free rate(per month)
.8% .8% .8%
Same as before
Half the benefit
Same as before
High; same as before
41
What is Volatility?
• Planned Features (PF): features to be included in the next release
• Feature Backlog (FB): extra features yet to be implemented in future releases
• Realized Features: RF PF FB– Feature implemented during the release– Customer still wants and values the feature
P: Customer’s assessment of a feature’s value at planning time
R: Customer’s assessment of a feature’s value after release relative its planned value
• Total Planned Value (TPV) = f PF P(f)
• Total Realized Value (TRV) = f RF R(f)
• ROI = (TRV – TPV) TPV
• Volatility = StDev(ROI)
Release ROI
1 35%2 10%3 -55%4 -65%5 -20%6 -25%7 -15%8 -10%9 25%
10 85%11 50%12 -45%13 -25%14 -5%15 -5%16 55%17 -15%18 25%
Mean 0%StDev 40%
42
Value of Two-Stage Project
ExpectedR1
Benefit
50 50
88
67
38
28
50
88
28
50
122
28
93
41
71 -55 16
R1Outcome
ExpectedR2
Benefit
PayoffAfterR2
PV ofPayoff
NPV +OptionValue
R1Cost
R1 Outcome
X Stop
X Stop
Cont
Discrete model of uncertaintyas a Binomial DT:
Use volatility of benefit to generate a set of possible outcomes
Fold back decision tree using risk-free rate& risk-adjusted probabilities
(R1 Outcome) + E[R2 Benefit] – (R2 Cost)
43
Valuation Using a Replication Strategy
• The valuation method used in the previous example is called risk-neutral valuation.
• The valuation assumes that the payoffs the DT can be replicated by a trading strategy involving an imaginary asset whose uncertainty is correlated with that of the strategy being valued.
• The trading strategy represents the opportunity cost of the strategy being valued => they must have the same present value.
44
Risk-Neutral Valuation
50 50
88
67
38
28
50
122
28
93
41
71
3 Construct a Binomial Tree using u & d factors
5 Fold back Binomial Tree using risk-adjusted probabilities & discounting back at the risk-free rate
…u = 1.33
d = .75
1 Choose granularity: N = 3 states
p = .6
1 – p = .4
3 Calculate optimal payoffs @ decision points
50(.75)
50(1.33)
50(.6) + 28(.4)–––––––––-–- 1 + .008
2 Calculate up & down factors using volatility estimate
4 Calculate risk-adjusted probabilities from u & d
45
Valuation Using a Replication Strategy Constructing the Binomial Tree
Inputs• : estimated volatility per release• N: desired granularity
• number of different states representing possible benefits of a release
• rf: risk-free rate • for 1/(N – 1)th of the duration of a release• observed in the markets or can be set to 0
Outputs• u: upward factor = exp(sqrt(1/(N – 1)))• d: downward factor = 1/u
46
Valuation Using a Replication Strategy Folding Back the Decision Tree
Inputs• u: upward factor• d: downward factor
• rf: risk-free rate
Output• risk-adjusted probabilities to calculate expected values• risk-adjusted probability for an upward move:
p = (1 + rf – d)/(u – d)
• risk-adjusted probability for downward move:1 – p
47
Valuation Using a Replicating StrategyParameters for Build-Buy Example
Inputs• = 40% per release
• N = 3
• rf = 0.8% per month
Outputs• u = exp(0.4 sqrt(1/(3 – 1))) = 1.33• d = 1/u = .75
• p = (1 + rf – d)/(u – d) = (1 + .008 – .75)/(1.33 – .75) = .6
• 1 – p = 1 – .6 = .4
48
DTA vs. Risk-Neutral Valuation
DTA• Needs probability
estimates for each state• Discount rates should
reflect changing risk• No traded twin asset
• More flexible
Risk-Neutral Valuation• Needs only a volatility
estimate• Can use risk-free rate
throughout• Assumes traded twin
asset• Less flexible
The two techniques are fully compatible andcan easily be combined (Smith & Nau, 1995).
49
The more uncertain the benefits are, the more valuable staging is…
Expanded NPV (with option)
0
5
10
15
20
25
30
10
%
20
%
30
%
40
%
50
%
60
%
70
%
80
%
90
%
10
0%
11
0%
Uncertainty (volatility)
Net Present Value + Option Value
50
Value of Delaying Decisions
Time
Reqt’s Design Coding Test Production
Cost of Change?Traditional Assumption
But, what if it were flat?
51
Constant Cost of Change
You could implement the feature today, at a cost of $10
You think it might be worth $15 in benefits... We’ll know in a year!
Great uncertainty
Upside scenario: Customer is grateful
Downside scenario: Customer couldn’t care less––you wasted time and money
You are thinking of implementing a new feature*…
*Source: Beck, Extreme Programming Explained (2000)
52
Option Value of Waiting
$15.00 PV of deferrable feature’s expected benefits$10.00 Cost of implementation
$5.00 Net Present Value of immediate implementation
5% The risk-free interest rate1.0 Years until implementation decision must be taken100% Volatility of feature’s benefit
$7.5* Option value of deferred implementation
*Option value calculated using the standard formula for the price of a call option (Black & Scholes, 1973).
53
Option Value of Waiting Under DifferentChange Cost Models
Cost of Change
0
20
40
60
80
100
120
0 2 4 6 8 10 12 14 16 18 20 22 24
Time (months)
$
Traditional
Flattened
Two different Cost of Change curves
54
To Wait or Not to Wait?
Value of Waiting
0
1
2
3
4
5
6
7
8
0 2 4 6 8 10 12 14 16 18 20 22 24
Time (months)
$
Traditional
Flattened
Traditional: Do it now
Flattened: If it will take more than 9 months for uncertainty to resolve, wait; otherwise do it now
Benchmark NPV
55
Rules of Thumb for Delay Decisions
Traditional Flattened Constant
Un
cert
ain
ty /
Tim
e H
ori
zon
Cost of Change
Sooner Sooner
Sooner Later
Later
Later
Hig
h /
Lo
ng
Lo
w /
Sh
ort
56
SummaryHow Economic Value is Created?
Flexible Practices
Strategic Management
EconomicValue
… increase ability to respond to changing
conditions… encourage learning…support incremental
development…help manage risk
… give rise to options
… makes options valuable
… increases value of options
Uncertainty
BusinessTechnology
RequirementsMarket
… is created & increased by• early value realization
• deferral of large commitments when warranted
• rational exercise of underlying options
IterativeApproaches
… realize value early… creates incentive to earn
early and spend late
Time Valueof Money